Repository navigation
perf(harness): verify each retained candidate once per record read - #669
Conversation
Signed-off-by: amy-why-3459 <[email protected]>
Signed-off-by: amy-why-3459 <[email protected]>
Bounty-hunter
left a comment
There was a problem hiding this comment.
deepseek-v4.1-flash (agent), acting for @Bounty-hunter.
PR review verdict — DO NOT PASS
Reviewed base 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head ebda55d045e4aaaf1a9bd2b914de4dcba8ccef9e (2 commits, 2 files). The polled head fe6d5db is superseded; ebda55d only wraps the new assertion, so this review covers the current head.
Blocker — no governing Issue, so the accepted scope and the merge gate cannot be established.
The live body has no ## Governing Issue and delivery slice section and no Refs #N. docs/agent-collaboration.md says "A governing Issue supplies scope via Refs #N in the PR body"; the PR template starts with that section, and merge-pr check 4 holds a PR whose body has no Refs #N. The body links acceptance issue #668, but says the model's end-to-end latency "is evaluated separately" there, so #668 is not presented as this slice's governing Issue. Required correction: add Refs #<issue> for the accepted Issue that owns this harness performance slice. If no Issue covers it yet, open or record one with its scope and accountable owner so the merge gate can be checked, then request re-review.
What I checked, and what remains unverified
Code and tests. The change adds from functools import cache, wraps candidates.identity in _load (optimization.py:125), and routes the baseline (:126), selected-best (:128) and retained-round (:157) comparisons through it. The wrapper is local to _load, so it deduplicates a path only within one read and every later read recomputes; each stored digest is still compared independently. The new test asserts one call for a baseline-only read, exactly [baseline, selected] after a round selects a different candidate, and a Selected candidate changed error on the read after the selected config.json is modified. The ebda55d delta only wraps the assertion line. On this head all 10 check runs are success; ruff check src tests tools reports "All checks passed!" and the full-check (3.11) log reports 7395 passed, 89 skipped.
Not verified. I did not reproduce the six-run 1.641 s → 1.081 s (34.1%) timing or the 2,610-file campaign; that measurement remains the author's.
Optional, not blocking. Within one _load, a file modified between the baseline and the selected/retained comparisons is no longer re-read, so a later comparison can accept the cached digest. The read is already non-atomic and the comment states "Verify its bytes once per load"; I do not treat this as a blocker.
Agent-assisted-by: Codex (regression test and validation) Signed-off-by: amy-why-3459 <[email protected]>
Bounty-hunter
left a comment
There was a problem hiding this comment.
LGTM
Claude Code agent, acting for @Bounty-hunter.
PR review verdict — PASS
Reviewed base 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head 8b3c519fdd57205fda6618b07a9d6b075a61d1fc. This re-review clears the earlier Request changes on ebda55d.
Earlier blocker, new commit, checks and unverified parts
Earlier blocker resolved. The previous review held the PR because the body had no governing Issue. The body now opens with ## Governing Issue and delivery slice / Refs #673. #673 (kind:task, area:harness) names @amy-why-3459 as accountable contributor and accepts exactly this slice: "Within one record read, compute the current identity once for each distinct selected, baseline or retained candidate directory. Compare each stored digest against that identity. On the next read, recompute the identities". The issue-scope review on #673 by zengchuang-hw is PASS, and the author answered the dedup-key question there (pathlib.Path key, trailing slash and . normalized, symlinks still rejected by identity).
New commit 8b3c519. It only adds a test to tests/apps/test_project_optimization.py (+19/−0). test_shared_candidate_path_still_checks_each_recorded_digest rewrites state["best"]["path"] with a trailing / and sets state["best"]["sha256"] = "0" * 64. It then asserts read_records raises Selected candidate changed while identity is called exactly once with root / "frozen/baseline". That is the case #673 cares about: one hash for an aliased path, and each role still compares its own stored digest. The implementation in src/inferrsi/harness/optimization.py is unchanged from ebda55d. My earlier read of it still applies: the cache-wrapped identity is built inside _load, so every later read hashes again.
Checks on this head. At review time, 9 of 11 check runs were success (lint-and-smoke, pr-references, declarations, dashboard-browser, installed-package 3.10/3.11, advisory macOS/Windows host-compatibility). full-check 3.10 and 3.11 were still in progress. On the previous head ebda55d, which has the same source, full-check (3.11) reported 7395 passed, 89 skipped. Merge should still wait for both full-check jobs to go green on 8b3c519.
Not verified. I did not rerun the tests locally and did not reproduce the six warm timing pairs (1.641 s → 1.081 s, 34.1%) on the 2,610-file campaign. That measurement remains the author's. A reviewer on #673 independently recomputed the medians from the listed numbers.
Optional, not blocking (carried over). Within one _load, a file modified between the baseline comparison and a later role's comparison is not re-read. The read was already non-atomic, and the code comment states this.
david6666666
left a comment
There was a problem hiding this comment.
LGTM
Dot, acting for @david6666666 (repository admin) under delegated independent InferRSI PR review and approval.
PASS — reviewed base 62949701cb03d7ade1c9d6fe71fb7923191cb627 and head 8b3c519fdd57205fda6618b07a9d6b075a61d1fc for #673. The cache is constructed inside each record load. The baseline, selected and retained-round roles still compare against their own recorded digests, and the next load hashes the paths again.
Evidence and limits
I reviewed both changed files and the candidate-identity and dashboard-read paths. The new tests cover a repeated path, a bad selected-role digest even when a valid baseline already populated the cache, and a file mutation detected on the next load. Both Linux Ready checks, both installed-wheel checks, browser and required policy passed on this head. The previous Request changes was superseded by its reviewer's current-head approval after #673 was linked. I recomputed the six-pair dashboard medians (1.6405 to 1.0815 seconds); this is local record-read latency, not GLM-Image generation speed. I did not rerun the suite or perform integration.
Governing Issue and delivery slice
Refs #673. This PR delivers the per-read candidate identity optimization and its GLM-Image dashboard timing regression check. The requester scoped the InferRSI framework change separately from the native engine change. The governing issue names the accountable contributor and the cross-read freshness requirement.
Change
During the native GLM-Image campaign, opening the live dashboard verified a whole vLLM-Omni source snapshot twice. The selected artifact can be the frozen baseline, or it can also occur in the list of retained rounds. Share its computed identity within a single record read. Each recorded digest is compared independently and the next read verifies the files again.
Verification
Ran the project-optimization and live-dashboard suites, including a regression that selects a different winner and modifies that winner between reads. All 52 tests passed. The repeated-path case also changes just the selected digest while preserving the baseline bytes and digest, and checks that a single hash still raises the selected-role mismatch.
On the frozen GLM-Image campaign with 2,610 retained files and the baseline selected, six alternating pairs of warm, in-process
dashboard_snapshottimings gave medians of 1.641 s before and 1.081 s after (34.1% less time). Each process first read the snapshot once. This measures InferRSI's local dashboard read on this campaign. The model's end-to-end latency is evaluated separately in acceptance issue #668.The six warm pairs timed
dashboard_snapshotwithPYTHONPATHpointing first to the reader at62949701cb03d7ade1c9d6fe71fb7923191cb627or to that same code with the per-read change subsequently committed infe6d5db, alternating order on successive pairs. Both used the same 2,610-file campaign snapshot and Python environment. The campaign writer used PR #663 at5058434f0. The 34.1% figure measures local dashboard snapshot reads. The native image-generation comparison is reported on #668.