Repository navigation
perf(runs): compute the catalogue signature once per load, not once per trial - #313
Merged
harenome merged 1 commit intoNov 23, 2026
Merged
Conversation
…er trial Each parsed trial asked verifier.block_for for its report block, and each call checked catalog.signature(), listing the catalogue folders and stating every benchmark.json: 20,001 calls for a workspace load of 20,000 trials. verifier.held() now looks the table up once for a job's trials and once for a workspace's load_jobs; the next load still sees a changed catalogue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #310
What
Each trial
parse.parse_jobreads askedverifier.block_forfor its benchmark's report block, and each call checkedcatalog.signature(), which lists the catalogue folders and stats everybenchmark.json: 20,001 calls to load 20,000 trials.verifier.held()now looks the report blocks up once for what runs inside it;parse_jobholds them for its trials andworkspace.load_jobsfor its jobs, so a workspace load checks the catalogue once. Outside aheld(),block_foris as before, and the next load sees a catalogue changed since (a benchmark added, a report block edited). The held table is a context variable, so concurrent requests in other threads do not share it.Touches
backend:
app/nullius/runs/verifier.py,app/nullius/runs/parse.py,app/nullius/workspace.py; tests inapp/tests/test_workspace.py.Verified
Backend suite: 3214 tests in 169 modules, OK. Route suite: 717 tests in 61 modules, OK. Both in a rootless
python:3.12container.New tests: a
load_jobsof 22 trials callscatalog.signatureonce (22 times before the change); nestedheld()keeps the outer table, and a catalogue changed between two loads is seen by the second.The first
/workspacesafter a start, on 20 workspaces of 20 ended Harbor jobs of 50 trials (20,000 trials, the generator in Workspaces: counting a workspace's runs decodes every trial of every job #309), main and this branch alternated on the same profile, 3 starts each, median and range:parse.SCHEMAchangeThe next request is 0.02 s on both.
cProfile of the start with no caches (werkzeug
ProfilerMiddleware):Risk
A catalogue edited while one load runs is seen by the next load, not halfway through it. Code that reads report blocks outside
parse_jobandload_jobs(for exampleTrial.vocabwhile a page renders) still checks the signature per call, as before. Undone by a revert.