Repository navigation
perf: reduce CI and report-check latency - #257
Conversation
lanyue-llk
left a comment
There was a problem hiding this comment.
Reviewed against origin/main at fe47b246. The PR merges cleanly and CI is green. I found no correctness regressions:
--ci-shardrejects invalid values instead of silently dropping tests.- Node IDs are hashed with SHA-256, so the split doesn't depend on Python's per-run hash seed.
ci-tests: override BROWSER_TESTS = excludereachestest-pythonthroughtest, so localmake cistill runs the browser tests once, inbrowser-check.- The
Python 3.11gate still fails if either matrix leg fails. - Each cache is created inside a single check, so the next check sees edited files.
The inline comments cover the remaining points. Two general ones:
- No picture in the PR body. Please add one picture of the main content, for example a before/after timing chart of the three local operations.
- Note, not a defect: hashing each test separately splits a module's tests, and shared
setUpClassor module-level fixtures, across both runners. That setup runs twice, which accounts for part of the extra runner-minutes the PR body mentions.
Verdict: ready after the picture is added. Agree on a merge order with the LexBench extraction work first (see the benchmark.py comment).
There was a problem hiding this comment.
This review found 2 issue(s), including 2 blocking issue(s).
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
There was a problem hiding this comment.
✅ Re-review complete · 437cba7
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Follow-up review of 437cba79 against origin/main.
Addressed: thanks. require_scoring_regressions now takes registry=, and LinkIndex takes errors=.
New concern: the PR has grown from +282 to +1,124 lines. Commits 58694d94 to 437cba79 add a cache that saves report-check results and reuses them in later runs. It consists of:
scoped_check/validated/validation_stepdecorators.- A
ContextVarthat tracks the current check. - A fingerprint of all checker code files and
uv.lock, with its ownlru_cachekeyed on file metadata and a separate Windows path. - A second fingerprint per validator, from the bytes of its compiled function.
- Saved result files under
~/.browser-eval/report-checks/and two new environment variables.
It's wired into 8 report checkers across every track, documented in three places, and covered by 359 lines of new tests. The inline comments give the details. The main problems:
- Release checks can now pass on saved results.
check(..., release=True)can skip work based on a file from an earlier run, and a full check needsBROWSER_EVAL_FULL_REPORT_CHECK=1. That contradicts theLinkIndexdocstring ("never across releases"), AGENTS.md ("Run the separate full release check before packaging or publishing") and this PR's own statement that it adds no benchmark-result changes. - Each call site lists its cache inputs by hand, separately from the function being cached. A missed input means a stale result is reused without anyone noticing.
- It's outside the PR's scope. The CI split and the caches that live only within one check already achieve the latency goal.
Recommendation: revert 58694d94, 9db52e8f, 1208ece6 and 437cba79, but keep the two fixes above. If reusing check results across runs is still wanted, open an issue and do it in a separate PR, with a release path that always runs the full check.
Heads-up on combining this PR with #258: #258's latest Makefile runs $(MAKE) -j2 test test-extraction-sdk inside ci-tests. A sub-make doesn't inherit this PR's target-specific ci-tests: override BROWSER_TESTS = exclude. Once both land, the primary shard would run the browser-test modules again. Export the variable or pass it to the sub-make explicitly ($(MAKE) BROWSER_TESTS=exclude ...).
|
The owner explicitly requested automatic change-aware checks across tracks in this PR. I kept that requested behavior for routine checks and narrowed the implementation:
The focused runs pass: 339 publication-boundary tests, 500 related report/upload contracts, and 105 final snapshot/scope/Make tests. The release-cache issue has a before/after reproduction. CI and automatic re-review are running on the updated head. |
There was a problem hiding this comment.
✅ Re-review complete · ebb4097
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Third review, at ebb40977, against origin/main.
Addressed: thanks. This is a real improvement.
release=True,require_completeand the publish/package paths now always run the full check and never read saved results.validated()and its hand-listed cache keys are gone; onlyvalidation_stepremains, for functions that return nothing.- The fingerprint of each validator's compiled code is gone.
export BROWSER_TESTSfixes the sub-make issue with #258's$(MAKE) -j2.
What's left is still more machinery than the PR needs. The saved-results cache now has three overlapping ways to force a full check, plus a fingerprint of the whole source tree computed twice per check:
- The
release/require_completearguments, detected inscoped_check. @full_validation()on six publish/package functions.- The
BROWSER_EVAL_FULL_REPORT_CHECKenvironment variable, exported by the Makefile and forced by a%-release-checkpattern rule.
It's also documented in three places (docs/report-hosting.md, SKILL.md, report-and-release.md).
Is the cross-run reuse worth it? The PR's performance table was measured before this cache existed. The 44%, 51% and 49% reductions come from the CI split and the caches that live only within one check. Please add a same-host measurement of what saved results gain on a repeated check, after subtracting the cost of the source-tree fingerprint. If the gain is small, drop the saved-results layer: _CheckSession, scoped_check, validation_step, the full_validation decorators, the Makefile rule and the docs. The PR would then be its original, easy-to-review size.
If it stays, keep one mechanism. Release and publish boundaries call full_validation(). Remove the environment variable and the Makefile pattern rule, and describe it in one doc only.
Merge conflict: #257 and #258 now conflict in Makefile and tests/golden/web-search.json.
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
📄 src/harness/web_extract/report.py (L4344-L4345)
P2: Preserve validation of data-src evidence targets. The previous link_index.page(file).values included data-src, but this selector excludes the buttons generated by evidence_button(), including inventory diagnosis controls. The inlined detail check only validates the first button in each participant detail, and check_presentation() checks dialog structure rather than file targets. Consequently, a report built with a broken inventory button URL (and matching manifest hashes) now passes this checker even though opening its evidence fails. Include [data-src] and validate its URL as before; add a negative control for a broken inventory evidence target.
There was a problem hiding this comment.
✅ Re-review complete · 095302e
No findings in this incremental review.
|
CI divides Python tests by stable node-ID hashes across two runners. The existing browser job owns browser tests once; both Python shards, packaging and browser checks must pass the required status. Documentation-only changes keep their lightweight path. Browser-test exclusion is exported to recursive Make, including #258's nested test invocation. Report checks always validate the current inputs. The optimizations are confined to one invocation: load review definitions and the scoring-control registry once, and index link targets once while checking every reference. No saved validation passes, source-tree fingerprints, validation decorators, extra environment switches or release-mode rules remain. Strict UTF-8 decoding and evidence-index/case-ID bindings are preserved. Publication input guards reuse directory-entry metadata while retaining mutation, hash and symlink checks. Publication timings distinguish preparation, upload/recovery and deployed-byte verification. The documented publish flow avoids repeating check/package steps that the publisher already owns. Validation
|
lanyue-llk
left a comment
There was a problem hiding this comment.
Fourth review, at 095302e8, against origin/main (0 commits behind, merges cleanly, also with #258). This round looks only for P0/P1 issues.
No P0/P1 findings.
The cross-run check cache is fully removed (6b93c695). The PR is back to its stated scope (+367/−50):
- CI test split: stable SHA-256 sharding by test ID, with an invalid
--ci-shardrejected. The browser tests run once, and the exportedBROWSER_TESTSalso covers sub-makes. - Report checks: they reuse what they already parsed, but only within one check. Web Extract now reads target pages as strict UTF-8 (
LinkIndex(errors="strict")). - Lazy evidence: the record report check now validates every link target, including
data-src, and checks that each evidence key matches the case ID inside its record. - Publishing: it prints elapsed time per phase.
I found no regressions in these paths.
Remaining items, not blocking:
- No picture in the PR body yet. The team's PR rule asks for one picture of the main change.
- Merge order with the LexBench extraction. This PR still edits
src/lexbench_webfetch/*andcode-migration.json. That's fine on current main, but whichever of this PR and the LexBench extraction lands second must carry these two changes intolexmount/lexbench-webfetch.
CI divides Python tests by stable node-ID hashes across two runners. The existing browser job owns browser tests once; both Python shards, packaging and browser checks must pass the required status. Documentation-only changes keep their lightweight path. Browser-test exclusion is exported to recursive Make, including #258's nested test invocation.
Report checks always validate the current inputs. The optimizations are confined to one invocation: load review definitions and the scoring-control registry once, and index link targets once while checking every reference. No saved validation passes, source-tree fingerprints, validation decorators, extra environment switches or release-mode rules remain. Strict UTF-8 decoding and evidence-index/case-ID bindings are preserved.
Publication input guards reuse directory-entry metadata while retaining mutation, hash and symlink checks. Publication timings distinguish preparation, upload/recovery and deployed-byte verification. The documented publish flow avoids repeating check/package steps that the publisher already owns.
Validation
Performance
Same host and frozen evidence; two serial rounds alternate before/after order, with round 2 selected before measurement. Each check runs fresh. Source and Python hashes, every timed call, and matching semantic hashes are retained with the private performance evidence.
All 1,634 generated report files match the preceding report except the build-version and manifest metadata; HTML, metrics and public evidence are unchanged. The build used the retained, hash-verified snapshot manifest because live snapshot transport was unavailable; measured checks use local frozen evidence.
Current-head CI passes all jobs. Incremental re-review reports no findings; no review threads remain unresolved.