Skip to content

[None][feat] trtllm_modeling_v2: one verdict rule and a final round instead of mid-run re-certification - #21796

Closed
Wanli-Jiang wants to merge 2 commits into
NVIDIA:mainfrom
Wanli-Jiang:user/williamj/mv2flow-verdict-slim
Closed

Wanli-Jiang wants to merge 2 commits into
NVIDIA:mainfrom
Wanli-Jiang:user/williamj/mv2flow-verdict-slim

Conversation

@Wanli-Jiang

@Wanli-Jiang Wanli-Jiang commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

@coderabbitai summary

Description

trtllm_modeling_v2 agent flow (agent-flow/) only. Follow-up to the review of #21629: slim the verdict machinery main already has, instead of extending it.

One rule for a verdict's currency: the tree marker. A verdict counts for a check when its marker (the content of every file a gate can read, plus the native libraries) is the target's current one and its inputs match. The narrowed marker is gone: the list of Python files each check imported (reads), its marker narrowed to them (reads_marker), _narrowed, _verdict_holds and the rank hook's capture of every imported file. In practice it never carried a verdict: on the Qwen3.8 MV2 run every new tree changed every check's narrowed marker, and on the Qwen3.8 FP8 run the 11 verdicts kept by hand had all imported the ops that changed. Its cache also kept a stale answer after a native rebuild under the same commit.

Re-certify once, on the final tree, not after every landing. Mid-run the orchestrator no longer re-runs stale checks by itself. Checks run when a task lands (its claimed checks, as before: they caught premature UNIT_READY on the Step-5 runs), when the planner adds a check task after reading a diff, and in one final round: once no required task is open, every claimed check stale on the final tree runs, the delivery tier last, then delivery as before. On the Qwen3.8 MV2 run three full automatic rounds took 34.1 of 57.4 gate job-hours (59%); on the FP8 run 98 of 137 gate runs were re-runs across 10 commits.

  • The planner's contract standing names, for each missing check, the commit it last passed at, so the planner can diff from there.
  • A planner check task may name delivery-tier checks, so delivery can be rehearsed when the planner wants; the once-per-process automatic rehearsal and the accuracy deferral are gone.

Unchanged on purpose.

  • The marker, not the commit SHA, decides "the final tree": a commit touching only files no gate reads (tests, docs, examples) keeps every verdict, as the FP8 run's tests-only fix did. Requiring the SHA would re-run the whole contract (about 5 h there) after such a commit.
  • Import provenance: a check whose processes imported another commit or an unpinned checkout is void and measured once more; a spool job that resolved several checkouts is refused.
  • Verdicts are written by the orchestrator alone to the append-only contract_status.jsonl; workers write only their own decision files. So workers already keep separate logs that one writer consolidates.
  • Equivalence sharing, check inputs, milestones.

Behavior changes against main

  • Stale checks are no longer re-run while required tasks are open; they run in the final round, or earlier when the planner adds a check task.
  • Old contract_status.jsonl rows with reads/reads_marker still load; those fields are ignored.
commit scope
contract: one rule for a verdict's currency, the tree marker contract.py, workflow.py, snapshots.py, verdict.py, rank hook, tune/stage.py tested_source (−238 LOC)
orchestrator: re-certify once, on the final tree, not after every landing orchestrator._settle, planner prompt and DONE text, contract standing, docs, 3 tests

Test Coverage

agent-flow/tests: 1848 passed. New in test_orchestrator.py, each failing on the old orchestrator: test_a_landing_that_leaves_a_pass_stale_runs_nothing_while_required_work_is_open (also the last-passed commit in the standing), test_the_final_round_runs_each_stale_check_once_on_the_final_tree_delivery_last, test_a_check_task_may_rehearse_a_delivery_tier_check. Removed: the native-rebuild test of the narrowed marker. pre-commit (root and agent-flow/.pre-commit-config.yaml) passes on the changed files.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

…rrency, the tree marker

A verdict now counts for a check only when it was recorded on the
target's current marker, the whole gate-relevant tree with the native
libraries, and with the check's inputs. Equivalent checks still share a
pass on that marker.

The narrowed marker is gone end to end: the rank hook no longer writes
what each process imported, snapshots no longer collect it, gate results
and verdicts no longer carry it, and the workflow no longer keeps lists
of read files or judges a verdict by them. The reuse it was built for
never applied in a real run. On the Qwen3.8 MV2 run every new tree
changed every check's narrowed marker, and on the FP8 run the verdicts
kept by hand had imported every changed op. Its cache also kept a stale
answer after a native rebuild under the same commit.

Rows of contract_status.jsonl written with `reads` and `reads_marker`
still load; the loader ignores keys a verdict no longer has.

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
… final tree, not after every landing

While required work is open, the orchestrator no longer re-runs stale
checks on its own. A check runs when a task that claims it lands, when
the planner adds a `check` task that names it, and in one final round:
once no required task is open, every claimed check with no verdict on
the target as it is runs again, the non-delivery tiers first and the
delivery tier once everything else holds, and delivery proceeds as
before.

Re-certifying after every landing cost more than it caught. On the
Qwen3.8 MV2 run three full rounds of 23 checks took 34.1 of 57.4 gate
job-hours (59%); on the FP8 run 98 of 137 gate runs were re-runs across
10 commits. The checks a task claims still run as it lands: those caught
premature UNIT_READY decisions on the step5 runs.

The re-checks beside running work, the deferral of stale accuracy
checks to milestones and the once-per-process delivery rehearsal go
with it. A planner `check` task may now name delivery-tier checks, so
the planner rehearses delivery when it wants to, and the contract
standing it reads names, for each missing check, the commit of its last
pass, the tree to diff a change from. The planner prompt says the rest.

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant