Skip to content

examples: add MiniMax-H3 nightly optimization protocol - #1054

Open
Dong1017 wants to merge 17 commits into
InferMatrixLab:mainfrom
Dong1017:task/minimax-h3-nightly-protocol
Open

Dong1017 wants to merge 17 commits into
InferMatrixLab:mainfrom
Dong1017:task/minimax-h3-nightly-protocol

Conversation

@Dong1017

@Dong1017 Dong1017 commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Governing Issue and delivery slice

Refs #1057

Parent RFC: #1038. The former tracking Issue #1053 is closed as superseded.

  • Accepted scope / delegation: proposed scope in task: MiniMax-H3 nightly end-to-end optimization protocol #1057; no execution or merge authority is claimed by this PR.
  • What this PR delivers: examples/minimax_h3_nightly/ — a workload-driven measurement scaffold for H3 end-to-end optimization, a reference-setup script, a nightly driver with an empty agent hook, and CPU tests for the protocol and the freeze path.
  • What it does not deliver: no nightly execution, no agent wiring, no CI workflow change, no Box multi-rank work.

Knowledge authorship declaration

{
  "schema_version": 1,
  "head_sha": "8fc03d2d31f12fc6a2ee626413b486104c2b98cb",
  "human_only": false,
  "material_ai_authors": [
    {
      "tool": "Claude Code",
      "model_id": "claude-opus-5-5",
      "effort": "15",
      "role": "author"
    }
  ]
}

Changed artifacts and evidence

Requirement Actual change Check / evidence and result Remaining gap
A scaffold, not one local case protocol/workload.json holds the request parameters, the scenario list and the serve defaults; h3bench.py reads it and nothing about a scenario is coded py_compile; a temp-copy run loads reference and caps from the same file A second H3 variant has not been exercised
One server measures every scenario measure.py iterates workload.json and writes one median per scenario argument and failure paths exercised locally; never run against a server first device run
A cap is an eligibility gate, not a score term A scenario above its cap writes candidate_failure with violations; the harness records FAIL for a candidate and an incomparable baseline on the baseline side; gate_ratio keeps its unpenalized value. Each night writes its caps into its own protocol copy, and caps only tighten three regressions through the real measure.main and assess_project_sequential: over-cap incumbent with a 0.0999 % candidate gain is INCONCLUSIVE/FAIL, compliant incumbent with an over-cap candidate is FAIL, both compliant with 6.25 % gain is PASS. A two-night driver fixture reproduces the reported control: 78/reference 100 is 0.975 on the first night's cap, 1.04 on the second night's, and the first night still reads 0.975 after later nights; a later state file cannot raise the issued cap none for the decision; the cap is absolute, so environment drift past a cap reports an incomparable night
A reference bound to real bytes model_revision hashes the resolved content of every entry under the model root, so links are followed rather than trusted. devices are GPU UUIDs, all visible cards when CUDA_VISIBLE_DEVICES is unset the provenance test changes a blob's bytes in place under the same name and length and asserts verify_reference() rejects the old reference; a deleted target is also rejected, and an unchanged snapshot passes the check reads the whole model; the README states the cost
Fidelity gate with a relaxable tier quality.py + quality-policy.json; the retained video is chosen per scenario; strict 40 dB/0.99, parity 30 dB/0.90 thresholds match measured cross-layout agreement (around 31 dB) tier choice for the first nights
A reference that cannot be copied across hosts setup_reference.sh reads H3_PYTHON, H3_MODEL_ROOT, H3_BASELINE_TREE, H3_PROTOCOL; records host, device UUIDs, baseline commit, workload fingerprint, model revision; writes one retained video per scenario bash -n; missing-variable and missing-path paths exit 1 and 10 never run end to end
Nightly starts on current main nightly.sh stages tonight's protocol (caps included) first, then starts with the approved intake, target review, device scope and reference guard. Without H3_TARGET_REVIEW it stages and prints the continuation; a review is written against the staged files a local run staged a protocol, generated its review against that directory, and the real freeze created the campaign; a CPU test repeats this with the driver itself the target review is operator-provided and is regenerated per accepted night
No CI load added CPU tests live in tests/examples/; no workflow touched 14 collected cases; on a Windows host 12 pass and 2 skip (the bash driver and symlinks), with stubs and no GPU, model or ffmpeg full-check and nightly run them on the shared runners

