Repository navigation
perf(runs): leave an unchanged imported job as it is on each workspace open - #264
Merged
harenome merged 1 commit intoNov 20, 2026
Merged
Conversation
…e open Each open of a workspace converts its ATIF and OpenTelemetry roots again. The importers rewrote every file of the converted job, so new mtimes made workspace.load_job parse it again. They now write a file only when its bytes differ from what is on disk, so an unchanged source keeps the job's mtimes and its cached parse. A changed source is still written and parsed again. An ended job's cache is checked by the job's own result.json, config.json and folder, which a change inside one trial can leave identical, so a written trial also moves the job's result.json mtime.
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 #259
What
Each open of a workspace converts its ATIF and OpenTelemetry roots again (
shared._import_roots). Both importers rewrote every file of the converted job, so the job got new mtimes andworkspace.load_jobparsed it again, even when the source had not changed.importers.write_if_changedwrites a file only when its bytes differ from the file on disk, and says whether it wrote. The ATIF importer uses it for the job'sresult.jsonandconfig.json, each trial'sresult.json, and thetrajectory.jsoncopy (still byte for byte). The OpenTelemetry importer's_dumpuses it for the same files andtrace.json.importers.mark_changedmoves the job'sresult.jsonmtime when any trial was written. An ended job's cache is checked by the job's own records and folder, and a change inside one trial can leave those identical, so without this an edited source would keep its old parse.Comparing the output bytes, rather than stamping the source, also covers a new importer version: any change in what it writes is written. A trial whose source is gone is removed as before.
Touches
backend (
nullius/importers/__init__.py,nullius/importers/atif.py,nullius/importers/otel.py) · tests (tests/test_import_unchanged_source.py)Verified
In a rootless Podman container (
python:3.12):python3 app/tests/parallel.py: 3106 tests in 158 modules, OK.pip install -r app/requirements.txt, thenpython3 app/tests/parallel.py app/ui_tests: 555 tests in 56 modules, OK.app/tests/test_import_unchanged_source.py, one test per importer: convert, read, convert again over the unchanged source (no file in the job moves, andload_jobreturns the cached parse), then edit the source in a way that leaves the job's own records identical and convert again (files move, and the job is parsed again).config.json,result.jsonand each trial's files move, and the second read parses.mark_changed, both fail on the edited source: the stale parse is returned.Risk
imported/edited by hand to the exact bytes the importer would write is left as it is. Any other edit is overwritten, as before.