Repository navigation
Add infrastructure to allow CLI to cache individual webwork - #3300
oscarlevin wants to merge 1 commit into
Conversation
|
Review coming from Claude.
|
|
Thanks, Oscar. Moving the conversion to one problem at a time looks right, and it reproduces master's output exactly. Notes below, the first one the most important. TestingI built the WeBWorK representations of
1. The per-problem file does not hold everything a problem's rendering depends onThe new comment in
With 2. Two changes in behavior, both improvements
3. Comment alignment in
|
|
At least two more WW related PRs, #3315 being one. I've not checked the effect on a rebase for thiose. |
55fdc02 to
23f1df7
Compare
23f1df7 to
a392642
Compare
|
Thanks, Rob (and Claude). Rebased onto current master (no conflicts with #3314 or #3315) and force-pushed as a single commit, 1. What the per-problem file guarantees. You're right, it names macro files without holding them. Two changes here:
On the CLI side (PreTeXtBook/pretext-cli#1263), each cache entry now also records a stamp. The stamp is a hash of the server's version and of every file in
A problem hosted on the server, or the course's macros there, can still change without anything on our side noticing. The CLI documents that 2. Behavior changes. No changes. 3. Comment alignment. Fixed at both places. 4. Duplication. Removed the origin loop in 5. Commit subject. Now Retesting. I built Co-authored with Claude Opus 5.5 |
Just like we do for the main image types, it would be helpful to let the CLI cache individual webwork representation files (and any other files, like images needed for the problems). This is possible now that we don't build the one giant representations file.
This is set up the same way as the image caching. Split out the parts of the webwork generation script that take the result of extract_pg.xsl and send them to the server (or process locally) to get the representation and other files. Core calls this (
individual_webwork_conversion) whenwebwork_to_xmlhasext_converter = None. But the CLI can setext_converterto its own individual webwork generating function, that first checks the cache before calling core'sindividual_webwork_conversionif needed.One tweak to xsl was required: we need to extract the pg into individual files to get the hash that the cli uses.
Claude tested before and after, both with the CLI and only pretext script, on a document with 500 webwork questions. Before and after with the pretext script took 114 and 113 seconds (so the extracting individual pg files didn't cost anything). It took 115 seconds for the CLI on first run (nothing cached), but then changing just one problem took only 5.6 seconds (5.2 seconds with nothing changed). This should make @sean-fitzpatrick very happy.
Also heads up for @Alex-Jordan. I don't think there is anything functionally different about the webwork code, except how it is organized.