Skip to content

perf: reduce CI and report-check latency - #257

Merged
lanyue-llk merged 11 commits into
mainfrom
codex/ci-report-release-performance
Nov 6, 2026
Merged

lanyue-llk merged 11 commits into
mainfrom
codex/ci-report-release-performance

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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

  • 348 affected report/link/scoring tests and 4,034 subtests pass; the 167-test snapshot/encoding/privacy/CI run passes.
  • The lazy-evidence URL correction has four red/green controls: missing and escaping files at the first and last inventory buttons. Its 232-test report/link/CI regression run passes.
  • A read-only three-way integration preview with feat(web-extract): benchmark self-hosted engines and local models #258 is conflict-free. The recursive-browser-exclusion regression also passes against the combined Makefile. No branch was merged.
  • Retired framework references and its exclusive tests/docs are removed. Benchmark scores, provider calls and deployed reports are unchanged.

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.

Operation Main This PR Reduction
Complete benchmark catalog validation 6.674 s 3.812 s 42.9%
Complete SWDE report check (800 pages × 6 methods) 115.535 s 54.506 s 52.8%
100 publication-input guard checks 0.915 s 0.594 s 35.0%

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.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review complete · 2a151a1

No findings in this review.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review complete · 7165aa8

No findings in this review.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review complete · 84f93e5

No findings in this review.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against origin/main at fe47b246. The PR merges cleanly and CI is green. I found no correctness regressions:

  • --ci-shard rejects 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 = exclude reaches test-python through test, so local make ci still runs the browser tests once, in browser-check.
  • The Python 3.11 gate 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 setUpClass or 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).

Comment thread src/lexbench_webfetch/benchmark.py Resolved
Comment thread src/harness/reporting/links.py Resolved
@lanyue-llk lanyue-llk changed the title perf: reduce CI and report publication latency perf(reporting): scope validation work and parallelize CI Nov 6, 2026

@lexmount-ocr lexmount-ocr Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Review complete · 9db52e8

This review found 2 issue(s), including 2 blocking issue(s).

Comment thread src/harness/reporting/release_check.py Resolved
Comment thread src/harness/web_extract/report.py Resolved

@lexmount-ocr lexmount-ocr Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Re-review complete · 1208ece

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/harness/web_extract/report.py Resolved

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Re-review complete · 437cba7

No findings in this incremental review.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_step decorators.
  • A ContextVar that tracks the current check.
  • A fingerprint of all checker code files and uv.lock, with its own lru_cache keyed 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:

  1. 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 needs BROWSER_EVAL_FULL_REPORT_CHECK=1. That contradicts the LinkIndex docstring ("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.
  2. 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.
  3. 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 ...).

Comment thread src/harness/reporting/release_check.py Resolved
Comment thread src/harness/reporting/release_check.py Resolved
Comment thread src/harness/web_extract/report.py Resolved
Comment thread src/harness/web_search/report.py Resolved
@lanyue-llk

Copy link
Copy Markdown
Contributor Author

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:

  • Formal release checks, acceptance CLI, packaging and publishing always run fresh checks and never read or update routine receipts. Future Make release targets inherit full mode automatically.
  • Removed the manual callback/input-list API, compiled-function fingerprints, metadata cache and Windows branch. One source/lock/runtime identity remains.
  • Receipts contain only hashes of successful pure void validations. Scoring, normalization, calculated outputs and closures always execute.
  • Kept the strict UTF-8 and single-registry fixes. Browser-test selection is now exported to recursive Make; the regression exercises the nesting used by feat(web-extract): benchmark self-hosted engines and local models #258.

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.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Re-review complete · ebb4097

No findings in this incremental review.

@lanyue-llk lanyue-llk changed the title perf(reporting): scope validation work and parallelize CI perf: speed up CI and routine report checks Nov 6, 2026

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third review, at ebb40977, against origin/main.

Addressed: thanks. This is a real improvement.

  • release=True, require_complete and the publish/package paths now always run the full check and never read saved results.
  • validated() and its hand-listed cache keys are gone; only validation_step remains, for functions that return nothing.
  • The fingerprint of each validator's compiled code is gone.
  • export BROWSER_TESTS fixes 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:

  1. The release / require_complete arguments, detected in scoped_check.
  2. @full_validation() on six publish/package functions.
  3. The BROWSER_EVAL_FULL_REPORT_CHECK environment variable, exported by the Makefile and forced by a %-release-check pattern 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.

Comment thread Makefile Resolved
Comment thread src/harness/reporting/release_check.py Resolved
Comment thread src/harness/reporting/release_check.py Resolved

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Re-review complete · 2881816

This review found 1 issue(s), including 1 blocking issue(s).


bug · medium

📄 src/harness/web_extract/report.py (L4344-L4345)

⚠️ GitHub could not post this as an inline comment: Lines 4344-4345 could not be resolved (outside PR diff hunks)

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.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Re-review complete · 095302e

No findings in this incremental review.

@lanyue-llk lanyue-llk changed the title perf: speed up CI and routine report checks perf: reduce CI and report-check latency Nov 6, 2026
@lanyue-llk

Copy link
Copy Markdown
Contributor Author

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

  • 348 affected report/link/scoring tests and 4,034 subtests pass; the 167-test snapshot/encoding/privacy/CI run passes.
  • The lazy-evidence URL correction has four red/green controls: missing and escaping files at the first and last inventory buttons. Its 232-test report/link/CI regression run passes.
  • A read-only three-way integration preview with feat(web-extract): benchmark self-hosted engines and local models #258 is conflict-free. The recursive-browser-exclusion regression also passes against the combined Makefile. No branch was merged.
  • Retired framework references and its exclusive tests/docs are removed. Benchmark scores, provider calls and deployed reports are unchanged.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-shard rejected. The browser tests run once, and the exported BROWSER_TESTS also 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/* and code-migration.json. That's fine on current main, but whichever of this PR and the LexBench extraction lands second must carry these two changes into lexmount/lexbench-webfetch.

@lanyue-llk
lanyue-llk merged commit d4fb973 into main Nov 6, 2026
8 checks passed
@lanyue-llk
lanyue-llk deleted the codex/ci-report-release-performance branch November 6, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant