Skip to content

feat: add shared engineering evaluation and dual-NPU MoE task - #338

Draft
Bounty-hunter wants to merge 25 commits into
InferMatrixLab:mainfrom
Bounty-hunter:codex/issue252-engineering-benchmarks
Draft

Bounty-hunter wants to merge 25 commits into
InferMatrixLab:mainfrom
Bounty-hunter:codex/issue252-engineering-benchmarks

Conversation

@Bounty-hunter

@Bounty-hunter Bounty-hunter commented Nov 3, 2026 •

Copy link
Copy Markdown

This PR gives engineering optimization candidates a shared task definition, independent correctness checks, reproducible measurements and retained source identities. Callers supply actual implementations; existing InferRSI execution paths run them and retain the evidence used for subsequent optimization decisions.

Draft. This update also publishes the two-NPU MoE forward task and the six-session experiment previously kept in local experiment storage. Historical device results and qualification of the newly packaged local runner are reported separately.

Delivered behavior

  • Single-operation task packages: Ascend float32 affine RMSNorm and a CPU Softmax software control. Explicit check / measure / profile / grade / plan / compare operations reuse Workbench; incorrect implementations cannot provide usable timing scores.
  • CPU artifact handoff: SkillEval update-mode prepare/stage/capture/report retains the producer's actual source and independently checks outputs in the trusted parent after Linux sandbox execution. This path checks correctness only and rejects NPU tasks.
  • Complex task: an EP=2 MoE forward with routing, eight partitioned experts, a shared expert and cross-device communication. The independent oracle and grader check both ranks, changing inputs and boundary cases; paired measurements cover complete forward completion and use the slowest rank.
  • Portable distributed entry: python -m tools.moe_benchmark runs a supplied candidate inside a caller-managed two-NPU allocation using the existing external executor. No machine address, physical card assignment, SSH configuration or Agent provider is embedded. It is a separate distributed scenario, not the single-operation TaskPackage adapter.
  • Published experiment bundle: 48 exploration attempts and six independent final measurements, candidate snapshots, per-case timing samples, cumulative token data, failures and a combined optimization/cost figure. Public extracts omit private connection/session details; original evidence identities and unavailable-source limits remain explicit.

How to use and review

Agent launch, knowledge selection, candidate search and repetition policy remain caller-owned. Profiling is optional. This PR does not turn an arbitrary external project into a validated task or add automatic model/session orchestration.

Validation

  • Local relevant regression suite: 146 tests collected across MoE, shared engineering tasks, NPU utility, SkillEval artifact/compare and local executor; command exited 0 with platform/device skips. Ruff passed for src, tests and tools.
  • Published-bundle verifier passed against the authorized original archive: 54 attempts, 5,568 timing samples and 54 candidate source identities. Repository evidence inventory passed with 460 hashes checked across 22 bundles; 17 explicitly declared external sources remain unavailable to public verification.
  • Replayed all 52 complete historical passing rank records through the new CPU score recomputation; results match within 1e-12. Packaged baseline/oracle/workload ASTs match the historical versions. These checks do not run an NPU.
  • Fresh noneditable wheel resource/entry-point checks passed outside the checkout. Privacy scan (including ZIP/GZIP contents), relative links, evidence hashes and independent reviews passed.
  • Hosted Linux CI at 8f3aebd2e1359d11d8bcdd034f5dacedf9a1f12d: Python 3.10 and 3.11 each 3,688 passed, 19 skipped, 284 subtests passed. Both clean installed-wheel checks and strict Linux artifact controls passed. The real detached-worker cleanup regression ran on Linux; scoped PID/start-time and same-tick/unreadable-process controls are included.
  • The cleanup follow-up also passed 45 local tests with one Linux-only skip and independent review. Evidence inventory assertions now account for the new bundle.
  • Windows full-suite validation is not green: an LF/CRLF byte expectation in test_all_actual_revision_bytes_retained_before_checks also fails on the unchanged runtime/test baseline. The passing Linux suite does not imply full Windows qualification.

Historical NPU RMSNorm controls retain their original tested revision and 800 timing samples: correct implementations pass, wrong/replayed outputs are rejected, same-code controls are not selected as an optimization, and an existing fused reference reduces synchronized call latency under the recorded workloads. This was a reference-control experiment, not Agent-discovered code.

The MoE comparison used GPT-6.1 Sol, GPT-5.6 Sol and GPT-6 Astra with knowledge on/off, fresh sequential sessions, eight exploratory rounds each and an independent final. There are 46 correct exploratory candidates, two retained candidate failures and six passing final checks. Costs include failed attempts and cached input; Astra ON experienced substantial queueing. Each condition has one trajectory. Results do not establish a general model/knowledge advantage, and across-session speedup ratios are not direct candidate-to-candidate timings.

Those historical MoE runs used the existing external.execute_trial at frozen InferRSI source 6ed93bb41f7db9dafb420dcb6f8705f1864bc45c, with experiment-local orchestration. They did not execute this PR's single-operation TaskPackage/SkillEval adapter, nor the newly packaged wrapper. No new NPU run is represented by the publication checks.

Remaining work

Refs #252
Refs #336
Refs #337

Add frozen task packages, independent CPU oracles and profiling, with bindings to the existing Workbench and offline SkillEval verifier. Include research decisions, reproducible integration checks and explicit qualification limits.

Agent-assisted-by: Codex (implementation and documentation)
Signed-off-by: dengyunyang <584797741@qq.com>

@Dong1017 Dong1017 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.

Scoped draft review of the new CPU benchmark measurement path against #252 and the campaign no-output-replay rule in #30. P2 benchmark-validity concern is attached inline: the precheck and timed samples reuse the same input object/content, so a memoizing candidate can appear faster without performing the operation on each call. Please address or explicitly constrain this before treating timing as optimization evidence. Static source review only; no tests, model runs, hardware measurements, or acceptance decision made here. The initial task subset remains subject to the recorded owner decision.

if profiler:
profiler.enable()
started = time.perf_counter_ns()
output = compute(x, eps=oracle["eps"])

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.

P2 — measured calls can become cached-output replay. The precheck at line 94 already invokes compute(x), and this loop passes the same x object and values to every warmup/sample. A candidate with a process-local id(x)/content → output memo can pass every value/input-preservation assertion while most timed calls only return the stored output; the reported suite_latency_ms then measures replay, contrary to the campaign's no-final-output-caching boundary (#30). Suggest preparing a frozen, paired varying input sequence outside the timing boundary (same sequence for baseline and candidate) and validating each invocation; add a stateful memoizing-candidate negative regression. Public development workloads still cannot establish hostile-code resistance or held-out generalization.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in ce84506e7106c4fc48fafdfab55d2ea2f9dffd50 with numpy-axis1-v2. Inputs/oracles are prepared before candidate invocation and retained for the complete action; each timed input has distinct bytes from precheck/warmup/other samples. Both arms and all consumers share the same deterministic per-call sequence. Each sample is bound to an input hash. The invariant zero case remains correctness-only, so the new score covers five varying workloads; old task/grader identities and evidence are preserved.

Regression controls confirm exact id/content memo implementations have no cache hits in the sequence, while shape/layout output replay is rejected without a metric. The fix does not claim hostile-code resistance. Forty focused tests and related CLI/SkillEval tests passed; actual Workbench and offline verifier execution retained 300 samples with matching planned and actual inputs. Statistical resolution remains unqualified.

Fix and validation · RSI consumer boundaries. Please re-review; this response does not mark the thread resolved or claim maintainer acceptance.

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.

The specific cached-output replay finding is addressed in ac03ae23; this is a scoped source confirmation, not approval of the whole draft.

  • Inputs and independent oracles are prepared before candidate calls. All input objects stay alive, and later inputs must have distinct bytes; the zero case is correctness-only and five varying cases contribute timing.
  • The new regressions require both identity-keyed and content-keyed memoization to miss, and reject stale shape/layout output replay without a usable performance metric. Per-sample input hashes and the frozen task/grader bindings are retained.
  • @Bounty-hunter remains the implementer. Full-PR review, v2 timing/noise qualification and the recorded parent scope decision remain open; this confirmation establishes neither reliable performance ordering nor optimizer/skill benefit.
Evidence and limits

Assessed head: ac03ae23ce0bb5864a55c2c97d5f3d8d3b550d39; API base and actual main: 663f3b327998526a13aa31e72ad729025c18983c.

Read the current task contract, NumPy evaluator, worker, consumer/verifier bindings, both task manifests and the regression definitions, including input preparation and memo/replay controls. This is not a completed review of all 42 changed files.

The Python 3.11 hosted job reports Ruff success and 3,584 passed / 13 skipped / 284 subtests. It checked out merge 396688581967ea85d8edf2f7f169925546c5e207 (current head into the main above); the API comparison returned zero file differences from the standalone head. Draft qualification was skipped. I did not rerun tests or independently inspect the author's local 300-sample archive. No model/device execution or scope acceptance occurred.

Agent-assisted-by: Codex (validation fixture and documentation)
Signed-off-by: dengyunyang <584797741@qq.com>
Document existing RSI consumers and remaining end-to-end acceptance.

Agent-assisted-by: Codex (implementation, review and validation)
Signed-off-by: dengyunyang <584797741@qq.com>
Agent-assisted-by: Codex (documentation)
Signed-off-by: dengyunyang <584797741@qq.com>
Agent-assisted-by: Codex (review, implementation and documentation)
Signed-off-by: dengyunyang <584797741@qq.com>
Agent-assisted-by: Codex (implementation, validation and documentation)
Signed-off-by: dengyunyang <584797741@qq.com>
Agent-assisted-by: Codex (review)
Signed-off-by: dengyunyang <584797741@qq.com>
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Skill evaluation

PLANNED: not executed; there are no task outcomes yet.
No approval, model efficacy or current-head test result is implied.

  • Next: resolve check applicability at head 8f3aebd2e1359d11d8bcdd034f5dacedf9a1f12d.
  • Task selection: no supported automatic comparison; choose a relevant source/content check and disposition uncovered claims.
  • Selected comparisons: 0 · Estimated task calls: 0. Uncovered/unsupported changes: 84; Canonical library paths: 0; Generated projection paths: 0; Other paths: 84. These are paths, not independent claims.
  • Return: command, input/source pin, exit status, outputs/failures and untested claims for independent verified/refuted/unverified disposition.
Author verification steps (nonpaid; not yet run)
  1. Bind the checkout. Run git rev-parse HEAD; it must equal 8f3aebd2e1359d11d8bcdd034f5dacedf9a1f12d. If it differs, obtain a current plan; do not reuse old results.
  2. Choose an applicable check. Match each changed behavior to the task below or a source/content check; a path match alone does not establish relevance.
    No supported automatic comparison is selected. Review the canonical changes and explain which claims need evidence, are unaffected, or remain unverified; do not treat generated records as separate behavioral claims.
    Uncovered scope by location: Canonical library paths: 0; Generated projection paths: 0; Other paths: 84. Path counts are not claim counts; no metadata-only conclusion is inferred.
  3. Return evidence for independent review: head, check/task/source pin, command, environment, exit status, outputs/failures and untested claims. Label scripted controls. Request each claim's disposition: verified, refuted or unverified; this plan proves neither model provenance nor benefit.
    Check recipes and evidence limits

Evidence and logs · Retention: 30 days.
Retained artifacts are verifiable only before Unix time 1796440682 while the linked artifact is available. Expired evidence is unverified.

Plan bindings, budget, frozen exam and advisory details

Advisory: obtain missing evidence

Retained evidence availability: planned / unexecuted. No approval or merge authorization is issued.
Applicable only while these revisions and inputs match the current PR.
Paid execution requires trusted label authorization and cumulative PR reservation. Unknown accounting blocks new paid calls; planning is not execution.
Pipeline evidence only; offline fixed outputs do not establish skill efficacy.
Unchanged-correct is valid neutral evidence, not incremental benefit.
Content/source review and authorship admission remain separate.
Trusted regrading checks retained answers, not model/hardware provenance or a hostile executor; this is not an efficacy certification.

  • Retained evidence is planned / unexecuted.
  • No supported comparison cases were selected.
  • Uncovered/unsupported scope needs a case or explicit reviewer disposition.
    Plan SHA-256: fb2fc7aac9a3005b5ffa633b4da39214d97bd49cabc1e97237cf595c978ecb99
    Base: 663f3b327998526a13aa31e72ad729025c18983c · Head: 8f3aebd2e1359d11d8bcdd034f5dacedf9a1f12d
    Trusted implementation: 9dded7adac0ac835f6a73493309399e328a43ab2

Model/settings: {"effort":"not_applicable","name":"claude-opus-5-5"}
Budget: {"comparisons":0,"estimated_calls":0,"limits_per_comparison":{"campaign_seconds":600,"max_task_calls":2,"repeats":1,"timeout_seconds":180,"token_stop_new_trials":200000},"provider_config_sha256":"b28d80f8194fbe0f5a9f01515efb24b218979fd45f702776560da276f4b30d04","reservation":null}

Skill Comparison Cases Estimated calls

Automatic execution / cumulative PR budget:

{"reason":"Trusted configuration or pricing missing, invalid or expired","remaining_usd":"unknown","reserved_or_unresolved_usd":"unknown","spent_or_legacy_usd":"unknown","state":"blocked"}

Provider/settings: {"client":{"api_version":"2023-06-01","endpoint":"https://yibuapi.com/v1/messages","kind":"anthropic-messages-full-context-v1","max_output_tokens":4096,"max_read_bytes":32768,"max_request_bytes":262144,"max_requests":1,"max_tool_calls":12,"provider":"yibuapi"},"limits":{"token_stop_new_trials":200000},"model":{"effort":"not_applicable","name":"claude-opus-5-5"},"pricing":{"currency":"USD","expires_at":1793271228,"group":"default","max_input_tokens":1000000,"model":"claude-opus-5-5","rate_evidence":"https://github.com/InferMatrixLab/InferRSI/issues/215#issuecomment-6467531341","rates":{"cache_read":"0.4","cache_write":"10","input":"8","output":"40"},"request_fee":"0","unit":"per_million_tokens"},"spend_limit":{"amount":"200","currency":"USD"}}

Uncovered / unsupported paths (84)
  • uncovered: ".github/workflows/ci-ready.yml"
  • uncovered: "docs/architecture.md"
  • uncovered: "docs/engineering-benchmarks.md"
  • uncovered: "docs/engineering-task-artifacts.md"
  • uncovered: "docs/moe-forward-benchmark.md"
  • uncovered: "docs/operations.md"
  • uncovered: "docs/skill-eval-comparison.md"
  • uncovered: "evidence/moe-agent-comparison-20261104/README.md"
  • uncovered: "evidence/moe-agent-comparison-20261104/build_public.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/README.md"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/candidates.csv"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/exploration-candidates.zip"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/final/gpt56-kb-off.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/final/gpt56-kb-on.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/final/gpt61-kb-off.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/final/gpt61-kb-on.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/final/gpt6astra-kb-off.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/patch/final/gpt6astra-kb-on.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/plan/README.md"
  • uncovered: "evidence/moe-agent-comparison-20261104/plan/integrity.json"
  • uncovered: "evidence/moe-agent-comparison-20261104/plan/provenance.json"
  • uncovered: "evidence/moe-agent-comparison-20261104/plan/publication.json"
  • uncovered: "evidence/moe-agent-comparison-20261104/render_overview.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/results/audit-extract.json"
  • uncovered: "evidence/moe-agent-comparison-20261104/results/changes.md"
  • uncovered: "evidence/moe-agent-comparison-20261104/results/comparison-overview.png"
  • uncovered: "evidence/moe-agent-comparison-20261104/results/measurements.jsonl.gz"
  • uncovered: "evidence/moe-agent-comparison-20261104/results/rounds.csv"
  • uncovered: "evidence/moe-agent-comparison-20261104/results/session-usage.csv"
  • uncovered: "evidence/moe-agent-comparison-20261104/results/summary.json"
  • uncovered: "evidence/moe-agent-comparison-20261104/validator/README.md"
  • uncovered: "evidence/moe-agent-comparison-20261104/validator/runner/grade.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/validator/task/TASK.md"
  • uncovered: "evidence/moe-agent-comparison-20261104/validator/task/baseline.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/validator/task/oracle.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/validator/task/task.json"
  • uncovered: "evidence/moe-agent-comparison-20261104/validator/task/workload.py"
  • uncovered: "evidence/moe-agent-comparison-20261104/verify.py"
  • uncovered: "pyproject.toml"
  • uncovered: "src/inferrsi/arguments.py"
  • uncovered: "src/inferrsi/cli.py"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/rmsnorm-npu/LICENSE"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/rmsnorm-npu/README.md"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/rmsnorm-npu/baseline.py"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/rmsnorm-npu/candidate.py"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/rmsnorm-npu/task.json"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/softmax-cpu/LICENSE"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/softmax-cpu/README.md"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/softmax-cpu/baseline.py"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/softmax-cpu/candidate.py"
  • uncovered: "src/inferrsi/data/engineering_benchmarks/softmax-cpu/task.json"
  • uncovered: "src/inferrsi/data/engineering_scenarios/moe-forward-npu/LICENSE"
  • uncovered: "src/inferrsi/data/engineering_scenarios/moe-forward-npu/TASK.md"
  • uncovered: "src/inferrsi/data/engineering_scenarios/moe-forward-npu/baseline.py"
  • uncovered: "src/inferrsi/data/engineering_scenarios/moe-forward-npu/oracle.py"
  • uncovered: "src/inferrsi/data/engineering_scenarios/moe-forward-npu/task.json"
  • uncovered: "src/inferrsi/data/engineering_scenarios/moe-forward-npu/workload.py"
  • uncovered: "src/inferrsi/harness/benchmarks/init.py"
  • uncovered: "src/inferrsi/harness/benchmarks/cli.py"
  • uncovered: "src/inferrsi/harness/benchmarks/consumers.py"
  • uncovered: "src/inferrsi/harness/benchmarks/contract.py"
  • uncovered: "src/inferrsi/harness/benchmarks/npu_task.py"
  • uncovered: "src/inferrsi/harness/benchmarks/numpy_task.py"
  • uncovered: "src/inferrsi/harness/benchmarks/skill_verifier.py"
  • uncovered: "src/inferrsi/harness/benchmarks/worker.py"
  • uncovered: "src/inferrsi/harness/scenarios/_moe_processes.py"
  • uncovered: "src/inferrsi/harness/scenarios/moe.py"
  • uncovered: "src/inferrsi/harness/scenarios/moe_grader.py"
  • uncovered: "src/inferrsi/harness/skill_eval_benchmark.py"
  • uncovered: "src/inferrsi/harness/skill_eval_engineering.py"
  • uncovered: "src/inferrsi/harness/skill_evaluation.py"
  • uncovered: "tests/check_installed.py"
  • uncovered: "tests/test_engineering_benchmarks.py"
  • uncovered: "tests/test_evidence_inventory.py"
  • uncovered: "tests/test_moe_benchmark.py"
  • uncovered: "tests/test_npu_engineering_benchmark.py"
  • uncovered: "tests/test_skill_eval_benchmark.py"
  • uncovered: "tests/test_skill_eval_benchmark_compare.py"
  • uncovered: "tools/engineering_benchmark_validate.py"
  • uncovered: "tools/evidence_inventory.json"
  • uncovered: "tools/moe_benchmark.py"
  • uncovered: "tools/npu_benchmark_validate.py"
  • uncovered: "tools/skill_eval_compare.py"
  • uncovered: "tools/skill_eval_local.py"

Agent-assisted-by: Codex (validation)
Signed-off-by: dengyunyang <584797741@qq.com>
Agent-assisted-by: Codex (validation and documentation)
Signed-off-by: dengyunyang <584797741@qq.com>

@Dong1017 Dong1017 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.

Incremental review at fd0f396c of the formal artifact integration since ac03ae23: one P2 correctness blocker, attached inline. The new built-in-only adapter can resolve a same-named working-directory task instead of the packaged task, and its freeze/revalidation path preserves that substitution.

The earlier cached-output replay finding remains addressed; I am not reopening or duplicating it. I inspected the new adapter, reused task/sandbox contracts, controller/run-trial/local-capture/report changes, regression definitions and CI wiring. Current Ready CI succeeds: the dedicated Linux controls report 49 passed with strict sandbox availability enabled; the 3.11 full check reports 3,631 passed, 18 skipped and 284 subtests. Actual checkout 98156741 has zero file differences from this head. Those tests do not cover cwd task shadowing.

Static source review plus existing hosted logs only; no local candidate/test execution, model or hardware work. Bounty-hunter retains the correction. Correctness-only limits, performance/skill-benefit gaps and #252's outstanding acceptance decision remain separate; this review does not accept the broader goal.

def task_descriptor(name: str) -> dict:
if name not in builtin_tasks():
raise ValueError("Only built-in shared CPU benchmark tasks are supported")
package = load_task(name)

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.

P2 — resolve formal tasks from the packaged resource, not the working directory. Checking that name occurs in builtin_tasks() does not ensure that load_task(name) loads that built-in package: contract.load_task first prefers any existing Path(name) directory. validate_task(), starter() and verify() repeat the same lookup, so they all agree on a shadow rather than detect it.

For a concrete source-trace case, run from the InferRSI checkout with a local softmax-cpu/ copy of the packaged task and change only its oracle.atol to 1. Generate the descriptor through task_descriptor('softmax-cpu'). The manifest validator permits that positive finite tolerance. prepare() copies this same package, freezes its checkout-relative paths, and load_plan() compares against the same shadow, so the paired path also accepts it. A compute returning np.zeros_like(x) then satisfies all four output checks for every input: true softmax values lie in [0,1], so np.allclose(0, expected, atol=1) accepts them. The canonical packaged files need not change. This is static tracing/arithmetic, not a claim that I executed the candidate.

This makes a built-in-only, independently frozen correctness task depend on the caller's cwd and allows an incorrect artifact to pass under an accidentally or deliberately substituted rubric. It is separate from the documented public-suite/protocol-spoofing limits. Please use an explicit packaged-resource/built-in-only loader throughout the formal adapter and its prepare() dependency collection, while retaining path loading for the trusted Workbench API. Add a regression with a same-named cwd task directory that proves the canonical oracle/hash is used or the shadow is rejected.

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.

The specific cwd-shadowing finding is addressed at 6308268fc6d1fbf90e9ab97b5da8af79152f39ea (fix introduced in 00c41b24). This clears this finding only.

  • load_builtin_task() resolves the packaged resource and checks its manifest ID. The formal descriptor, starter and parent verifier now use task_package(); prepare copies and freezes dependencies through that same canonical loader. Revalidation compares the retained package hash and starter against the canonical descriptor. Trusted Workbench path loading remains available.
  • The new regressions cover a same-named softmax-cpu/ cwd directory with atol=1, canonical descriptor/starter/oracle selection, prepare/dependency freezing and later revalidation. The real sandbox control rejects the zero-output implementation despite that shadow. The formal CPU path also rejects the new NPU adapter before execution.
  • I read the exact-head source and dedicated Linux control log: 54 passed, zero skips, with INFERRSI_REQUIRE_BENCHMARK_SANDBOX=1 and NumPy 2.2.6. The 3.11 full check reports 3,649 passed / 20 skipped / 284 subtests. CI checked out merge 6f1506bc; its tree has zero file differences from this head. I did not execute code locally.

The separate NPU action/total-timeout finding remains open and is not superseded by this reply. This is not whole-PR approval, device qualification, performance/skill-benefit evidence, or scope acceptance; Bounty-hunter retains the implementation.

Agent-assisted-by: Codex (documentation and scope review)
Signed-off-by: dengyunyang <584797741@qq.com>
Agent-assisted-by: Codex (source research and task design)
Signed-off-by: dengyunyang <584797741@qq.com>
@Bounty-hunter Bounty-hunter changed the title feat: add shared CPU engineering benchmark tasks feat: add shared CPU benchmarks and formal SkillEval artifact checks Nov 4, 2026
Keep reviewed path loading available to Workbench while resolving formal descriptors, starters, oracle checks and prepare dependencies only from packaged task resources. Reject unsupported device adapters before the NumPy sandbox.

Agent-assisted-by: Codex (implementation and tests)
Signed-off-by: dengyunyang <584797741@qq.com>
Define the affine device task and qualification flow; retain CPU results as historical software evidence and keep NPU SkillEval isolation separate.

Agent-assisted-by: Codex (documentation)
Signed-off-by: dengyunyang <584797741@qq.com>
Execute trusted candidates on an allocated NPU with an independent scalar oracle, synchronized eager timing, separate device profiling and Workbench A/A and reference controls.

Agent-assisted-by: Codex (implementation and review)
Signed-off-by: dengyunyang <584797741@qq.com>
A no-op comparison may fail either its speed gate or correctness. Accept the no-op control only after successful final quality validation, and compare its actual environment with every other result.

Agent-assisted-by: Codex (implementation and review)
Signed-off-by: dengyunyang <584797741@qq.com>
Match all action, trial and final validation identities against the pre-execution freeze, including incorrect controls stored outside the task package.

Agent-assisted-by: Codex (implementation and review)
Signed-off-by: dengyunyang <584797741@qq.com>

@Dong1017 Dong1017 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.

Scoped incremental static review of the new rmsnorm-npu pilot in PR #338 (head 6308268f), against the execution limits recorded in Issue #337. One P2 execution-budget contract gap, attached inline: the 180-second action timeout is applied to standalone check/profile/negative controls but not to the A/A or reference Workbench trials. This can leave an individual trial running until the 8-minute comparison deadline; the script also does not itself enforce the separately stated 20-minute pilot envelope. Please bind the per-action and total deadlines or identify and verify the outer enforcement, with a timeout-control regression. This is a source/contract finding, not a hardware result. I inspected the new NPU adapter/driver, RunSpec, the Workbench runner/external/local executor chain and relevant tests. The earlier canonical-task shadowing review remains separate and is not repeated. No NPU/model/test execution or acceptance decision was performed.

comparisons = {}
# Same implementation in both arms is the explicit no-op/A-A control.
for name, path in (("aa", baseline), ("reference", candidate)):
spec = task.runspec(path, repo=args.repo, output_dir=output / "results" / name,

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.

P2 — the frozen per-action timeout is not applied to paired NPU trials. Issue #337's predeclared pilot says --timeout-seconds 180, two Workbench comparisons capped at 8 minutes each, and a 20-minute total runtime. Here args.timeout_seconds is passed only to run_action() for check/profile/negative controls (lines 96–116); task.runspec() does not carry it. run_experiment() passes its whole-comparison deadline to execute_trial() → execute_command(), which calls process.wait(timeout=deadline-now). Thus a first stalled A/A or reference trial may occupy almost the entire 480-second comparison instead of stopping at 180 seconds; two comparisons plus all standalone controls can also exceed 20 minutes unless an independently enforced outer deadline exists. That changes the frozen resource/lifecycle budget, particularly on a shared NPU allocation. Please cap each Workbench trial at min(comparison_remaining, action_timeout, pilot_remaining) (or implement equivalent tested enforcement), and include a deliberately nonterminating synthetic command in a CPU-only timeout regression. If a scheduler supplies the global bound, record its enforceable receipt and distinguish that from this script's guarantees.

Publish the NPU workflow, all timing samples and scoped keep decision; distinguish the trusted device pilot from formal artifact isolation and Agent efficacy.

Agent-assisted-by: Codex (documentation and evidence review)
Signed-off-by: dengyunyang <584797741@qq.com>
@Bounty-hunter Bounty-hunter changed the title feat: add shared CPU benchmarks and formal SkillEval artifact checks feat: add NPU RMSNorm pilot and shared benchmark evaluation Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Review at head a91b913e (draft): not approving yet.

  1. Per-action timeout still not applied to paired NPU trials (tools/npu_benchmark_validate.py:101 vs :117-120): args.timeout_seconds is passed to run_action() for check/profile/negative controls, but the aa / reference comparisons build task.runspec(...) and call run_experiment(spec, ...) without it. Issue task: connect engineering tasks to existing Agent execution and evaluation #337's predeclared limits (--timeout-seconds 180, 8 min per comparison, 20 min total) therefore do not bound the paired trials. This is the open Dong1017 finding from 2026-11-04 03:02 UTC; the head has no later code commit. Expected: thread the timeout into the runspec/trial launcher and add a test.
  2. Scope question: the PR is +24,166 lines across 76 files (CPU benchmark path, formal Skill Eval adapter and the NPU RMSNorm pilot/evidence). Is the evidence part within the evidence byte budget discussion in [Investigation] Agent-led workflow gaps: closure, decision visibility, review provenance and focus #273, and should the pilot evidence be split from the harness change for review?
  3. The PR is still a draft; please mark it ready once the above is resolved so the Ready checks run.

Keep profiling optional, distinguish existing task tools from pending real-Agent integration, and preserve scoped evidence and unresolved review findings.

Agent-assisted-by: Codex (documentation and scope review)
Signed-off-by: dengyunyang <584797741@qq.com>
@Bounty-hunter Bounty-hunter changed the title feat: add NPU RMSNorm pilot and shared benchmark evaluation feat: add shared engineering task evaluation and Ascend RMSNorm Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Incremental review a91b913e..125b0645 (draft; one docs-only commit, docs: consolidate task library and evaluation integration plans), checked against my previous review. Not approving yet.

This delta: the 12 files under docs/plans/issue-252/ consolidate #334/#335 into #336 (task library) and #337 (integration), make profiling an optional diagnostic for the general flow while keeping the frozen profiling checks of the executed NPU pilot, and add an explicit tracker for remaining work. I did not find broken relative links in the changed text (e.g. task-expansion/README.md now points at ../README.md, which resolves to the #252 overview). The wording is careful not to count closed issues as accepted work. CI at 125b0645 is green.

Still open:

  1. Per-action / total timeout for paired NPU trials (tools/npu_benchmark_validate.py:101 vs :117-120): no code change in this delta. The docs now record it as unresolved (03-tasks.md tracker, 04-integration.md last paragraph, README.md, npu-validation.md), which is accurate, but the fix itself is still needed: thread --timeout-seconds into the runspec/trial launcher for the aa / reference comparisons, enforce the overall budget, and add a test.
  2. Scope / size question from last round is not answered yet: is the pilot evidence within the [Investigation] Agent-led workflow gaps: closure, decision visibility, review provenance and focus #273 evidence byte budget, and should the evidence be split from the harness change for review?
  3. The PR is still a draft; please mark it ready once 1 is fixed so the Ready checks run.

Static doc review of the delta only; I did not run the NPU tooling.

Remove the CPU RMSNorm package and its dedicated historical probe. Keep Softmax regression coverage, preserve source-pinned experiment records, and retain the NPU task unchanged.

Agent-assisted-by: Codex (implementation, test migration, and documentation)
Signed-off-by: dengyunyang <584797741@qq.com>

Copy link
Copy Markdown
Collaborator

Incremental review 125b0645..9a755f97 (draft; one commit, chore: remove the built-in CPU RMSNorm task), checked against my previous review. Not approving yet.

This delta looks consistent:

  • The rmsnorm-cpu package and tests/fixtures/engineering_benchmark_usefulness.py are removed; tests/test_engineering_benchmarks.py now asserts builtin_tasks() == {"softmax-cpu", "rmsnorm-npu"} and that loading rmsnorm-cpu fails explicitly.
  • Tests migrated to softmax-cpu. In tests/test_skill_eval_benchmark_compare.py the two-task run is replaced by repeats=2 with a per-repeat mode key, which keeps the AB/BA order check ([1, 1, 2, 2]) and the fix/unchanged-correct counts with one task. The cached-output replay control is rewritten as a Softmax memoizer, so that regression is still covered.
  • tools/engineering_benchmark_validate.py iterates builtin_tasks(), so no stale rmsnorm-cpu reference there. CI at 9a755f97 is green.

Still open:

  1. Per-action / total timeout for paired NPU trials (tools/npu_benchmark_validate.py:102-103 vs :121-126): unchanged in this delta. --timeout-seconds still reaches run_action() only; the aa / reference comparisons call task.runspec(...) + run_experiment(...) without it, and the 20-minute pilot envelope is not enforced. Please thread the timeout into the paired trials, bound the total, and add a test.
  2. Scope / size question from the last two rounds is still unanswered: is the pilot evidence within the [Investigation] Agent-led workflow gaps: closure, decision visibility, review provenance and focus #273 evidence byte budget, and should it be split from the harness change?
  3. Historical links point at a fork commit (docs/plans/issue-252/walkthrough.md, new links to Bounty-hunter/InferRSI/tree/125b0645...): after a squash merge that commit will not exist in this repo and depends on the fork staying alive. Could you pin these to a commit that will be in InferMatrixLab/InferRSI (e.g. the pre-removal commit once merged), or confirm the fork is the intended permanent record?
  4. Still a draft; please mark it ready once 1 is fixed so the Ready checks run.

Static review of the delta only; I did not run the tests or the NPU tooling.

Remove issue-specific plans and large historical dumps from the current tree, retain durable task and artifact handoff guidance, and drop obsolete path attributes and issue-specific utility wording. Historical records remain available at their original revision.

Agent-assisted-by: Codex (documentation cleanup and independent review)
Signed-off-by: dengyunyang <584797741@qq.com>

Copy link
Copy Markdown
Collaborator

Incremental review 9a755f97..6ed93bb4 (draft; one docs commit, docs: keep benchmark usage separate from development archives), checked against my previous review and the follow-ups at 125b0645 / 9a755f97. Not approving yet.

This delta:

  • Removes all of docs/plans/issue-252/ (plans, JSON summaries, profiles, walkthrough) and the matching .gitattributes byte-preservation rules; the PR is now 39 files with no retained evidence dumps. That answers my earlier size / [Investigation] Agent-led workflow gaps: closure, decision visibility, review provenance and focus #273 byte-budget question, and the fork-commit links in walkthrough.md are gone with it.
  • Rewrites docs/engineering-benchmarks.md and adds docs/engineering-task-artifacts.md (CPU SkillEval handoff); docs/skill-eval-comparison.md now links there. I found no remaining references to plans/issue-252 in the PR diff. CI at 6ed93bb4 is green.

Still open:

  1. Per-action / total timeout for paired NPU trials (tools/npu_benchmark_validate.py ~L103 vs L122-125): the code is unchanged; --timeout-seconds still reaches only run_action(), and the aa / reference comparisons go through task.runspec(...) + run_experiment(...) without it. The new text in docs/engineering-benchmarks.md ("Qualify the tools with authored controls") now states this limitation explicitly, which is accurate, but Issue task: connect engineering tasks to existing Agent execution and evaluation #337 predeclared 180 s per action and a 20-minute pilot envelope. Either thread the timeout into the paired trials and enforce the total (with a test), or get an explicit decision on task: connect engineering tasks to existing Agent execution and evaluation #337 that documenting the gap is acceptable for this PR. Documentation alone does not close it in my view.
  2. Where the pilot evidence lives after merge: the commit message says "Historical records remain available at their original revision", but those revisions are branch commits on the fork. After a squash merge they will not be in InferMatrixLab/InferRSI, and [Tracking] Minimal engineering benchmarks shared by Workbench, SkillEval and SearchSpace experiments #252 / task: connect engineering tasks to existing Agent execution and evaluation #337 currently point at results that were in docs/plans/issue-252/. Could you name where the NPU pilot and CPU replay evidence should be retained permanently (e.g. an evidence/ directory per the contributing conventions, a release artifact, or a pinned commit that will exist on main), and update the issue links accordingly?
  3. Still a draft; please mark it ready once 1 is settled so the Ready checks run.

Static review of the delta only; I did not run the tests or the NPU tooling.

Signed-off-by: dengyunyang <584797741@qq.com>
Signed-off-by: dengyunyang <584797741@qq.com>
Signed-off-by: dengyunyang <584797741@qq.com>
@Bounty-hunter Bounty-hunter changed the title feat: add shared engineering task evaluation and Ascend RMSNorm feat: add shared engineering evaluation and dual-NPU MoE task Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Incremental review 6ed93bb4..3266e153 (draft; three new commits: 3eeac85d MoE comparison evidence, 298de775 two-rank MoE task + local evaluator, 3266e153 consumption fix), checked against my previous review and the follow-ups at 125b0645 / 9a755f97 / 6ed93bb4. Not approving yet.

This delta: adds the moe-forward-npu scenario under src/inferrsi/data/engineering_scenarios/, the evaluator src/inferrsi/harness/scenarios/moe.py (+ _moe_processes.py marker-based torchrun cleanup, moe_grader.py), python -m tools.moe_benchmark, tests/test_moe_benchmark.py, and the evidence/moe-agent-comparison-20261104/ bundle registered in tools/evidence_inventory.json. The adjudication logic reads well: both ranks are recomputed from raw calls/samples, timing uses the slowest rank, frozen identities are re-hashed after execution, and the new 3266e153 fix keeps round_consumed=true when a peer leaves a truncated record (covered by test_malformed_peer_does_not_erase_consumed_candidate). pyproject.toml package-data now includes data/engineering_scenarios/**/*.py, and tests/check_installed.py checks the resources ship.

Findings / questions:

  1. CI is red at this head: full-check (3.11) failed in the Tests (smoke + unit) step (job); full-check (3.10) was still running when I looked. I could not read the job log without auth, so I don't know which test fails. Please fix or explain before re-review.
  2. Non-string phase / failure_kind can still lose the candidate-failure status (src/inferrsi/harness/scenarios/moe.py L196-197): the loop above (L188-193) now guards with isinstance(..., str), but failed = any(r.get("phase", "").startswith(...) or r.get("failure_kind", "").startswith(...)) still raises AttributeError when a rank writes "phase": null (or any non-string). It is caught by the outer except, so the result stays status="infrastructure_failure" even if the other rank recorded failure_kind="candidate_...", and main() then exits 1 instead of 2. Suggest reusing the same isinstance guard there and adding a parametrized case with phase=None.
  3. Still open from earlier rounds: paired NPU trial timeout (tools/npu_benchmark_validate.py, ~L103 vs L122-125): unchanged in this delta. --timeout-seconds still reaches only run_action(); the aa / reference comparisons via task.runspec(...) + run_experiment(...) are not bounded, and the task: connect engineering tasks to existing Agent execution and evaluation #337 20-minute envelope is not enforced. Thread the timeout through and add a test, or get an explicit decision on task: connect engineering tasks to existing Agent execution and evaluation #337 that documenting the gap is acceptable.
  4. Evidence location / size: the new evidence/ bundle is the right place for the MoE comparison, thanks. Two follow-ups: (a) where does the earlier RMSNorm NPU pilot / CPU replay evidence (previously under docs/plans/issue-252/) live permanently now? (b) the bundle adds ~560 KB of binaries (results/comparison-overview.png ~418 KB, patch/exploration-candidates.zip ~75 KB, results/measurements.jsonl.gz ~70 KB). Is that within the evidence byte budget discussed in [Investigation] Agent-led workflow gaps: closure, decision visibility, review provenance and focus #273, or should the PNG be regenerated from render_overview.py instead of committed?
  5. Scope: this push adds a second, independent deliverable (distributed MoE scenario + six-session evidence) to a PR that is already large and still has an open blocker in the RMSNorm path. Would you consider splitting the MoE scenario/evidence into its own PR so each can be reviewed and merged on its own evidence? Not a blocker by itself, but it would make 3 easier to settle.
  6. Still a draft; please mark it ready once 1 and 3 are settled so the Ready checks run.

Static review of the delta only; I did not run the tests, the NPU tooling or the MoE evaluator.

Signed-off-by: dengyunyang <584797741@qq.com>

@Dong1017 Dong1017 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.

Scoped follow-up at 2eed487a to Amy's CI question: the evidence-inventory count is now repaired, but both current-head full checks still fail in detached-worker cleanup. The new diagnostics identify a process-discovery failure before any worker is signalled; the P2 below needs correction. The previously reported malformed-field classification and RMSNorm timeout findings remain separate and are not cleared by this review.

CI evidence and scope
  • Inspected head: 2eed487a1edcac30a3a32b5a504bc7b013e9616b; incremental commit only changes inventory totals and assertion diagnostics.
  • Python 3.10 log and Python 3.11 log: each reports 1 failed, 3,682 passed, 19 skipped. The sole failure is test_deadline_cleans_detached_workers_but_preserves_unrelated_process, with verified: false, signalled_pids: [], and permission denied reading a same-user /proc/.../environ.
  • Read the affected cleanup code, test and hosted logs. No local execution, hardware/model run, or new spending.

fields = (entry / "stat").read_text().rsplit(")", 1)[1].split()
if fields[0] == "Z":
continue
if marker in (entry / "environ").read_bytes().split(b"\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.

P2: An unreadable same-user process prevents cleanup of the invocation's workers. _members() scans every same-UID process, and a permission error reading any environ propagates before it returns its accumulated matches. cleanup() therefore reaches its outer exception handler without signalling even the marked workers it could inspect. Both current-head Linux jobs reproduce this after the launcher times out: verified=false, signalled_pids=[], with /proc/.../environ permission denied. This can leave detached workers running and makes the standard Linux qualification fail. Scope discovery to an inspectable invocation-owned process set, and ensure a partial scan still attempts cleanup of positively identified workers. Preserve an inconclusive result when absence cannot be established; do not merely ignore unreadable entries and report verified success. Add coverage for an unreadable unrelated same-user process.

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.

Scoped follow-up at 8f3aebd2e1359d11d8bcdd034f5dacedf9a1f12d: the original hosted-CI failure is cleared, but this P2 is only partially fixed.

Both Python 3.10 and 3.11 now report 3,688 passed, 19 skipped. Skipping strictly older processes is sound for the fresh marker. However, an unreadable same-tick or newer process still prevents cleanup of workers already positively identified earlier in the scan.

I reproduced this with a synthetic procfs and mocked os.kill (no real signals): driver start tick 100, readable exact-marker worker PID 990001 at tick 101, then an unrelated same-UID process whose environ raises PermissionError. With the unrelated process at tick 100 or 101, cleanup() returns verified=false, signalled_pids=[], and the mock receives zero calls. At tick 99, it skips that unrelated environment and attempts to signal the known worker.

_members() still throws away its accumulated matches when the later read raises; cleanup() catches the exception outside the signalling loop. The new unreadable-process test has no owned worker, so it does not cover this consequence.

Please preserve discovered matches alongside scan errors, attempt cleanup of the PID/start-time-verified owned workers, and retain an inconclusive result for unreadable entries. Add the mixed owned-worker/unreadable-process case. This is the remaining part of the original finding, separate from Amy's malformed-field and whole-pilot timeout findings.

Copy link
Copy Markdown
Collaborator

Incremental review 3266e153..2eed487a (draft; one commit, test: register MoE evidence totals and expose cleanup diagnostics), checked against my previous review. Not approving yet.

This delta bumps the evidence inventory totals in tests/test_evidence_inventory.py (21→22 bundles, 430→460 hashes, matching the new evidence/moe-agent-comparison-20261104/ bundle) and splits the cleanup assertion in tests/test_moe_benchmark.py so the guard dict is printed on failure. Both look fine.

Findings:

  1. CI is still red at this head, and the new diagnostic shows why. Both full-check (3.10) (job) and full-check (3.11) (job) fail with one test:
    tests/test_moe_benchmark.py::test_deadline_cleans_detached_workers_but_preserves_unrelated_process → {'verified': False, 'signalled_pids': [], 'error': "[Errno 13] Permission denied: '/proc/1245/environ'"}.
    In src/inferrsi/harness/scenarios/_moe_processes.py, _members() (L29) reads /proc/<pid>/environ for every same-uid process, but its except (L31) only catches FileNotFoundError / ProcessLookupError. A same-uid but non-dumpable process on the runner (pid 1245 here) raises PermissionError, which escapes to cleanup()'s except OSError (L58-59) on the very first scan, so nothing is signalled and cleanup reports unverified. The comment at L33 says this fail-closed behaviour is intentional, but as written it makes cleanup unusable on any host with such a process, which likely includes the NPU hosts too. Could you decide which behaviour you want and make CI reflect it? For example: skip unreadable processes that are not descendants of the launcher (or whose session/pgid cannot belong to this run), still kill the readable marker matches, and report the unreadable PIDs as inconclusive instead of aborting; or, if fail-closed is truly required, make the test set up an environment where that holds and add a separate test for the PermissionError path. I have not verified which processes pid 1245 is on the runner.
  2. Still open: non-string phase / failure_kind (src/inferrsi/harness/scenarios/moe.py L196-197): unchanged in this delta; see item 2 of my previous review.
  3. Still open: paired NPU trial timeout (tools/npu_benchmark_validate.py ~L103 vs L122-125): unchanged.
  4. Still open: evidence location / binary size (earlier RMSNorm pilot evidence; ~560 KB of binaries in the MoE bundle vs the [Investigation] Agent-led workflow gaps: closure, decision visibility, review provenance and focus #273 byte budget): no reply yet.
  5. Splitting the MoE scenario into its own PR is still worth considering, and the PR is still a draft.

Static review of the delta plus the CI logs; I did not run the tests or the MoE evaluator.

Signed-off-by: dengyunyang <584797741@qq.com>

Copy link
Copy Markdown
Collaborator

Incremental review 2eed487a..8f3aebd2 (draft; one commit, fix: bound MoE cleanup scans to fresh-marker process lifetimes), checked against my previous review at 2eed487a. Not approving yet.

This delta addresses item 1 of that review in a reasonable way:

  • _members() (src/inferrsi/harness/scenarios/_moe_processes.py L26-40) now reads the driver's own start time from /proc/self/stat and skips same-user processes with start_ticks < driver_start before touching their environ. Since evaluate() mints the token (moe.py L231) and calls cleanup(token) (L248) in the same process, a strictly older process cannot carry the marker, so skipping it is sound. Same-tick processes stay in scope, and an unreadable in-scope process still makes the result inconclusive (PermissionError reaches the except OSError at L71), which keeps the fail-closed intent.
  • The new tests cover the boundary (start_ticks 99/100/101 vs driver 100), the same-tick owned process, and PID reuse between enumeration and signalling. The field index (fields[19] = starttime, field 22) matches proc(5).

Remaining items:

  1. CI not yet settled at this head: full-check (3.10) and full-check (3.11) were still in progress when I looked. Please confirm test_deadline_cleans_detached_workers_but_preserves_unrelated_process passes on both before re-review. One residual case to keep in mind (question, not a blocker): a same-user process started after the driver with an unreadable environ (e.g. another job on a shared NPU host) still makes cleanup unverified. If that can happen on the target hosts, it may be worth documenting or reporting those PIDs separately.
  2. Still open: non-string phase / failure_kind (src/inferrsi/harness/scenarios/moe.py L198-199): unchanged; r.get("phase", "").startswith(...) still raises AttributeError for "phase": null, while the loop at L190-193 already uses an isinstance(..., str) guard. Please reuse that guard and add a phase=None case.
  3. Still open: paired NPU trial timeout (tools/npu_benchmark_validate.py): unchanged in this delta; --timeout-seconds still only bounds run_action(), not the aa / reference paired trials or the total pilot envelope.
  4. Still a draft; please mark it ready once the above is settled so the Ready checks run.

Static review of the delta plus surrounding source only; I did not run the tests or any NPU tooling.

@Dong1017

Dong1017 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Structural question: two task libraries, two entry styles, two identity freezes

Reviewed at 8f3aebd2e1359d11d8bcdd034f5dacedf9a1f12d. Static reading of source, docs and packaging only — no tests run, nothing executed on a device. I have no comment on the MoE measurements themselves; this is about where the pieces live.

Edited. The original version of this comment claimed that both benchmark paths "inherit the runner's own source-snapshot adjudication" by reusing harness.scenarios.external. That was wrong, and wrong in the direction that matters — it asserted a check that is not there. Section 2 now states what each entry point actually verifies. The error was caught in the architecture thread; nothing else in this comment depended on it.

The MoE addition is documented as a deliberate separation, not an oversight: docs/engineering-benchmarks.md states the scenario "has a separate task contract and is not accepted by the single-operation benchmarks adapter." The question is whether that boundary is the one worth drawing, because the PR now carries two of almost everything.

1. Two parallel content libraries with the same file roles

data/engineering_benchmarks/ data/engineering_scenarios/
Entries rmsnorm-npu, softmax-cpu moe-forward-npu
Files LICENSE, README.md, baseline.py, candidate.py, task.json LICENSE, TASK.md, baseline.py, oracle.py, task.json, workload.py
Code harness/benchmarks/ (contract, worker, consumers, cli, numpy_task, npu_task, skill_verifier) harness/scenarios/moe.py (595), moe_grader.py (921), _moe_processes.py
Entry point inferrsi benchmarks list|show|check|measure|profile|grade|plan|compare python -m tools.moe_benchmark
Packaging data/engineering_benchmarks/**/*.py a second package-data line added for data/engineering_scenarios/**/*.py

Both hold the same kind of thing: a frozen task manifest, a baseline, a correctness oracle, a license and provenance. The stated distinguishing axis is single-operation versus distributed layer. That reads like a property a task declares, not a reason for a parallel tree — and task.json exists on both sides, so there is already a place to declare it.

Two costs are visible in this diff rather than hypothetical. pyproject.toml needed a second package-data entry, so a third scenario kind needs a third. And the boundary is now described in four places (engineering-benchmarks.md, moe-forward-benchmark.md, an architecture.md paragraph, an operations.md entry) while operations.md itself says it "is not a third primary matrix" — the navigation cost is already being paid.

The practical consequence: an agent has to know which library a task lives in before it can choose the invocation. For a task library that is the thing you most want to avoid.

2. Each entry point verifies something different, and the differences are not visible from the imports

moe.py freezes and re-checks identity on its own: _hashes (#L97) computes a sha256 map, _prepare (#L104) writes identity.json, and _adjudicate (#L356-L449) recomputes and raises on Rank/file identity mismatch or Frozen task, grader, request or candidate ....

Its imports are infra.artifacts, ._moe_processes and .external — it does not import harness/benchmarks/contract.py, which was added earlier in this same PR and already carries task_sha256 / candidate_sha256 / grader_sha256 and assert_unchanged.

These two are not interchangeable: contract.py binds execution identity against a pre-bound record for a single-operation task, while moe.py binds a multi-file, multi-rank set across a prepare/adjudicate boundary. Different protected objects, so "merge them" is the wrong ask.

What is worth checking is that reusing a shared execution helper conveys no upper-layer guarantee. execute_trial is a leaf executor — external.py#L12, importing only infra.artifacts, infra.executors.local and model.protocols.metrics, with no snapshot or integrity logic. The source-snapshot adjudication lives in the wrapper: runner.py#L16-L23 takes execute_trial as run_experiment's default execute, and the verdict-affecting check is in terminate() at #L95-L117. Both consumers.py (#L13 import, #L41 call) and moe.py (#L527) call execute_trial directly, so neither passes through that wrapper.

Per entry point, as read at this head:

Entry point Execution path Repo source-snapshot adjudication Parent-side identity verification
benchmarks plan / compare contract.runspec() → run_experiment yes, runner.terminate() yes, bound by runspec()
benchmarks grade grade_artifact → run_action → execute_trial no yes — task.identity() before and after, assert_unchanged(), plus the result's echoed identity; any mismatch leaves checks = None and the verdict INCONCLUSIVE
benchmarks check / measure / profile run_action → execute_trial no no — run_action builds the command and executes it
MoE moe.evaluate → execute_trial no yes, its own _prepare / _adjudicate

worker.py adds a further in-subprocess identity check for all of these; I read that by structure in an earlier pass and did not re-verify it line by line at this head.

That table is the useful artifact, and it is also the point: filling it per module produces the wrong answer, which is how I got the original claim wrong. It has to be filled per entry point. Nothing here says any of these entry points needs source-snapshot adjudication — grade arguably does not, since it compares identity directly. It says the guarantee set differs across entry points in ways the import graph does not show.

3. Three low-cost suggestions

None of these requires restructuring what is already here:

  1. Declare the contract in task.json. One field naming which adapter accepts the task, so a caller resolves the invocation from the manifest instead of from prose. This is the smallest fix for the "which library is it in" problem.
  2. State the axis in the names, or converge the entry style. benchmarks versus scenarios does not convey "single-operation versus distributed"; the docs have to carry that, in four places. Either rename to the axis, or expose the MoE path as a benchmarks-family subcommand so there is one entry style with a declared task kind.
  3. Record the guarantee set per entry point, in the shape of the table above. Protected object, applicable operation, identity field, invalidating event, enforcement site, counter-example test, retained consumers — the format being discussed in the architecture thread. Cheap now while both implementations are fresh, and it answers the reviewer question of whether the second freeze is intentional. It also stops the next adapter author from assuming, as I did, that reusing execute_trial carries the runner's checks.

4. What this comment does not claim

  • I did not run the test suite, the MoE evaluator, or anything on a device.
  • moe_grader.py (921 lines) and tests/test_moe_benchmark.py (343 lines) were read by symbol and structure only, not line by line.
  • benchmarks/contract.py and worker.py are byte-identical between 6ed93bb and this head, so earlier single-operation conclusions about them stand; the MoE path is additional rather than a revision of them.
  • No opinion on the six-condition comparison's conclusions. I note only that the bundle's own evidence_inventory.json entry states that original rank logs, condition/session access audits and host launch configuration remain outside the checkout, limiting independent replay — which is the right thing to have recorded.
  • The separation may well be the right call for reasons not visible in the diff. This is a request to write the reason down where a future adapter author will read it, not an assertion that it is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workbench CLI workbench: profile, A/B loop, quality gates, evidence reports

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants