spdegabrielle
2020-1-13 10:18:22

firgures 1–9 which are lo rez images are blank for me but 10 and 11, which are line art (plots) are fine


spdegabrielle
2020-1-13 10:24:12

problem seems to have happened in 2018 https://discussions.apple.com/thread/8628664


spdegabrielle
2020-1-13 10:34:06

also https://discussions.apple.com/thread/7659306 (I have not tried the ‘solution’ comment as lower comments indicate it didnt work)



spdegabrielle
2020-1-13 10:47:11

I just uploaded a version that works; I viewed the PDF from http://www.ccs.neu.edu/home/stamourv/papers/optimization-coaching.pdf in microsoft Edge on windows 10, the printed with the ‘Microsoft Print to PDF’ driver.


spdegabrielle
2020-1-13 10:47:33

@stamourv


spdegabrielle
2020-1-13 10:49:47

@stephen


stamourv
2020-1-13 16:04:43

That’s very strange. pdfjs in FF on MacOS just worked fine for me…


stamourv
2020-1-13 16:05:26

In general, though, MacOS’s native pdf rendering has not been great IME.


soegaard2
2020-1-13 17:27:09

I recommend PDF Expert.


wdobias
2020-1-13 20:13:12

@wdobias has joined the channel


deactivateduser60718
2020-1-13 22:26:13

I’m trying to run a profile for a build on my filesystem. I ran raco setup --mode errortrace polyglot after clearing the .zo files as instructed. Then, I wrote this script.

#lang racket/base (require errortrace polyglot "./cli/shared.rkt") (when (instrumenting-enabled) (profiling-enabled #t)) (clear-profile-results) (define-values (directory project build!) (init-from-user-path (build-path "/home/sage/Code/sgcom"))) (build!) (output-profile-results #t #t) I’m guessing as per the docs warning, this crashes as below since I required errortrace. If I use (require errortrace/errortrace-lib) instead, the program runs, but the profile data is empty. How am I supposed to modify this program to get expected results?

; /usr/share/racket/pkgs/errortrace-lib/errortrace/private/utils.rkt:26:18: #%require: unbound identifier; ; also, no #%app syntax transformer is bound ; at: #%require ; in: (#%require (for-meta 0 errortrace/errortrace-key)) EDIT: Brevity + add context


mflatt
2020-1-13 22:34:49

You could run the script as racket -l errortrace -t <script>, or do require errortrace but load the program to profile via dynamic-require instead of require. I’d write the latter.


deactivateduser60718
2020-1-13 22:41:47

In trying my interpretation of both options, I hit the same error #%require: unbound identifier.

My files now look like this:

subject.rkt: I reproduce the error when running racket -l errortrace -t subject.rkt #lang racket/base (require polyglot "./cli/shared.rkt") (define-values (directory project build!) (init-from-user-path (build-path "/home/sage/Code/sgcom"))) (build!) profiler.rkt: I’ve been running this using as racket profiler.rkt #lang racket/base (require errortrace) (when (instrumenting-enabled) (profiling-enabled #t)) (clear-profile-results) (dynamic-require (build-path "./subject.rkt") #f) (output-profile-results #t #t)


deactivateduser60718
2020-1-13 22:42:09

Did I misinterpret something?


deactivateduser60718
2020-1-13 22:42:41

It might help to note that build! makes heavy use of dynamic-require under the hood, if that’s relevant.


mflatt
2020-1-13 23:03:58

I tried raco setup --mode errortrace, and I see that it doesn’t really work. There are various problems with the --mode idea, and I guess it hasn’t been practical enough for anyone to try lately. In your case, you probably have multiple processing cores, and --mode turns out to be ignored when raco setup runs in parallel-build mode. DrRacket should be able manage compilation with errortrace ok, so that’s one way to go. Outside of DrRacket, I normally just throw away compiled code and load from source for profiling, so maybe that will work better for you. I’m not sure about the #%require problem, though. Does your code use eval? Or does racket -l errortrace -l racket/base -t subject.rkt change anything?


deactivateduser60718
2020-1-13 23:05:56

I’ll try loading from source now. Running the modified racket command had no change in behavior and I do not use eval.


deactivateduser60718
2020-1-13 23:06:33

I almost never use DrRacket, but I’ll lean on it if I don’t make much progress from here. You are correct in that I have multiple cores.


deactivateduser60718
2020-1-13 23:09:27

After running git clean -fdX to blow away all compiled directories, racket -l errortrace -l racket/base -t subject.rkt still produces the same error.


deactivateduser60718
2020-1-13 23:12:26

More details:

• I am still on Racket 7.4 • subject.rkt sits inside polyglot’s source code on my file system I’m going to try again, but using DrRacket on ~7.6~ 7.5 such that the definitions window holds the source of profiler.rkt and subject.rkt is somewhere else. Please comment if I should change my approach, since this will take me about 10–15 min


mflatt
2020-1-13 23:24:21

In DrRacket you’d set the language to enable profiling (in “Choose Language -> Show Details -> Debugging and profiling”) and just run subject.rkt. DrRacket should then display profiling information.


deactivateduser60718
2020-1-14 00:06:09

@mflatt: Okay, got some progress. Here’s what I did.

  1. Uninstalled Racket 7.4
  2. Installed Racket 7.5 (3m)
  3. Reinstalled polyglot from directory source using raco pkg install --link
  4. Ran git clean -fdX to delete all compiled directories and thus .zo files in polyglot and two local dependencies also installed with --link (That turned out to not be relevant; I checked)
  5. Moved profiler.rkt and subject.rkt to ~/Code/sgcom and updated their paths to match
  6. Opened subject.rkt in DrRacket
  7. Changed (build!) to (void (build!)) to reduce noise in output
  8. “Choose Language -> Show Details -> Debugging and profiling”
  9. Clicked Debug Run, then Go
  10. “View -> Show Profile”

Unfortunately the profiler results don’t give me paths to know where for-loop or << unknown >> are (see attached screenshot), so I tried to go back to running profiler.rkt. That still reliably reproduces the #%require error after much wrestling. I wonder if that’s related to https://github.com/racket/errortrace/pull/17?

Really all I need at this point is to see the paths mentioned in each profile line item. Can I turn that on in the GUI? I don’t see an option for it in the preferences dialog or the language selection dialog.


mflatt
2020-1-14 00:25:22

That pull request probably explains why it’s #%require instead of require, but then the question is still: who is calling eval? Does the stack trace with the #%require error message provide any hints?


mflatt
2020-1-14 02:37:09

@deactivateduser60718 Robby suggests adjusting https://github.com/racket/drracket/blob/master/drracket/drracket/private/debug.rkt#L2371 to recognize path values, or just use (format "~a" src) as a fallback to catch everything.


robby
2020-1-14 04:00:16

Yes I think that that’s a bug in drr