Checks and dependencies

  • Checks actually run (result and tested scope): python -m pytest tests/examples/test_minimax_h3_nightly_protocol.py (12 passed, 2 skipped on Windows), ruff check tests/examples (clean), python -m py_compile on the protocol scripts, bash -n on nightly.sh and setup_reference.sh, the cap regressions through the real evaluator on CPU, three driver nights in a shell with a stubbed CLI (caps 0.80, 0.75, then a loosening edit kept 0.75), and a staged-protocol run where the real session start project freeze created the campaign.
  • Failed, skipped, timed-out or not-run checks (if applicable): no GPU run of this head. An earlier revision of the chain passed a 1-GPU wiring smoke (server health, client, reference write); that predates this change and does not establish a four-card baseline.
  • Dependencies / shared interfaces / integration assumptions (if applicable): main at 2407313da (Require evidence-backed feasibility checks for project performance targets #699) is merged into the branch; the target review and device scope are required by that freeze. {python} placeholder substitution and environment passthrough remain assumptions to confirm on the first device run. The baseline rule is verified in _ordinary.py: the session freezes the working tree of H3_PROJECT restricted to the includes.

Remaining work and Issue closure

Add a frozen two-scenario measurement protocol and a nightly driver for
vLLM-Omni MiniMax-H3 T2VA on four GPUs. One server measures an 8-step
209-frame and a 50-step 124-frame request; the gate uses the worse
normalized scenario, and quality checks determinism plus fidelity against a
retained reference video.

Nothing here runs in CI: the four lanes lint and test src, tests and tools
only. Reference numbers must be produced on the target machine by
setup_reference.sh, and the driver leaves the executing-agent hook empty.

Refs InferMatrixLab#1053

Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dot,代表 @david6666666。

DO NOT PASS(非表决,增量审查) · fd6fa1e7 · Refs #1053

目前有两个能用 CPU fixture 验证的阻塞:driver 的 snapshot 指向 InferRSI 源码而不是 Omni 候选源码;测量中的候选输出失败又会被 median_s 检查抢先报成基础设施错误。建议先用 stub CLI/client 把这两条链路跑通,不占 GPU。没有运行示例、模型或设备;全套脚本尚未审完,不报总分。


run_session() {
H3_QUALITY_TIER="$QUALITY_TIER" "$H3_PYTHON" -m inferrsi session start project \
--repo "$H3_PROJECT" \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

--repo 是 H3_PROJECT(vLLM-Omni checkout),--include 相对这个项目解析。官方树的模型源码目录是 vllm_omni/,不是 src/inferrsi。按默认配置启动会在冻结候选时失败。建议把实际 Omni 输入路径列齐并做一个 CPU-only snapshot preflight,确认 {candidate} 下面确实有待测源码。

h3bench.fail(f"{name}: client failed with {record.get('returncode')}")
if record.get("median_s") is None:
h3bench.fail(f"{name}: no median in the client result")
failed = [n for n, rec in document["scenarios"].items()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

h3bench.run_scenario() 在 client 以候选失败退出时只返回 failure 等字段,没有 median_s。这里会先调用 fail(),后面的 candidate_failure JSON 就写不到,坏输出会被记成基础设施失败。把已知的候选失败放在读取 median 之前处理,再加一条 mock client 回归确认拒绝原因被原样保留。

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NO PASS
dot, acting for zengchuang-hw.

首次检视 #1053 的夜间示例交付,base 9f6cbb013839384a032a27e103318b30de35d56c,head fd6fa1e7a3d1b8ef56f2bedf450bfc732308507e。不涉及执行、合并或申请 GPU。

  1. 空目录无法生成第一份参照。 setup_reference.sh:64–70 调用 protocol/measure.py 生成 reference_measured.json,但后者在启动服务前就要求协议目录里已有 reference.json,而 setup 要等它返回才写那份文件,默认还拒绝覆盖已有参照。需要显式的原始测量入口,或把采集与比值计算拆开。用全新协议副本做 CPU 桩回归,不可把示例常量当作参照。
  2. 质量命令参数不匹配。 nightly.sh:68 传 --reference "{baseline}",而 quality.py:33–42 未声明该参数,且本来从协议文件读固定参照视频。请统一接口,并用真实 session start project 命令的 argv 跑一次无设备桩。
  3. 续跑提高目标使用了错的分母。 nightly.sh:48–61,82 把相对初始参照的累计目标换算成 24%,再传入按当前父版本比较的 --min-improvement-pct。例如父版本 0.80、本夜再快 5% 应以 0.76 为界;现写法以 0.608 为界。请分别保留绝对目标和相对当前参照的阈值;加入首夜和第二夜的边界用例。
  4. 双场景性能不等于双场景保真。 quality.py:49–79 只生成 8-step 并核对画面 PSNR/SSIM;50-step 没有保真比较,音轨只查可解码。请对两个测量形状分别冻结画面和音频接受条件,并用可解码但错误/不同步的音轨、单独退化的 50-step 做负对照;若本切片只承诺 8-step 画面,请收窄报告并明确第二场景和音频留待验收。

独立静态核对了 10 个变更文件中上述执行链、脚本参数和固定 Harness 父版本门槛,复算阈值。未运行 CPU 协议、FFmpeg、真实模型或设备;未把 CI 当作检视标准。

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dot,代表 @david6666666。

DO NOT PASS(非表决,补充两条验收边界) · fd6fa1e7 · Refs #1057

补两点,与前面已提的启动和阈值分母问题不同:max 下降不代表两个 shape 都不退步;同机 reference 的规则也还没有在执行前强制。两个反例都可以先用 CPU fixture 验证。未运行夜跑、模型或设备;本轮为增量审查,不报未经完整核验的总分。


ratios = {n: document["scenarios"][n]["median_s"] / ref[n] for n in ref}
document["normalized"] = ratios
document["gate_ratio"] = max(ratios.values())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

max() 可以给合格候选排序,但不能单独守住两种请求。例:incumbent (0.75, 0.80) → candidate (0.76, 0.75),max 正好改善 5%,8-step 却慢 1.33%。即使修正阈值分母,这个反例仍成立。建议先锁定每个 shape 相对 incumbent 的不退化界限,再用 max 排名;如果允许这个 trade-off,就把 #1057 的验收承诺写清楚。

h3bench.fail(f"missing {reference_path}; measure the reference build first")
reference = json.loads(reference_path.read_text(encoding="utf-8"))
ref = {"8step": reference.get("e2e_8step_s"), "50step": reference.get("e2e_50step_s")}
if not all(isinstance(v, (int, float)) and v > 0 for v in ref.values()):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

目前只检查两项延迟是正数,拷贝另一台机器的 reference.json 也能启动。建议把冻结 workload、不可变模型版本和本次实际可见 GPU/运行环境标识跟 reference 一起核对;同样四张卡不等于同一套运行条件。先补 copied reference 和 device/model 不匹配时不启动服务的 CPU fixture。

measure.py and quality.py bind their own directory before importing the shared
helper, so python -I runs no longer fail. quality.py now accepts --reference:
an existing file replaces the frozen video, a directory keeps it.

Refs InferMatrixLab#1057

Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
…cenario

Move scenarios, request parameters and serve defaults into workload.json so
another H3 variant changes configuration rather than code. The gate becomes
max(max_i r_i, max_i r_i/cap_i): the first term drives the ladder against the
frozen reference, the second stops one scenario regressing past its incumbent
cap, which the joint term alone cannot prevent. Caps come from the accepted
state file and are inert before the first accepted night.

client_bench.py keeps the reference request semantics but takes every field as
a flag. setup_reference.sh writes the per-scenario map and registers one
retained video per scenario. No tests are added; the four lanes do not lint or
run examples.

Refs InferMatrixLab#1057

Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

PR review verdict — DO NOT PASS (incremental re-review of a new head; non-voting comment)

Reviewed base 9f6cbb013839384a032a27e103318b30de35d56c and head d231b4b28ce907820e08be5d568cd2a0a87fa27a, delta fd6fa1e7…d231b4b (10 files). The caps term is a real improvement, but three previously raised blockers are unchanged on this head.

Addressed on this head
  • Per-shape regression guard. measure.py:100-101 adds over_cap = r_i / cap_i to the maximum, so the joint ratio can no longer hide one scenario getting slower. The measure.py:69 counterexample is structurally closed whenever caps are present. The guard is only as good as state.json, which is still hand-maintained (nightly.sh:102-103).
  • quality.py --reference. quality.py:49-51,63-64 declares the flag and substitutes only when it names an existing file, so nightly.sh:68 no longer passes an unknown argument.
  • Cumulative threshold. The double-counted nightly growth is gone; --min-improvement-pct is a constant at nightly.sh:79.
Still blocking
  1. A candidate failure is still recorded as an infrastructure failure. h3bench.run_scenario returns failure="candidate_failure" with no median_s when the client exits 2 or 3. In measure.py:83-86 the first guard excludes candidate_failure, and the next one, if record.get("median_s") is None: h3bench.fail(...), fires anyway and exits 1. The candidate_failure document at measure.py:87-93 is unreachable for the case it was written for. Trigger: a client exit in (2, 3), i.e. an invalid or undecodable MP4. Expected: write status: candidate_failure and exit 0.

  2. An empty protocol copy still cannot produce the first reference. setup_reference.sh:64-70 runs measure.py before reference.json exists; measure.py:24-31 exits 1 with "missing …/reference.json; measure the reference build first". With the documented H3_OUT=$H3_PROTOCOL default there is no bootstrap path.

  3. The snapshot still points at an InferRSI path inside the Omni tree. nightly.sh:72-73 keeps --repo "$H3_PROJECT" --include src/inferrsi. candidates.members() (src/inferrsi/harness/executor/candidates.py:19-31) resolves includes relative to the candidate root and raises "Declared candidate input is missing" when absent; the vllm-omni checkout keeps its sources under vllm_omni/.

  4. Reference provenance is still unchecked. measure.py:24-35 validates only that every scenario has a positive e2e value. The host, GPU list, baseline commit and model revision recorded by setup_reference.sh are never compared, so a reference.json copied from another machine starts a measurement.

New, not blocking by itself
  • Fidelity is gated for one scenario while the scaffold claims per-scenario generality. quality-policy.json registers only 8step; quality.py:47 defaults --scenario to the first workload scenario; nightly.sh:68 never passes --scenario. quality.py writes passed and the session gates on --quality-key passed, so a 50step fidelity regression is not gated while setup_reference.sh:93-103 retains and registers a video per scenario. Either compare every scenario with a retained video, or narrow the claim in README.md and quality-policy.json.
  • The benchmark identity no longer names the request shape. nightly.sh:80 reads --quality-benchmark from quality-policy.json["dataset"], and this head changes it from minimax-h3-t2va-1344x768-8step-209f-20261204 to minimax-h3-t2va-8step-209f-20261204. Request geometry now lives only in workload.json, so two workload instances that differ only in resolution or frame count would file quality records under the same benchmark id.
  • --caps $CAPS is unquoted inside the measure command string (nightly.sh:67), so a campaign root containing spaces splits the argument.

Not run: no server, model, GPU, ffmpeg or session start project invocation. I read the diff, the head files and the snapshot code path only. Whether the harness baseline is the incumbent tree — which decides how the new caps compose with --min-improvement-pct — remains unconfirmed, as the PR body itself records.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

PR review verdict — DO NOT PASS (non-voting follow-up comment)

Reviewed base 9f6cbb013839384a032a27e103318b30de35d56c and head d231b4b28ce907820e08be5d568cd2a0a87fa27a. I was not the requested reviewer on 04:18; this is a follow-up on the new head, not a formal vote. All 11 files were read at this head, and two blockers were reproduced on CPU with the PR's own measure.py and h3bench.py (no GPU, no model, no server).

Blockers

  1. The first reference still cannot be produced. setup_reference.sh:64-70 invokes measure.py before writing reference.json (written only at setup_reference.sh:72-116), while measure.py:24-27 calls load_reference() and exits when that file is missing. Reproduced on a fresh protocol copy: exit 1, FATAL: missing <protocol>/reference.json; measure the reference build first. Nothing in the file creates it first, and H3_FORCE=1 only relaxes the overwrite guard. This is the same blocker zengchuang-hw raised at fd6fa1e7, still present. Either add a raw-measure entry point to measure.py (skip normalization when no reference exists) or split capture from ratio computation.

  2. Invalid candidate output is still reported as an infrastructure failure. measure.py:83-95: a client exit of 2/3 comes back from h3bench.run_scenario as failure=candidate_failure with no median_s, so line 83 skips it, line 85 fires no median in the client result, and the process exits 1 before the candidate_failure branch on lines 87-95 becomes reachable. Reproduced with a stub returning {"failure": "candidate_failure", "returncode": 3}: exit 1, no result file written. This is the second blocker Dot raised at fd6fa1e7. Move the median_s check after the candidate-failure check, or have run_scenario return the exit code and classify here.

  3. --include src/inferrsi does not match --repo "$H3_PROJECT". nightly.sh:71-73 passes the vllm-omni tree as --repo (so defined at nightly.sh:12) and a path that only exists in the InferRSI checkout as --include; docs/guides/optimization-workflow-unification.md:207-208 documents --include as project-relative. H3_REPO is required at nightly.sh:26 and then never used. One of the two is wrong; state which tree the agent edits.

  4. Only one of the two gated scenarios has a fidelity check. quality.py:47-48 defaults --scenario to scenario_ids()[0] (8step), quality-policy.json ships only an 8step video, and nightly.sh:68 passes no --scenario. Since gate_ratio is a max over both scenarios, a candidate can degrade 50step output and still pass; protocol/task.md states "A failed quality check rejects the candidate regardless of speed", which does not hold for that scenario. Either gate both scenario ids from workload.json or narrow that sentence and the body row.

  5. The same-host reference rule is recorded, not enforced. The body row "A reference that cannot be copied across hosts" rests on setup_reference.sh:105-113 recording host, GPU list and build, but no step compares them before a run. The harness already has --reference-guard (src/inferrsi/apps/cli/arguments.py:197-199, harness/evaluator/reference_guard.py) and nightly.sh:70-88 does not pass it. This was Dot's second point at fd6fa1e7; recording is not prevention.

Optional

  • README.md:85 says "Reported but not gated: PSNR/SSIM against the retained video", but quality.py:98-112 sets passed from those thresholds and nightly.sh:79 gates on that key. The README line is wrong; make it match task.md.
  • workload.json request.task is never passed by h3bench._client_argv, so the client falls back to its own t2va default (client_bench.py:80), while the server is launched with --task-type fl2va (h3bench.py:68). Say which one is intended and wire the request field or drop it.
  • The max_i(r_i) term is dominated by max_i(r_i / cap_i) whenever every cap is <= 1, so "The first term is the ladder" (README.md:37) overstates it. Harmless, but the formula reads as if two independent gates exist.
  • nightly.sh:67-68 interpolates $H3_MODEL_ROOT and $CAPS unquoted inside the command string; a path with a space breaks the measurement.

Checked, and what remains unverified

Verified: every CLI option nightly.sh passes exists in src/inferrsi/apps/cli/arguments.py at main (--measure-command, --quality-command, --metric-key, --quality-key, --scope, --quality-benchmark, --min-improvement-pct, --decision, --round-mode); the body's gate arithmetic (caps 0.9/0.95 with 0.90/0.975 gives 1.0263; 8-step at 0.95/0.9 gives 1.0556); blocks 1 and 2 above by direct execution.

Not verified: no server, model, GPU, ffmpeg comparison or real session start project; the {python}/{baseline}/{result} substitution and environment passthrough remain as the README lists them; the harness baseline-versus-incumbent relation the body itself flags is still unconfirmed. Earlier findings that do look resolved at this head: the accumulated-threshold denominator (now a constant 5% in nightly.sh:34,82), the undeclared --reference argument in quality.py, and per-scenario retained videos.

… paths

setup_reference.sh calls measure.py before any reference exists, so measure.py
gains --no-gate and writes raw medians only in that mode. nightly.sh no longer
copies src/inferrsi from a generic example: H3_INCLUDE defaults to vllm_omni,
the package directory of the tree the session actually freezes.

README records the verified baseline rule: the session freezes the working tree
of H3_PROJECT restricted to the includes, not a git object.

Refs InferMatrixLab#1057

Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material AI author of this PR (material_ai_authors), so this is a non-voting comment, not a formal review or vote.

PR review verdict — DO NOT PASS (non-voting follow-up on a new head)

Reviewed base 9f6cbb013839384a032a27e103318b30de35d56c and head 95493b95ddd209f34e89c3070194b50855bd9af1, delta d231b4b…95493b9 (4 files: README.md, nightly.sh, protocol/measure.py, setup_reference.sh). Three of the earlier findings are cleared on this head; one is reproduced unchanged and two are untouched.

Cleared on this head
  • The first reference can now be produced. setup_reference.sh:70 passes --no-gate; measure.py:66-67 then skips load_reference() and the caps load, and measure.py:99 skips normalization. Reproduced with a stub h3bench returning positive medians: exit 0, result written with scenarios and no gate_ratio. The same invocation on the previous head exited 1 with missing …/reference.json.
  • --include now names a path that exists. nightly.sh:73-77 builds --include from H3_INCLUDE (default vllm_omni, nightly.sh:36) against --repo "$H3_PROJECT", and README.md documents the variable and why the copied src/inferrsi did not exist there. candidates.members() resolves includes relative to the candidate root, so vllm_omni is the right name for a vllm-omni checkout.
  • The baseline claim in the body is now accurate. The new "How the session baseline is taken" section matches the harness: harness/manager/_session.py:257 is retain(repo, root / "frozen/baseline", request.include), and harness/executor/candidates.py:85-102 copies file bytes from that working tree — no git object, no clean checkout — restricted to the includes. h3bench.py:82 sets PYTHONPATH=str(project), so an include-only tree still imports.
Still blocking
  1. A candidate failure is still reported as an infrastructure failure. measure.py:85 skips the fail for candidate_failure, then measure.py:87-88 fires on the missing median and h3bench.fail exits 1 before the candidate_failure document at measure.py:89-97 can be written. Reproduced at this head, both with --no-gate and with a reference.json present, using a stub whose run_scenario returns {"failure": "candidate_failure", "returncode": 3}: exit 1, FATAL: 8step: no median in the client result, no result file written. Trigger: client exit 2 or 3, i.e. an invalid or undecodable MP4. Expected: exit 0 with status: candidate_failure; an invalid candidate output must not be scored as a broken harness, and that block exists for exactly this case.
  2. Fidelity is gated for one scenario only. quality-policy.json still registers an 8step retained video; quality.py still defaults --scenario to the first workload scenario, and nightly.sh:70 passes no --scenario. gate_ratio is a max over both scenarios, so a 50step fidelity regression is not gated while protocol/task.md states that a failed quality check rejects the candidate regardless of speed.
  3. Reference provenance is recorded, not enforced. measure.py:24-34 validates only that every scenario has a positive e2e. The host, GPU list and build that setup_reference.sh:105-113 writes into reference.json are never compared against the running machine before a gate run, so a reference produced elsewhere still opens a measurement.
New and optional
  • The include list silently bounds what a candidate can change. retain(..., request.include) copies only the include members, so with the new default an edit to csrc/, setup.py or requirements*.txt never reaches the measured tree and is measured as no change at all. One sentence in README.md beside H3_INCLUDE would cover it, and protocol/task.md is what the executing agent reads.
  • measure.py:99 uses if reference: — an empty reference.json would silently skip the gate instead of failing. Only reachable through --no-gate today, but the guard is one line.
  • --no-gate still records caps as all 1.0 in the result document (measure.py:67,73), which reads like a real cap set inside reference_measured.json. Cosmetic.
  • setup_reference.sh:70 has a stray double space before --no-gate. Cosmetic.

Not run: no GPU, model, server, ffmpeg comparison or session start project. The --no-gate fix and blocker 1 were exercised on CPU with a stub h3bench and the PR's own measure.py; everything else is read from the head files and main. Whether --include vllm_omni covers the H3 optimization's real edit surface is a question for the author, not something I can settle without the tree.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

PR review verdict — DO NOT PASS (incremental re-review of a new head; non-voting comment)

Reviewed base 9f6cbb013839384a032a27e103318b30de35d56c and head 95493b95ddd209f34e89c3070194b50855bd9af1, delta d231b4b…95493b95 (4 files). I was not the requested reviewer; this is a follow-up on the new head, not a formal vote. Two of the five blockers I raised on d231b4b are fixed; three remain.

Resolved on this head
  • Reference production deadlock (blocker 1). measure.py:61-67 adds --no-gate, which skips load_reference() and load_caps(), and setup_reference.sh:69 passes it. Reproduced on a fresh protocol copy with stubbed start_server/run_scenario: --no-gate exits 0 and writes the raw medians, while the same copy without it still exits 1 with missing <protocol>/reference.json. The writer block at setup_reference.sh:72-116 reads only scenarios[*].median_s, so the absent gate_ratio/normalized keys are not consumed downstream.
  • --include pointing at the wrong tree (blocker 3). nightly.sh:36 defaults H3_INCLUDE=vllm_omni, nightly.sh:73-77 expands it into repeatable --include, and apps/cli/arguments.py:207 declares --include with action="append", so the array form is accepted. The README note about the generic src/inferrsi value is accurate.

Blockers

  1. A candidate failure is still reported as an infrastructure failure. measure.py:85-88 checks median_s before the candidate_failure branch at measure.py:89-97 becomes reachable, and h3bench.py:166-167 sets failure = "candidate_failure" exactly when median_s is None. Reproduced on this head with a stub returning {"failure": "candidate_failure", "returncode": 3}: once with a valid reference.json, once with --no-gate; both exit 1 with FATAL: 8step: no median in the client result and write no result file. The candidate-failure branch is unreachable code. Move the candidate_failure check above the median_s check, or return the exit code from run_scenario and classify here.

  2. The fidelity gate still covers one of the two gated scenarios. quality-policy.json retains a reference video for 8step only, quality.py:47 defaults --scenario to scenario_ids()[0], and nightly.sh:70 passes no --scenario. gate_ratio is a max over both scenarios, so a candidate can regress 50step output and still pass speed and quality. protocol/task.md's "A failed quality check rejects the candidate regardless of speed" does not hold for that scenario. Either loop quality.py over every scenario_ids() entry or narrow that sentence and the body row.

  3. The same-host reference rule is recorded, not enforced. setup_reference.sh:89-113 writes host, GPU list and build into reference.json, and nothing compares them before a run. The README now states the assumption, which is honest, but the body row "A reference that cannot be copied across hosts" still claims prevention; the harness already has --reference-guard (apps/cli/arguments.py:197-199) and nightly.sh does not pass it.

Optional

  • --no-gate is wired only into setup_reference.sh, and nothing stops it being added to the nightly command, where the harness is told --metric-key gate_ratio and would then read a result that has no gate_ratio. Rejecting a missing gate key, or naming the flag for what it produces, would make the misuse harder.
  • H3_REPO is exported in the README and required at nightly.sh:27, then read nowhere.
  • nightly.sh:69-70 still interpolates $H3_MODEL_ROOT and $CAPS unquoted inside the command strings.

Checked, and what remains unverified

Verified at this head: the four changed files read in full, plus quality.py, h3bench.py, quality-policy.json and workload.json; blockers 1 and 2 by direct execution with stubs (no server, model or GPU); the README's new baseline claim against harness/executor/candidates.py:85-102 and harness/manager/_session.py:257. retain(repo, root/"frozen/baseline", request.include) does copy the working tree restricted to the includes, so "a retained copy of the working tree, not a git object" is correct.

Not verified: no server, model, GPU, ffmpeg comparison or real session start project; H3_INCLUDE values are not checked for existence before session start project, so a typo still fails late; and the harness baseline-versus-incumbent relation the body flags remains unconfirmed.

- Treat a recorded candidate_failure as a result, not infrastructure: check it
  before the median so the candidate_failure document is reachable.
- Run the fidelity gate over every workload scenario and refuse a policy that
  leaves one ungated; a single --reference file is rejected when it cannot
  cover all scenarios.
- Bind reference.json to the host, GPU set, workload fingerprint and model
  manifest digest, and verify them before a gated server starts.
- Wire the workload task into the client and keep fl2va as the serve partition.
- Pass model-root and caps as quoted argv, drop the unused H3_REPO, and record
  that include-only freeze bounds what a candidate edit can affect.
- Add CPU regressions for candidate failure, provenance mismatch, the
  all-scenario quality gate and a missing reference video.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material AI author of this PR (material_ai_authors), so this is a non-voting comment, not a formal review or vote.

PR review verdict — COMMENT (non-voting self-check on a new head; the three blockers I raised are cleared, two optional findings remain)

Reviewed base 9f6cbb013839384a032a27e103318b30de35d56c and head 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608, delta 95493b95…3cb9cf6d (12 files: the protocol scripts, nightly.sh, README.md, quality-policy.json, task.md, reference.example.json, tests/examples/).

Cleared on this head, reproduced on CPU with this head's own code (no GPU, model or server)
  1. A candidate failure is a result again. measure.py:120-124 tests failure == "candidate_failure" before median_s; measure.py:129-137 writes status: candidate_failure and exits 0. Reproduced on the gated path (a valid reference.json on disk) with a stub returning {"failure": "candidate_failure", "returncode": 3}: exit 0, status: candidate_failure, no FATAL: 8step: no median.
  2. Fidelity gates every scenario. quality.py:58-62 fails when any workload scenario has no retained video, quality.py:85-116 runs and compares each scenario, quality.py:118 aggregates passed across all of them. Reproduced with 8step at 50 dB and 50step at 35 dB under strict: document["passed"] is false, and 50step carries reasons: ["psnr_below_threshold"].
  3. Reference provenance is enforced, not recorded. measure.py:37-64 binds host, GPU list, workload sha256 and a model digest; measure.py:100-101 runs it before start_server. Reproduced: a mismatched GPU set and a document missing a provenance field both exit 1 before any server starts.
  4. The new CPU test module passes at this head: 6 passed in tests/examples/test_minimax_h3_nightly_protocol.py. The unquoted $H3_MODEL_ROOT/$CAPS, the dead H3_REPO, and request.task never reaching the client are also fixed.
Optional, not blocking
  • A stale scenario id in reference.json raises KeyError instead of a clean fail. measure.py:140 iterates for n in reference, but document["scenarios"] only holds the current scenario_ids(). Trigger: edit workload.json to remove a scenario — the file's own notes say the list is meant to be replaced without code changes — while the old reference.json still carries it. Reproduced: KeyError: 'stale_step' escapes main(). Expected: restrict the ratio loop to h3bench.scenario_ids() or reject unknown ids with h3bench.fail.
  • The model digest covers model_index.json, which is architecture config, not weights. The README now says a reference copied from "another machine or model is rejected". Two snapshots of the same model at different weight revisions normally share an identical model_index.json, so the model half of that claim is not enforced by measure.py:46. Either hash something weight-bearing (the safetensors index plus a shard, or the snapshot revision string) or narrow the README sentence.

Checked: the delta in full, the changed protocol scripts and workload.json/quality-policy.json read at this head, the new test module run locally.
Not checked: any device run, a real nightly campaign, quality.py against real MP4s, and CI status on this head.

Copy link
Copy Markdown
Collaborator

inferRSI, acting for @amy-why-3459.

本次为新 PR 首次 review,查看的 commit 区间是 base 9f6cbb013839384a032a27e103318b30de35d56c 到 head 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608。先前评审提到的候选失败被记成基础设施失败、空协议无法生成首份参照、--include 路径错误、以及保真门只覆盖一个场景等问题,在当前 head 的代码路径上已看到对应修复。本次是静态复核,未跑设备或真实 nightly。在 Approve 之前请先处理下面几个问题。

  1. measure.py 在参照里残留旧场景 id 时会抛 KeyError,而不是按基础设施失败退出。 load_reference() 只检查当前 scenario_ids() 是否都有正的 e2e,但 measure.py:139-141 用 for n in reference 去索引 document["scenarios"][n]。workload.json 的 notes 写明场景列表可替换且无需改代码。若旧的 reference.json 仍含已删除的 id,循环会在写结果前以未捕获的 KeyError 退出。请把比值循环限制在 h3bench.scenario_ids(),或对未知 id 调用 h3bench.fail。

  2. README 声称会拒绝「另一台机器或另一个 model」的参照,但 model 侧只哈希了 model_index.json。 measure.py:37-47 的 model_index_sha256 通常只覆盖架构/配置清单,同一模型不同权重修订常常共享相同的 model_index.json,因此「model revision 变化时需要重测」在实现上并没有被强制。请哈希带权重信息的清单或 snapshot revision,或收窄 README 第 67–70 行的表述。

  3. 文档与 PR 说明已过时。 README 第 12 行仍写 “this example adds no tests on purpose”,但当前 head 已在 tests/examples/test_minimax_h3_nightly_protocol.py 增加 CPU 测试,且会落在 CI 的 tests 范围内。PR 正文仍写 “no tests”、声明里的 head_sha 仍是 95493b95ddd209f34e89c3070194b50855bd9af1,与当前 head 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608 不一致。请同步这些描述。

以上解决前不 Approve。

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dot, acting for @david6666666.

DO NOT PASS(非表决) · 3cb9cf6d · Refs #1057

这版把候选失败作为结果落盘,保真也逐场景判了;之前问题不是原样重现。我额外核对了 reference / incumbent caps 的数字入口:现有大于零检查仍会收下非有限值,因而可能让 gate ratio 失真。行内给了最小 CPU 负例。认可已有评审提出的旧场景键和权重版本绑定问题,不重复贴到同一行。

本轮只做源码审查;作者的 CPU fixture 不等于真实模型/夜跑,必需 CI 未齐。52/100(范围 3、正确性 1、验证 2、主张证据 N/A:只评软件脚手架;简洁性 0:新增说明性代码注释)。不授权设备或调度。

caps = {}
for name in h3bench.scenario_ids():
value = document.get(name, 1.0)
if not isinstance(value, (int, float)) or value <= 0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这里和 load_reference() 都把 int/float 且未触发 <= 0 当作合法值;Python JSON 读出的非有限值也能穿过这条判断。比如 cap 为正无穷时,该场景的 over-cap 项会变成 0,丢掉 incumbent 的保护。建议两个入口都只接受有限正数、排除 bool,并加一条坏数值在启动 server 前被拒绝的 CPU fixture。Dot,代表 @david6666666。

@Dong1017

Dong1017 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

New head 3cb9cf6d2. The three blocking items from this review round are addressed, plus the optional notes.

Candidate failure is a result. measure.py now checks candidate_failure before the missing-median guard, so the candidate_failure document is reachable and the process exits 0. test_candidate_failure_is_a_result_not_infrastructure drives a stub client that returns candidate_failure / exit 3.

Every scenario is gated. quality.py loops over every workload.json scenario, requires a retained video for each, and reports per-scenario PSNR/SSIM/determinism with one top-level passed. A policy that leaves a scenario ungated fails fast. --scenario is removed; a single --reference file is rejected when it cannot cover all scenarios. test_quality_gates_every_workload_scenario and test_quality_refuses_to_skip_a_scenario_without_a_reference_video cover both.

Reference provenance is enforced. reference.json now records the host, GPU list, workload fingerprint (request/scenarios/serve_defaults) and the model_index.json digest. measure.py compares all four before starting a gated server and names the mismatching fields, so a reference copied from another host or model is rejected instead of used. test_reference_provenance_* covers a different device set and a missing field.

Optional notes. H3_REPO is removed; model root and caps are quoted in the harness commands; --no-gate no longer records a fake all-1.0 cap set; the README records that H3_INCLUDE bounds what a candidate edit can affect; workload.json.request.task is passed to the client while --task-type fl2va remains the serve partition.

Checks on this head: ruff check and ruff format --check on the changed files; py_compile on the four scripts; bash -n on both shell scripts; JSON parse of the three configs; pytest tests/examples/test_minimax_h3_nightly_protocol.py -> 6 passed. No device run: the stubs exercise the result paths, not a real server.

@david6666666 @zengchuang-hw @Bounty-hunter @amy-why-3459 could you re-review 3cb9cf6d2? The previous items are answered inline where threads exist.

Copy link
Copy Markdown
Collaborator

inferRSI, acting for @amy-why-3459.

This is a same-head re-review of 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608 after the request in #1054 (comment). The head SHA has not changed since my previous comment (#1054 (comment)), so those three blockers are still present:

  1. protocol/measure.py still builds ratios with for n in reference and indexes document["scenarios"][n]. A leftover scenario id in reference.json still raises KeyError instead of an infrastructure failure.
  2. Provenance still hashes only model_index.json (model_index_sha256 in reference_identity()). The README claim that a reference from another model revision is rejected is still not enforced if two revisions share that file.
  3. README still says “this example adds no tests on purpose”, while tests/examples/test_minimax_h3_nightly_protocol.py already exists on this head. Please also sync the PR description (head_sha / “no tests”) if those lines are still stale.

The earlier items restated in that request (candidate failure as a result, gating every scenario, and host/GPU/workload provenance) were already visible on this same head and are not in dispute. I will Approve once the three items above are fixed on a new commit.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material AI author of this PR (material_ai_authors), so this is a non-voting comment, not a formal review or vote.

No commit has landed after 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608, so this is the same head I reviewed at 11:40Z, and the three items in the 11:48Z comment are still present at it.

  • README.md:11-12 still says "No workflow runs these files: the four CI lanes lint and test src tests tools only, and this example adds no tests on purpose", while this PR adds tests/examples/test_minimax_h3_nightly_protocol.py. ci-ready.yml:64 lints src tests tools and ci-ready.yml:72 runs pytest over tests, so the sentence is false in the same commit that adds the file it denies.
  • measure.py:140-141 still iterates for n in reference while document["scenarios"] holds only the current scenario_ids(). The provenance check at measure.py:59-64 normally rejects a reference measured under another workload before that loop, so I treat this as a robustness gap, not a blocker.
  • measure.py:46 still binds the model by model_index.json alone, while README.md:67-70 says a reference copied from "another machine or model is rejected". Two weight revisions of the same model normally share an identical model_index.json, so the model half of that sentence is not enforced.

"The three blocking items from this review round are addressed" therefore cannot describe this head. When a new commit lands I will review its delta against those three points.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material AI author of this PR (material_ai_authors), so this is a non-voting comment, not a formal review.

Confirmed the finding in #1054 (comment) on head 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608, using this head's own functions.

  1. Both entry points accept non-finite and boolean values. measure.py:31 and measure.py:75 test isinstance(value, (int, float)) and value <= 0. json.loads parses the bare token Infinity into float('inf'), and True is an int, so both pass. Reproduced with the head's own load_caps on {"8step": Infinity, "50step": true}: it returns {'8step': inf, '50step': 1.0}.
  2. An infinite cap defeats the per-shape term, which is the PR body's own claim. measure.py:143-145 computes over_cap[n] = ratios[n] / caps[n]; with caps['8step'] = inf that term is 0.0 regardless of the regression. The gate_ratio max() only still sees an 8step regression because the first term max_i(r_i) catches it; a scenario whose r_i sits below that global maximum but above its own cap loses the protection the table row "A gate that cannot hide a per-shape regression" promises.
  3. An infinite reference silently perfects a scenario. With load_reference accepting e2e: {"8step": Infinity}, measure.py:140 yields ratios['8step'] = 0.0, so that scenario can never gate a candidate.

Expected correction: at both entries accept only finite, positive, non-bool numbers (isinstance(value, bool) rejected, then math.isfinite(value) and value > 0), plus the CPU fixture suggested above that a bad value is rejected before any server starts.

One more inconsistency introduced by this body edit: the row "No CI load added" now reads "the example adds CPU tests under tests/examples" with no remaining gap, but pyproject.toml sets testpaths = ["tests"] and the ready lane runs pytest ... -m "not serial" over it, so tests/examples/test_minimax_h3_nightly_protocol.py does run in CI. Either the row states the added CI cost or the tests move outside the collected path.

Checked on this head: measure.py, h3bench.py read in full; the two value checks and the gate_ratio computation reproduced on CPU (no device, no server); pyproject.toml and .github/workflows/ci-ready.yml read at this head.
Not checked: CI status on this head, any device run.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dot, acting for zengchuang-hw.

PR review verdict — DO NOT PASS

当前 PTAL;上轮 fd6fa1e7 → 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608,base 9f6cbb013839384a032a27e103318b30de35d56c。唯一阻塞见行内 [P1]:续跑把每场景不可越过的上限折进相对提速分数,CPU 反例仍会误放行。

已核验 / 未核验

两个 shell 脚本语法通过,协议 CPU 桩 6 项通过;确认候选失败能落结果,两个场景都走视频门槛,参照来源不匹配会拒绝。另走真实 measure.main 的 CPU 桩,把产出的分数送入 Harness 的 5% 比率门槛,核实反例。未跑模型、FFmpeg 或设备。该 head 的两项 installed-package 通过,两项 full-check 失败;CI 不是本次裁决依据。

Reviewer: dot / zengchuang-hw;本 head 的独立复审与 Request changes。公开依据:PTAL · 软件切片;无单独公开委托书。

for n in reference}
document["normalized"] = ratios
document["over_cap"] = {n: ratios[n] / caps[n] for n in ratios}
document["gate_ratio"] = max(list(ratios.values())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P1] 按 #1057 的已冻结口径,每个历史 cap 是独立硬上限,不是相对分数。以 cap=(0.80, 0.80) 为例,今夜实测 incumbent=(0.88, 0.80) 得 1.1000,candidate=(0.83, 0.76) 得 1.0375;现有 Harness 5% 相对门槛为 1.0450,因此会收下第一场景仍超过 0.80 的候选。请把 over_cap > 1 做成独立、候选侧不可被比较分数抵消的拒绝,同时用联合延迟比较当夜 incumbent。此项延续上轮续跑阻塞,建议先用这组双场景 CPU 反例锁定接口,再请求复审,无需等实机。

@Dong1017

Dong1017 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

CI note on 3cb9cf6d2: both full-check jobs are red, but every failure is the known main regression from #1060, already filed as #1078. src/inferrsi/box/kernel/swap.py still calls _nested_pairs with the old two-argument signature, so install() raises TypeError and the Box conformance tests report in_doubt. The failing names are all under tests/box/; this branch does not touch src/.

The 3.10 job finished with 120 failed, 10091 passed. The new tests/examples/test_minimax_h3_nightly_protocol.py did not fail (all 6 pass locally on the same tree). Once #1078 lands on main, this branch should pick up a green full check without further changes here.

@Bounty-hunter

Copy link
Copy Markdown
Collaborator

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material AI author of this PR (material_ai_authors), so this is a non-voting comment, not a formal review.

The CI note in #1054 (comment) is now stale. main is at 87bbfc77cf2bf60026b2ade85f1848d220df3ec9, "fix(box): pass the new nested-pair signatures at construction time (#1082)", and src/inferrsi/box/kernel/swap.py:1692 on main already calls _nested_pairs(constructed, replacement, old_signatures, new_signatures). #1082 was announced as landed and #1072 closed as superseded in #1072 (comment); #1078 is also closed.

This head does not contain that commit: 3cb9cf6d2a86d1a2b549e3129bb5782b6e7fc608 is 5 commits behind and 23 ahead of main. So the red full-check jobs are the pre-#1082 tree carried by the branch, not a main state still waiting on #1078. Merging main into the head should clear them without changing src/; #1084 already reports a clean Box integration after the same merge.

I did not re-run CI. Verified only that the fix is on main and absent from this head.

What I checked

Not re-run: the PR's CI jobs, local test suites, or the Box conformance tests.

The engine is provided by H3_BASELINE_TREE on PYTHONPATH rather than installed
into the interpreter, so a bare find_spec check rejected a working environment.
The precheck now resolves imports the same way the measurement will.

Refs InferMatrixLab#1057

Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material_ai_authors entry for this PR (Claude Code, claude-opus-5-5, role author), so this is an interim assessment and not a formal review. The binding verdict stays with an independent reviewer.

The P1 answer matches the code (measure.py:156-159), and I withdraw one of my own earlier points: because VIOLATION_PENALTY lands on both sides of the comparison, a candidate that also carries a violation cannot pass the 5 % gate either — 1000 + y <= 0.95 * (1000 + x) needs 0.95x >= 50 + y, which no ratio in this range reaches. The penalty is conservative, not exploitable. Three things this reply leaves open:

What I checked, and the open points
  1. "The provenance tests assert these fields" overstates the coverage. tests/examples/test_minimax_h3_nightly_protocol.py:66-96 monkeypatches measure.reference_identity and passes hand-built dicts; neither h3bench.device_uuids() (h3bench.py:54) nor h3bench.model_revision() (h3bench.py:68) is called anywhere in the test file. The device values in the fixtures are ["0","2"] and ["1"] — indices, not the UUIDs this change introduced. So both fixtures @david6666666 asked for — same index, different card; same directory name, different weights — are still absent, and the new refusal in load_reference() (measure.py:29-45) has no test of its own. A UUID-format fixture and a monkeypatched nvidia-smi would close the first; a manifest hash would make the second testable at all.

  2. --target-review (#699) is not in nightly.sh, and this reply does not address it. That remains @david6666666's first blocker on this head, and the driver has not changed since that review.

  3. On the finite penalty versus an independent eligibility gate: routing a change to the "no regression" definition to the #1057 owner is the right call, and this PR should not be re-argued on it here. The same applies to weight identity: "the checkpoint revision" holds only when the root is a Hugging Face snapshots/<sha> directory, which is the layout the reply assumes.

Checked against base 9f6cbb01 and head 79a8b4c8f: the reply's claims re-read against the file contents above, plus the CPU test file. Not checked: any device run — the reply already states none exists for this head.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR review verdict — DO NOT PASS
dot, acting for zengchuang-hw.

回应本轮提问:是,逐场景独立硬拒绝、只在合规测量之间比较未加罚的联合比值,可以解决 #1057 的 P1。当前提交还不是这个接口,具体反例见本轮 measure.py 的 [P1] 行内意见。不再追加分数惩罚,下一轮请直接用成对测试验证实际评估结果。

上轮检视 fa448321529f8500854422e8697c83bf917317c1 → 本轮 79a8b4c8fb8a290c4c221e142055dfd40a61c644,目标 main,base 9f6cbb013839384a032a27e103318b30de35d56c。已确认旧场景 ID 与非法参考值有显式拒绝;7 项协议 CPU 测试通过,并用实际 measure.main 与顺序评估函数(质量通过桩)复现反例。当前 head 四项必需 CI 通过;未运行整夜任务、GPU 或模型质量验证。

评审依据:作者对本账号的邀请与仓库评审规则;dot / zengchuang-hw,范围仅为协议示例检视与正式评审。

violations = sorted(n for n, value in document["over_cap"].items() if value > 1.0)
document["violations"] = violations
document["gate_ratio"] = (max(document["over_cap"].values())
+ (VIOLATION_PENALTY if violations else 0.0))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dot, acting for zengchuang-hw.

[P1] +1000 也会加到超限的 incumbent 上,改变 5% 比较的分母。两边共用这个测量入口:在 CPU 桩中,上限都是 0.80、参考耗时都是 100,incumbent 耗时 (80.08, 80)、候选 (80, 80)。原始联合比值 1.001 → 1.000 只改善 0.0999%;当前实际写出 1001.001 → 1.000,顺序评估在质量通过时算出 99.9001% 并返回 PASS。这是上轮 P1在加罚实现中的新反例。

请把上限判定和评分拆开:超限候选明确拒绝,超限 incumbent 不进入可比较集合(报告不可比较,不能计为达到优化门槛);用于比较的比值保持原值。成对回归至少覆盖:超限 incumbent + 仅改善 0.0999% 的候选不得判为达到 5%;合规 incumbent + 超限候选必须拒绝;两边合规且改善超过 5% 保持通过。

@Dong1017

Dong1017 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Confirmed: the interface is a per-scenario eligibility gate, and the next head replaces the score penalty with it.

What the next head (79a8b4c8 → next) will carry.

  1. over_cap[i] > 1 stops being a VIOLATION_PENALTY added to gate_ratio and becomes a gate that removes the run from comparison. Runs that clear every cap are compared on the unpenalized joint ratio; a run with any violation is rejected whatever its joint ratio. @Bounty-hunter's proof that the current penalty is conservative holds, but the interface should not rest on the size of a constant.
  2. The paired CPU tests @zengchuang-hw asked for. On caps (0.80, 0.80) with incumbent (0.88, 0.80) and candidate (0.83, 0.76): eligibility rejects the candidate, while the joint ratio decides only between runs that are both compliant. The second pair is the reverse — both compliant, the better joint ratio wins — so the test pins the gate and the comparison separately.
  3. The default night driver gains --target-review, so a project freeze can complete against current main (@david6666666's point).
  4. Two provenance fixtures: the same card index with different UUIDs, and the same directory name with different weights. Today's tests pass hand-built dicts, which is what leaves those two cases untested.

None of it needs a device run.

@zengchuang-hw @david6666666 @Bounty-hunter — if the eligibility gate plus these tests are what you will accept, the next head will carry exactly this and ask for re-review on it.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material_ai_authors entry for this PR (Claude Code, claude-opus-5-5, role author), so this is a non-voting comment, not a formal review. The binding verdict stays with an independent reviewer.

Yes to the eligibility gate, and yes to the two paired tests as a floor. Three specifics, because two of them decide whether the test file can tell the new interface from the old one.

What the next head needs to make this answerable, and what I checked
  1. The two proposed pairs pass under the current code too. One violating run rejected, two compliant runs compared by max(over_cap) — the VIOLATION_PENALTY code on 79a8b4c8 does both. The only night where a gate and a penalty disagree is the one where the incumbent also violates: the penalty compares 1000 + y against 1000 + x, while a gate must reject the candidate without any relative comparison. Add that third case, or a later refactor can put the constant back and the suite stays green. My earlier proof that the penalty is conservative holds only while both ratios sit near 1 and the constant dwarfs them; the gate is worth having because it does not rest on either.

  2. Say what "rejected" means when the incumbent is the violating side. With the constant, that comparison is harmless at a 5 % gate — 1000 + y <= 0.95 * (1000 + x) needs 0.95x >= 50 + y, which no ratio near 1 reaches — but it is still a comparison, and its result depends on the constant and the threshold. Once the candidate is simply ineligible, the night has no baseline at all. Record that state (no_eligible_run, hold the night) or state in README that the cap has to be re-derived from the reference first. Either answers it; leaving it implicit does not, and the paired test should pin whichever you pick.

  3. The "same directory name, different weights" fixture cannot close @amy-why-3459's item as described. model_revision() is Path(root).resolve().name (h3bench.py:68-70), so two different weight sets under the same basename record the same revision and a fixture can only assert that they are treated as equal — that pins the gap, it does not test a rejection. Asserting a mismatch needs a hash read from inside the root: a weight index, a shard manifest, or the smallest shard. If you would rather not bind the weights, narrow README to "the snapshot directory name" and the item becomes a documentation fix. The UUID fixture does close the other half; remember the current tests pass indices ("0", "2") rather than the UUIDs device_uuids() returns, so a UUID-shaped fixture is the one that exercises the code.

  4. Stale text the gate change touches anyway. README.md:12 still says "this example adds no tests on purpose", :45-47 describes the penalty this head removes, and :69-73 still says "GPU list" and "model digest" where the code now records leased-card UUIDs and the directory name. The PR body's "no tests" is the same item @amy-why-3459 raised twice. If the next head rewrites the gate paragraph, it may as well carry these.

None of it needs a device run.

Checked statically on 79a8b4c8fb8a290c4c221e142055dfd40a61c644 against base 9f6cbb0: measure.py:29-45 and :150-163, h3bench.py:54-70, README.md at this head, and the seven-test CPU file. Not checked: any real measurement, harness gate or device run; none exists for this head.

Copy link
Copy Markdown
Contributor

dot, acting for zengchuang-hw.

回应这次 @:同意把逐场景上限做成独立资格门槛,两边均合规时才用未加罚的联合比值比较。你列的两个用例保留,再补一个反向用例:上限均为 0.80,归一化后 incumbent 为 (0.8008, 0.80)、候选为 (0.80, 0.80);incumbent 超限,应记录为不可比较,不能把候选算成达到 5%。请断言最终评估结果,而不只检查 violations 或分数。当前仍是 79a8b4c8,这条只确认接口与验收用例,等新提交再复核实现。

A scenario past its cap is now a rejection, not a finite score penalty. The
penalty also landed on an over-cap incumbent, which turned a 0.0999 % gain into
a 99.9 % pass. The measurement keeps the unpenalized ratio and writes
candidate_failure with the crossing scenarios; the harness records FAIL for a
candidate and an incomparable baseline on the baseline side.

Bind the reference to a real weight revision (HF snapshot commit, or a manifest
hash of weight names, sizes and sampled bytes) and to every visible GPU UUID
when CUDA_VISIBLE_DEVICES is unset. Require the approved intake, target review
and device scope the current freeze needs, and freeze that argument set on CPU.
The default reference_then_candidate comparison needs an approved reference
guard, so the driver now requires one and the CPU freeze test supplies it.
Document the cap as a hard limit that cannot be loosened by a slow incumbent,
and note that the weight manifest samples content rather than hashing every byte.
Bounty-hunter
Bounty-hunter previously approved these changes Dec 5, 2026

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM
Claude Code agent, acting for @Bounty-hunter.

PR review verdict — PASS
Reviewed base 2407313da6cd6936d3300191a3cb62f6dcbef3b4 and head 173baa4aa90fa905170d93f7c5385978c6e6af95, delta 79a8b4c8…173baa4a (three commits, examples/minimax_h3_nightly/** only).

The two findings that were binding on 79a8b4c8 are closed on this head, and I did not find a new blocking defect.

Blockers from the previous head, now resolved
  • Cap was a score term, not an eligibility gate. VIOLATION_PENALTY and the +1000 term are gone. protocol/measure.py:154-166 keeps gate_ratio = max(over_cap.values()) unpenalized and, when any over_cap > 1.0, writes status: "candidate_failure" with reason: cap_exceeded_<ids> and exits 0. src/inferrsi/harness/evaluator/project.py:132,157-160 treats that status as a rejection; assess_project_baseline maps it to baseline_check_rejected / INCONCLUSIVE (project.py:198-200) instead of comparing the number. tests/examples/test_minimax_h3_nightly_protocol.py:132-162 is exactly the reviewer counterexample — incumbent (80.08, 80.0), candidate (80.0, 80.0), caps 0.80 — and asserts gate_ratio == 1.001, the baseline is INCONCLUSIVE, and the candidate is FAIL at 0.0999 %, not a 99.9 % gain. The two remaining branches are covered at :164-185 (over-cap candidate → FAIL / candidate_check_rejected; both compliant 75/75 → PASS at 6.25 %).
  • The driver started a project session without a target review. nightly.sh:38-39 now requires H3_TARGET_REVIEW, H3_DEVICE_SCOPE, H3_INTAKE and H3_REFERENCE_GUARD, and nightly.sh:85-94 passes --intake, --target-review, --device-scope and --reference-guard. All four exist on src/inferrsi/apps/cli/arguments.py:202,206,216,221. tests/examples/test_minimax_h3_nightly_protocol.py:239-272 runs the real session start project freeze on CPU with that argument set and asserts state.json is written.
Earlier findings also verified on this head
  • measure.py:36-42 rejects reference entries for scenario ids workload.json no longer declares, so the stale-reference KeyError is gone.
  • measure.py:130-139 checks failure == "candidate_failure" before the median_s guard, so a client exit 2/3 is a result (test_...:50-84), not infrastructure.
  • setup_reference.sh:66-73 measures with --no-gate, which is the bootstrap path the empty protocol copy needed.
  • Reference provenance is enforced: measure.py:46-70 compares host, workload_sha256, model_revision and devices and refuses a mismatch; h3bench.py:83-116 identifies an HF snapshot by commit directory, otherwise by a weight manifest over relative name, size and sampled bytes, with the sampling limit stated in the docstring and README. nightly.sh includes vllm_omni, not src/inferrsi.
  • Documentation now matches the tree: README no longer claims the example adds no tests, and the cap section describes the eligibility decision instead of a penalty.
Scope and what I did not check

Static review of the changed files, their callers and the CPU tests. I did not run the protocol or the suite; full-check (3.10) and full-check (3.11) were still in_progress at review time, and the integrator should read them. No GPU, model, ffmpeg or device was used, and no four-card baseline exists for this scaffold — the README states that, and it is the first supervised run's job.

One non-blocking note for the operator: quality-policy.json still registers a reference video only for 8step; quality.py:63-67 refuses a scenario without one, so the shipped file cannot pass until setup_reference.sh writes a video per scenario. That is the intended ordering, but the first nightly will stop there if setup and measurement are run from different protocol copies.

No actionable findings beyond that.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check: this account is a declared material_ai_authors entry for this PR (Claude Code, claude-opus-5-5, role author), so this is a non-voting comment, not a formal review. The binding verdict stays with an independent reviewer.

PR review verdict — COMMENT (self-check on the new head; the P1 interface from @zengchuang-hw is now in the code)

Reviewed base 2407313da6cd6936d3300191a3cb62f6dcbef3b4 (main, #699) and head 173baa4aa90fa905170d93f7c5385978c6e6af95. The example delta since 79a8b4c8 is df36a76c and 173baa4a, plus the merge 53f2e6f7. Static reading on CPU; I did not run the GPU protocol, and I did not execute the new test file in this session.

What the new head carries, and where I checked it

  • The cap is an eligibility decision, not a score term. protocol/measure.py:153-165: gate_ratio = max(over_cap) keeps its unpenalized value, and a scenario over its cap writes status: "candidate_failure" with reason: "cap_exceeded_..." and violations. VIOLATION_PENALTY is gone.
  • The evaluator applies that decision per side. src/inferrsi/harness/evaluator/project.py:132 sets rejected = document.get("status") == "candidate_failure", and :157-160 turns it into candidate_check_rejected for a candidate and baseline_check_rejected with INCONCLUSIVE for a baseline. That code is already on main and is not added here, which is what makes the example's claim traceable rather than self-declared.
  • The three paired cases exist and go through the real functions. tests/examples/test_minimax_h3_nightly_protocol.py:132-184 calls measure.main() and assess_project_sequential(), not hand-built dicts: over-cap incumbent with a 0.0999 % candidate gain → INCONCLUSIVE baseline / FAIL candidate; compliant incumbent with an over-cap candidate → FAIL with candidate_check_rejected; both compliant at 6.25 % → PASS. I recomputed the numbers from reference = 100, caps = 0.8: 80.08/100/0.8 = 1.001, and (1.001 − 1)/1.001 = 0.0999 %; 75/100/0.8 = 0.9375, and 1 − 0.9375 = 6.25 %.
  • Provenance. protocol/h3bench.py:88-110 binds the reference to the HF commit directory or to a weights manifest (relative name, size, sampled bytes), and :54-70 binds it to GPU UUIDs, recording every visible card when CUDA_VISIBLE_DEVICES is unset. protocol/measure.py:58-72 compares all four keys before the gated server starts.
  • The driver satisfies the freeze. nightly.sh:38-39 requires H3_TARGET_REVIEW, H3_DEVICE_SCOPE, H3_INTAKE and H3_REFERENCE_GUARD, and :86-93 passes --intake, --target-review, --device-scope and --reference-guard. test_the_nightly_arguments_freeze_a_project_on_cpu runs that argument set through cli_main with a fixture-generated intake and target review, and asserts the campaign is created.

Two non-blocking findings

  1. README.md:16 overstates CI coverage. It says "Those tests are part of the normal suite, so the four CI lanes run them". ci-draft.yml:25 and ci-merge.yml:32 run only tests/repository/test_smoke.py tests/contracts/test_claim.py; the whole suite runs in ci-ready.yml:72,79 and ci-nightly.yml:43. Lint does cover tests where ruff check src tests tools runs. Please say "full-check and nightly run them; the draft and merge lanes run the two named files", so the claim matches the workflows an owner will read.
  2. The snapshot layout still trusts the directory name, and the README reads as if it does not. protocol/h3bench.py:97-99 returns hf-snapshot:<directory name> without reading a byte, and test_model_revision_identifies_weights_not_the_directory_name asserts only the prefix. So a same-name directory with different weights is still accepted on that layout — the case @david6666666 raised — while README.md:85-87 ("A same-name directory holding different weights is therefore rejected, as long as the size or sampled bytes changed") reads as if the content rule covers both. Either scope that sentence to the manifest layout, or bind the snapshot cheaply: its entries are symlinks into blobs/<sha256>, so checking that each symlink target's name matches its digest closes it without hashing gigabytes.
Not checked No device, model, ffmpeg or server run. The "11 tests pass in about a second" figure is the author's; I read the file and counted 11 collected cases, but did not execute it here. The first supervised four-GPU run still has to confirm the integration points the README lists, as the PR states.

@zengchuang-hw — the paired tests you asked for are at tests/examples/test_minimax_h3_nightly_protocol.py:132-184, and they run the real measure.main() and assess_project_sequential(). That P1 is now answerable on the code, so a re-review at 173baa4a is the next step.

@Dong1017

Dong1017 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Head 173baa4aa; main at 2407313da (#699) is merged in. One response per finding.

[P1] @zengchuang-hw — the cap decides eligibility before the ratio.

+1000 is gone. measure.py writes gate_ratio = max_i(r_i / cap_i) with its original value and, when any scenario is past its cap, adds status: "candidate_failure", violations, and reason: "cap_exceeded_...". The harness applies that per side (harness/evaluator/project.py:105): a candidate is FAIL, and a baseline is baseline_check_rejected → INCONCLUSIVE, so it is reported incomparable and cannot count toward the 5 % gate.

The three paired regressions run the real measure.main and assess_project_sequential:

Case Result
Your counterexample: caps 0.80/0.80, reference 100, incumbent (80.08, 80), candidate (80, 80) baseline INCONCLUSIVE; if compared, improvement_pct is 0.0999 %, FAIL at 5 %
Compliant incumbent, candidate (83, 76) FAIL, violations == ["8step"]
Both compliant, candidate (75, 75) PASS at 6.25 %

@david6666666 — --target-review, cap, weights.

  • nightly.sh now passes --target-review and --device-scope. On current main the CLI also refuses a project campaign without an approved --intake, and the default reference_then_candidate comparison needs --reference-guard; the driver requires both. The CPU test runs the real session start project freeze with the exact driver argument set and a generated review and intake, and the campaign is created.
  • The cap no longer enters the score; the three cases above include an incumbent that violates its cap.
  • model_revision is hf-snapshot:<commit> for an HF cache layout, and otherwise a manifest hash over weight names, sizes and the first and last 64 KiB. A same-size in-place rewrite changes it; bytes outside the sampled ranges are not covered, and the README states that.

@amy-why-3459 — descriptions and binding.

  • The README no longer says the example adds no tests; the PR body is updated and its head_sha is 173baa4aa90fa905170d93f7c5385978c6e6af95.
  • The README's "GPU list" and "model digest" now describe device UUIDs and the weight revision. devices records every visible card when CUDA_VISIBLE_DEVICES is unset, so setup no longer writes null and then fails its own verification.

Remaining limitation: the target review is operator-provided. Its calibration binds the baseline snapshot, so it must be regenerated after every accepted night; the scaffold does not invent baseline samples or an attainable value. The README says this.

No GPU run of this head. The earlier 1-GPU smoke predates these changes and only proved the wiring.

All ten checks pass on 173baa4aa, including both full-check jobs.

@zengchuang-hw @amy-why-3459 @david6666666 — re-review on 173baa4aa requested.

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

复核 173baa4a(base 2407313d)。上轮的文档、声明、模型取样指纹和未设置 CUDA_VISIBLE_DEVICES 时的 UUID 记录均已更新;场景超限也不再向联合比值加罚。核对了当前版本 Ready CI,本次未另跑 GPU 或夜间任务。

暂不 Approve:每晚的硬门槛没有随会话冻结。 nightly.sh 每次都覆写 $H3_CAMPAIGN_ROOT/caps.json,并把这个文件的绝对路径交给 --measure-command。Harness 会把 {protocol} 展开到会话的 frozen/protocol,但这个外部路径原样传给 measure.py,每次测量都重新读。锁只能串行化 driver,不能让前一晚尚未执行的独立 final 取回原门槛。例如,同一个归一化耗时 0.79 当晚 cap=0.80 时合规;下一晚把同一路径改成 cap=0.78,重跑旧会话便会拒绝它。现有 CPU freeze 测试用一个不存在的 /state/caps.json 仍能建会话,说明它没验证 cap 内容被保留。

建议在 nightly 准备本次协议时就把 cap 写入协议目录,让 calibration 和正式 freeze 都绑定这份内容,测量命令只读 {protocol}/caps.json。补一条 CPU 回归:启动会话后改外部 state 或准备第二晚,旧会话的 baseline/candidate/final 仍使用原 cap。

Dot, acting for @amy-why-3459.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Confirmed on 173baa4a (base 2407313d): the cap document is not part of the frozen session. Evidence, read from the tree at this head:

  • nightly.sh:50 sets CAPS="$H3_CAMPAIGN_ROOT/caps.json", and :65-74 rewrites that file from state.json on every invocation, before session start. The rewrite is inside the .nightly.lock at :58, so it is stable for the duration of one night.
  • :79 bakes the absolute path into the measure command as --caps "$CAPS". There is no {caps} placeholder in the command grammar, so the harness's protocol expansion cannot reach it: src/inferrsi/harness/executor/candidates.py:15-22 stages only the protocol directory into frozen/, which means {protocol} points at the snapshot while $CAPS remains a live path outside it.

One mitigating fact worth recording: protocol/measure.py:108,118-119 re-reads the file per invocation and writes the map it used into the result document as caps. So the values each side was judged against are in the receipts, and a mid-flight rewrite would show up as different cap maps on the baseline and candidate sides. Nothing refuses that, though — the evaluator reads gate_ratio only — and re-measuring a stored session after the next accepted night judges the old session against the then-current caps. That is the reproducibility gap you describe.

In-scope fix that reuses the existing mechanism: write the caps document into $H3_PROTOCOL (documented at nightly.sh:12 as a copy, not the live protocol) and pass --caps "{protocol}/caps.json". The harness then freezes the caps together with the rest of the protocol and no harness change is needed. Keeping caps in the campaign root instead would require a {caps} placeholder on the harness side, which is a larger change.

On my previous review: I approved 173baa4a for the cap-as-gate change and the driver argument set. That review did not cover the freeze path, and this finding does not reopen what I verified. Whether it holds the PR is the maintainer's call; given that the protocol exists to make the nightly threshold auditable, I would fix it or state the limitation in the README rather than leave it implicit.

Checked: the changed example files, the harness staging of protocol inputs, and the evaluator's use of the result document. Not checked: no test run and no GPU; the CPU suite results are the author's.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR review verdict — DO NOT PASS
dot, acting for zengchuang-hw.

作者邀请 · 同一提交的复核提醒。上轮 79a8b4c8fb8a290c4c221e142055dfd40a61c644 → 173baa4aa90fa905170d93f7c5385978c6e6af95;目标 main,base 2407313da6cd6936d3300191a3cb62f6dcbef3b4。

上轮 P1 已解决:候选超限拒绝、incumbent 超限不可比较,合规分数不加罚。11 项协议 CPU 测试通过。另用两次夜跑启动桩和 measure.main 复现了一个独立阻塞:后一夜能改写前一夜的上限,见 nightly.sh 的 [P1]。四项必需 CI 在本 head 通过;未执行 GPU、整夜任务或模型质量验证。

评审依据:本轮邀请及示例交付范围;dot / zengchuang-hw,范围限于代码检视与正式评审。


mkdir -p "$H3_CAMPAIGN_ROOT"
STATE="$H3_CAMPAIGN_ROOT/state.json"
CAPS="$H3_CAMPAIGN_ROOT/caps.json"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dot, acting for zengchuang-hw.

[P1] 两个不同夜晚的会话都把同一绝对路径 $H3_CAMPAIGN_ROOT/caps.json 写进测量命令。默认模式只启动会话后便释放锁;下一夜覆盖该文件。旧会话恢复时读取新上限,虽然已冻结的命令和协议文件都没变。这违反 A7 的冻结证据边界。

CPU 控制:两次执行实际 Bash 驱动(启动 CLI 用桩,使用不同夜间时间戳),首夜 8step 上限 0.80、次夜改为 0.75。在同一个首夜测量命令下,用 measure.main 桩入固定耗时 78、参考 100,结果从合规(0.975)变成 candidate_failure(1.04)。请让每夜的 caps 进入它自己的冻结协议,用 {protocol} 下的保留文件;回归需验证第二个会话启动后,第一个会话仍读到原来的 caps,并给出同一资格判定。

@Dong1017

Dong1017 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot (maintainer), an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).

@zengchuang-hw The blocker is the [P1] on nightly.sh against 173baa4: a later night can rewrite the cap an earlier night set, so a regression can pass against a loosened limit.

Who does the work: Dong1017, as PR author and implementer of the #1057 example. Dong-bot cannot push code, so the fix goes on Dong1017's branch. The fix makes the driver stop a later run from silently rewriting an earlier night's cap. The driver must still say how a cap legitimately advances; Dong1017 names that path in the fix, and this note does not choose it.

Artifact to expect: a new commit on #1054 after 173baa4, with a CPU test in tests/examples/test_minimax_h3_nightly_protocol.py that runs two stub nights. It should assert that night 1's cap survives night 2, and that night 2's candidate is judged against that cap. The test result will appear in the PR checks for that head.

After that push, the host triggers an incremental re-review of the new head against 173baa4, and that review will state whether this item is resolved. The current DO NOT PASS stands until then. No GPU or model run is implied here; that stays with the first device run.

Dong-bot (authorized delegate)

Copy link
Copy Markdown
Contributor

dot, acting for @zengchuang-hw.

Thanks for the update. The head is still 173baa4a, so the existing review stands. Please tag me on the revised head. For the two-night fixture, please cover both a resumed first session retaining its original cap and a second session using the cap selected by the documented update rule.

The driver wrote caps to a shared campaign path and named it in the frozen
measure command, so a later night could change the limits of a session that had
already started. Each night now copies the protocol and writes caps.json inside
that copy, and the command names {protocol}; the session freezes its own file.

Caps only tighten: tonight's value is the smaller of the accepted result and the
last issued cap, so editing state.json cannot loosen an earlier limit. A
two-night driver fixture (stubbed CLI, fixed stamps) reproduces the reported
control: 78 against reference 100 is 0.975 on the first night's cap and 1.04 on
the second night's, and the first night still reads 0.975 after later nights.

An HF snapshot is now bound to its symlink targets, which name the blob content
hashes, instead of the directory name alone. Correct the README's CI coverage
claim: full-check and nightly run the suite, the draft and merge lanes run two
named files.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check (non-voting): this account is a declared material_ai_authors entry for this PR, so this is a COMMENT, not an approval.

Read the delta 173baa4a...1bffd2ee (one commit, base 2407313d): nightly.sh, protocol/h3bench.py, the README and tests/examples/test_minimax_h3_nightly_protocol.py. Static read only; I did not run the suite or read CI for this head.

The cap blocker from 173baa4a looks addressed. The measure command now passes --caps "{protocol}/caps.json" and the session gets --protocol "$NIGHT_PROTOCOL", a per-night cp -a of the protocol, so the caps file is inside what the session freezes instead of a shared $H3_CAMPAIGN_ROOT/caps.json. The update rule is caps[name] = min(accepted, floor, 1.0), with the campaign-root caps.json kept only as the floor. test_two_nights_keep_their_own_caps runs the real driver three times with a stubbed session start and checks 0.80 → 0.75 → 0.75 (a looser state.json on night 3 does not raise the cap), then measures 78 vs reference 100 against night 1's copy (0.975, eligible) and night 2's copy (1.04, candidate_failure).

Non-blocking notes:

  • The "resumed first session" case from the last review is checked on the night's protocol copy, not on the harness's frozen session copy, because session start is stubbed. The freeze itself is covered by test_the_nightly_arguments_freeze_a_project_on_cpu, so together they cover it, but no single test goes through the freeze and then reads the caps back.
  • The floor protects against editing state.json, not against editing or deleting $H3_CAMPAIGN_ROOT/caps.json; deleting it resets every cap to min(accepted, 1.0). The README sentence "a cap can tighten but never loosen" holds only if that file is trusted.
  • min(float(accepted.get(name, 1.0)), float(floor.get(name, 1.0)), 1.0) puts the state value first: a NaN there makes min return NaN, which is then written into the floor too, so every later night would be refused by measure.py's finite check until someone edits the floor. A true in state.json becomes 1.0 silently. Validating state.json with the same finite/non-bool rule as measure.py before taking the minimum would close both.
  • _snapshot_links binds link names and targets, i.e. the blob hashes HF wrote; a blob modified in place is not detected. That matches the README's wording, just noting it is a trust in the cache layout, not a content hash.

No blocking finding from this read.

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

复核 1bffd2e:旧会话串读后续夜次门槛的路径已修,测量现在读 {protocol}/caps.json,各夜使用独立的协议副本。仍有一个启动前的证据缺口,暂不 Approve。

准备 target review 和实际启动必须使用同一份已生成的协议。 nightly.sh 要求传入已批准的 H3_TARGET_REVIEW,但在启动过程中才复制 H3_PROTOCOL、从 state/floor 生成该夜的 caps.json。Harness 的 review_one_shot_targets() 将实际冻结协议中每个文件的摘要纳入 context.protocol_files,并要求校准上下文完全一致。按 README 从未带该夜 cap 的源协议准备 review,即使是首次的空 map,启动冻结仍会因新增的 caps.json 报 Target calibration is not comparable。现有负责证明真实 freeze 的测试仍传外部 /state/caps.json;验证每夜 cap 的测试则 stub 掉了 session start,未覆盖两者拼起来的路径。

请提供先生成并锁定当晚协议(含 cap)、再用这份目录校准并启动的两步入口,或等价的可重放准备流程。补一条 CPU 回归:生成该夜 cap 后,用同样的命令和文件摘要创建 target review,走真实 freeze;变更 cap 的负例应被拒绝。不需要设备。本次静态复核;当前 head 的 Ready 仍在跑。

Dot, acting for @amy-why-3459.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Self-check (non-voting, this account is a declared material_ai_authors entry here): follow-up to my 15:22 read of 1bffd2ee, after @amy-why-3459's review.

I withdraw "No blocking finding from this read". The ordering amy describes is in nightly.sh at 1bffd2ee: H3_TARGET_REVIEW is required up front (line 39), while the night's protocol is only created afterwards (cp -a "$H3_PROTOCOL/." "$NIGHT_PROTOCOL/" at line 70, then caps.json written into it at line 71) and passed to session start with that same review (lines 102 and 104). On main, review_one_shot_targets() (src/inferrsi/harness/evaluator/project_objectives.py:145) builds protocol_files from the frozen protocol and raises Target calibration is not comparable: service protocol changed (line 187) on a mismatch. A review prepared from $H3_PROTOCOL as the README describes cannot carry the night's caps.json, so the real freeze should refuse it.

This is the same gap as my first non-blocking note (no single test goes through the freeze with the generated caps), and I under-rated it. I agree with the requested shape: a step that produces and locks the night's protocol, then the review is calibrated against that directory and the launch uses it, plus a CPU regression through the real freeze with a changed-cap negative case.

Static read only: I did not run the suite or check CI for this head.

@Dong1017

Dong1017 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Head 4e73bf077. The caps P1 is fixed; the two self-check items are addressed.

[P1] @zengchuang-hw — each night freezes its own caps.

The shared $H3_CAMPAIGN_ROOT/caps.json is no longer named in the measurement command. The driver copies the protocol to $H3_CAMPAIGN_ROOT/protocol-<stamp>/, writes caps.json inside that copy, passes the copy as --protocol, and the command names {protocol}/caps.json. The session freezes that file with the rest of the protocol, so a later night cannot change it.

Caps also only tighten: tonight's cap is the smaller of the accepted value in state.json and the last issued cap, clamped at 1.0. The campaign keeps the last issued caps as the floor for tomorrow, so editing the state file can lower a cap but never raise one.

The two-night fixture runs the real driver with a stubbed session-start CLI and fixed H3_STAMP values:

Night Accepted in state.json Cap in that night's frozen protocol
1 0.80 0.80
2 0.75 0.75
3 0.80 (a loosening edit) 0.75

Your control is reproduced on the frozen files: with 78 against reference 100, night 1's protocol and caps give 0.975 and a completed result, night 2's give 1.04 and status: candidate_failure. Re-running night 1's measurement after nights 2 and 3 still reads 0.975, because it reads its own frozen caps.json.

The fixture does not start a managed resumed session; it re-reads the first night's frozen protocol after later nights ran, which is the file a resumed session would read. If you want the session-level version too, say so and I will drive it.

@david6666666 — snapshot binding.

An HF snapshot is now identified by the commit directory and its symlink targets, which name the blobs/<sha256> content hashes; changing a target changes the revision. The sampled-bytes manifest remains for non-snapshot layouts, and the README now says which rule applies where.

@Bounty-hunter — both self-check items.

  • README.md now states that full-check and nightly run the suite, and the draft and merge lanes run only tests/repository/test_smoke.py and tests/contracts/test_claim.py.
  • The snapshot claim no longer leans on the directory name; it is bound to the link targets as above.

@amy-why-3459 The descriptions and head_sha are updated for this head.

No GPU run of this head.

All ten checks pass on 4e73bf077, including both full-check jobs.

@zengchuang-hw @amy-why-3459 @david6666666 — re-review on 4e73bf077 requested.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR review verdict — DO NOT PASS
dot, acting for @zengchuang-hw.

上轮检视 173baa4a → 4e73bf07745cafd700dab9de4e1122e72482c990,base 2407313da6cd6936d3300191a3cb62f6dcbef3b4。上轮 caps P1 已解决;本轮仅有一个新阻塞:[P1] HF 快照的权重身份未绑定到实际 blob 字节,见行内。

独立运行 12 项 CPU 协议测试(含逐夜 caps、旧夜保留和 CPU freeze)及 bash -n;另外实跑引用核验复现下述问题。四项必需 CI 与 knowledge-model-policy 已通过。未执行 GPU、真实整夜任务或模型质量验收。

委托:本轮 PTAL · zengchuang-hw · #1057 软件示例 的独立检视。

if path.parent.name == "snapshots":
links = _snapshot_links(path)
if links is not None:
return "hf-snapshot:" + path.name + ":" + links

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dot, acting for zengchuang-hw.

[P1] 代码缺陷:这里绑定的是链接文本,不是模型内容。CPU 夹具用了标准 snapshots/<commit>/model.safetensors → ../../blobs/<原始 SHA-256> 布局;保留链接和 blob 名,只把目标从 AAAA 等长改成 BBBB,真实 measure.verify_reference() 仍接受旧参照。目标文件删除也不能让这一检查拒绝。这样,参考延迟和候选延迟可能来自不同权重却被当作同一冻结条件。请让快照身份校验实际目标(或绑定经过验证并强制不可变的内容快照),并加“同链接、同长度、字节变化”负例与未变快照正例。

@Dong1017

Dong1017 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot (maintainer), an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).

@zengchuang-hw Dong-bot (authorized delegate) here, answering the DO NOT PASS on head 4e73bf07 (review 6204465182). The caps P1 from 173baa4a is resolved and is not part of this note.

Blocking item: [P1] the HF snapshot weight identity is not bound to the actual blob bytes. As the inline review states, model_revision is taken from the snapshot commit and the symlink target names (blobs/<sha256>), not from the bytes of the blobs they point to.

Who does the work: Dong1017, as PR author and implementer of the #1057 example scope. Dong-bot cannot push code, so the change goes on Dong1017's branch and addresses that inline P1 at 4e73bf07.

Artifact to expect: a new commit on #1054 after 4e73bf07, with a CPU test in tests/examples/test_minimax_h3_nightly_protocol.py that changes a weight blob's bytes under an unchanged name and asserts that model_revision changes. How the revision is computed is Dong1017's choice in that commit.

Next: the host triggers an incremental re-review of the new head against 4e73bf07, and that review states whether this item is resolved. Until then the DO NOT PASS stands. This note does not approve, merge, or clear the review, and no GPU or model run is implied.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.
Self-check: this account is a declared material AI author of this PR (material_ai_authors), so this is a non-voting comment, not a formal review.

I reproduced the new [P1] from #1054 (comment) on 4e73bf07745c (base 2407313da6cd), and it holds as written.

Evidence — local, CPU only, h3bench.py and measure.py taken from this head; device_uuids() stubbed so no GPU or lease was used:

  • Fixture snapshots/commit-abc/model.safetensors -> ../../blobs/<64×"a"> with blob bytes AAAA: model_revision() returned hf-snapshot:commit-abc:f715dca….
  • Rewrote the same blob to BBBB (same link, same length): model_revision() returned the identical string.
  • measure.verify_reference() then accepted a reference document recorded against the pre-change revision for this root.
  • Deleting the blob target also left the identity unchanged, so a dangling snapshot is accepted too.

Impact. The README paragraph “every entry there is a symlink into blobs/<sha256>, so the link names are the content hashes and a same-name directory with different weights is rejected without reading gigabytes” is true only for link-text changes. With an unchanged symlink the snapshot branch covers no weight bytes at all, while the non-snapshot fallback (_weights_manifest → _edges_digest over the resolved file) covers file size and sampled edges. So the preferred, documented-as-stronger layout is currently the weakest of the two, and a reference can be labelled as the same frozen weights while the candidate loads different bytes.

Minimal correction that keeps the documented no-full-read property: in _snapshot_links, resolve each link and fold the entry path, the resolved size and _edges_digest(resolved) into the digest, and fail on a dangling or non-regular target. Add the two negative/positive cases the thread asks for: same link and same length with changed bytes must change the identity, an unchanged snapshot must keep it.

I would not clear this head until that is fixed or the claimed guarantee is narrowed to link text only; either way the README sentence needs to match the code.

Not verified here: GPU runs, a real nightly, model-quality acceptance. The protocol test module cannot be collected outside the repository (inferrsi.apps import), so this comment rests on the targeted reproduction above rather than on the suite.

Copy link
Copy Markdown
Contributor

dot, acting for zengchuang-hw.

收到修复安排。同名权重文件的字节变更后,建议回归测试直接断言 verify_reference() 拒绝旧参照,同时保留未改权重的通过用例。当前提交未变,沿用原 P1 线程,不另发检视结论。

Copy link
Copy Markdown
Collaborator

inferRSI, acting for @amy-why-3459.

这是对 #1054 (comment) 中复核请求的增量 review。基线是我上次 review 对应的 1bffd2eeb2ff43ee53b10202b130ce09314fda61,当前 head 是 4e73bf07745cafd700dab9de4e1122e72482c990。两者之间只有提交 4e73bf07745cafd700dab9de4e1122e72482c990(调整 test_two_nights_keep_their_own_caps 中 violations 的字典序断言),未改启动路径或权重身份计算。本次静态复核,未跑 GPU 或真实 nightly。

上次指出的问题仍未解决:examples/minimax_h3_nightly/nightly.sh 仍在入口处要求已批准的 H3_TARGET_REVIEW(约第 41 行),之后才复制当晚协议并写入 caps.json(约第 71–90 行),再把这份已生成的协议和事先准备的 review 一起交给 session start(约第 104–106 行)。按 README 从未带该夜 cap 的源协议准备 review,启动冻结仍会因新增的 caps.json 报不可比。当前 head 没有提供“先锁定当晚协议(含 cap)、再用该目录校准并启动”的入口,也未见覆盖真实 freeze 的对应 CPU 回归。

此外,当前 head 上 @zengchuang-hw 的 P1(HF 快照权重身份未绑定到 blob 实际字节)仍成立:@Dong1017 在 #1054 (comment) 中已确认将在后续提交修复,且 head 尚未更新。这两项解决前不 Approve。

The target review binds the protocol files, so adding caps.json after the review
made the freeze reject the night. The driver now stages the protocol and caps
first; without H3_TARGET_REVIEW it prints the staged path and exits, and the
review is written against that directory before the start. Re-running with the
same H3_STAMP reuses the staged files, and a state change since staging is
refused instead of silently rewriting the reviewed caps.

model_revision now hashes the resolved bytes of every entry under the model
root. A blob whose bytes change under an unchanged name, or a deleted target,
changes the revision; the link name is no longer trusted. The cost is one full
read of the model per check, which the README states.

The CPU freeze test stages, builds the review against the staged protocol, and
runs the real freeze; the provenance test changes a blob in place and asserts
verify_reference rejects the old reference.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dot, acting for @david6666666.

PR review verdict — DO NOT PASS(非表决)
目标 main 51282aa8,本 PR head 8fc03d2d。64/100:Scope 3/3 · Correctness 2/3 · Validation 2/3 · Claim evidence N/A · Simplicity 0/3(脚本与测试新增解释性注释)。

权重身份现按实际 blob 字节计算;staging 也移到了生成 target review 之前,这两个改动方向对了。但全新 campaign 写出的 caps.json 是空对象,而新 freeze 测试要求两个场景都显式写 1.0,所以这条测试到不了正式 freeze。请先统一首夜的表示,再在 Linux 验证真实 driver 的 stage → review → freeze,不需要 GPU。

本次核对了源码与测试路径,未执行夜跑或实机。同 head Ready 的两项 full-check 尚未完成。

capture_output=True, text=True)
assert staged_run.returncode == 0, staged_run.stderr
staged = campaign / f"protocol-{stamp}"
assert json.loads((staged / "caps.json").read_text()) == {"8step": 1.0, "50step": 1.0}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Blocking:这个 fixture 用的是全新 campaign,没有 state.json 或既有 floor。nightly.sh 此时会把 {} 写进 staged caps.json,所以会在这里失败,还没走到真正的 freeze。建议统一首夜协议:要么显式写每个场景的 1.0,要么断言 {} 并在消费端验证两个场景都按 1.0 生效;保留后续真正启动并验证冻结文件的断言。

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.

5 participants