Skip to content

vision: an --hf projector off the plan stays only when its media plan is free - #485

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-review-bot-issue-457-vision
Oct 19, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-review-bot-issue-457-vision

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

What and why

Fixes #457. vision_seat::kept kept an --hf projector without asking cost whenever its seat had no stage-card reserve, which is the case for a tower on a card off the text plan. The Qwen3 seat still plans the media load for that tower, and its planner reserves rotation tables on the stage card, so the kept projector could lower the context or refuse a --ctx that fits without it. kept now compares the plan with and without the encoder for every --hf projector. An --mmproj file and an image token limit still keep the projector at any cost.

Release notes: Fixed: on the Qwen3 seat, an --hf projector on a card off the plan stays only when its media plan costs no context; otherwise the seat serves text and the vision line gives the cost.

Code shape

  • No second copy. The change is in kept, the one owner of the rule for all three seats. The new test reuses the module's helpers (opened, seat_of, device, on, flags, Cost).
  • Model code holds only architecture facts. No model code changes.
  • Dead code is gone. One condition is removed.
  • No silent failure. No error path changes.
  • Comments state what is true now. The doc comment on kept states the current rule.
  • No relaxed gate.
  • cargo fmt and cargo clippy: fmt passes in t0 (fmt rc=0 3s); clippy passes with the warning count of main and none in the changed files (Finished dev profile [unoptimized + debuginfo] target(s) in 25.46s).

Duplication found or removed (path:line), or "none": none.

What changed:

  • crates/gpu-gates/src/vision_seat.rs: kept drops the v.seat.reserve.is_none() shortcut, and its doc comment says the rule holds for a tower off the plan too. A new test, an_off_plan_projector_stays_only_when_its_media_plan_is_free, puts the seat on a second card off the plan and checks four cases: a media plan that costs context drops the projector, a free one keeps it, and --mmproj or --image-max-tokens keeps it even when it costs context.
  • docs/serving.md: one sentence. The seats load the projector "only when the text model keeps the same card experts and context with the encoder as without it, also when the encoder sits on a card off the plan". The sentence said "with the encoder's reserve", which does not cover a tower off the plan.

Only the Qwen3 seat changes behavior. The V4.1 and GLM-5.3 seats build their cost from v.seat.reserve alone (serve_seats/ds41.rs:612, serve_seats/glm.rs:512). For a tower off the plan that is None, so both plans are the same and the projector stays, as before.

What I ran

All on an RTX 5090 machine.

  • FAIL-first: the new test on the base code (test-only commit 75b5cf48). bash tools/gate.sh --oxide -p bloomery-gpu-gates --features vision --release --lib -- vision_seat::tests ended test result: FAILED. 27 passed; 1 failed. The failure is the first assert, kept(off(), &flags(&[]).unwrap(), tables).unwrap().is_none(): the code without the fix keeps a projector whose media plan costs context.
  • The same command on the head f4ff0278: test result: ok. 28 passed; 0 failed, with the new test ok.
  • LC_ALL=C just contrib-check --tier t0 on the head: DONE tier=t0 total=94 red=0 wall=280s.

The head is one commit on main f9b38060. I did not build --features deepseek41 or glm5next, since kept keeps its signature and those callers do not change. I did not serve a seat with the tower on a real second card; that needs a two-card workstation.

What I ran into

None of this blocks the PR. With the shortcut gone, the V4.1 and GLM-5.3 seats now plan once more for a tower off the plan. Both plans come out the same and the projector stays, so the change for those seats is one more plan at start.

Hardware (if the change is for a machine)

Not a hardware change.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

@github-actions github-actions Bot added documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card labels Oct 19, 2026

@github-actions github-actions Bot 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.

Verdict: CLEAN: Off-plan projectors now pass through the shared cost comparison, and explicit image requests retain their override.

Checked

Duplicates: 1 new function checked with Grep; no duplicate. The existing test covers cost calculation and records; the new test covers projector retention. No dryer pairs were available.

Complexity: crapper flagged no functions. kept loses one condition; no complex function grows.

Silent failure: 2 planning-error paths followed. Text-only plan errors propagate; encoder-plan errors produce a named rejection record.

Tests: restoring reserve.is_none() at vision_seat.rs:557 fails the new test's first assertion. Always dropping fails its free-plan assertion; removing either explicit override fails its corresponding assertion. The PR reports FAIL-first and passing results; tests were not rerun here.

Gates: one regression test added; no existing gate, threshold, or pin changed.

Adversarial: traced reduced context, a refused encoder plan, explicit overrides, an absent encoder, and the GLM/V4.1 callers. No failure survived the guards.

Performance: startup planning only; no decode, prefill, or kernel work changes.

Escape catalog: no C1–C4 pattern matches.

Notes

dryer did not run. Diagnostics reports no changed Rust file under crates/, although the diff contains two.

GPU evidence is incomplete: the required nvidia-smi card/driver line and complete gate-recipe evidence are absent. A real two-card startup was not run, as the PR states.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/serve_seats/qwen3.rs, crates/gpu-gates/src/vision_seat.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

Not approved: a release freeze is on (#481), and a merge of a needs-gpu change now would change the tree under the release batch.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

… is free

vision_seat::kept returned an --hf projector whose tower sat on a card off the plan before it compared any plan, on
the reading that such a tower costs the text model nothing. A media load still takes stage-card bytes there: the
Qwen3 seat reserves every slot's rotation table whenever a projector is open. At a budget where the text plan fits
and the tables do not, keeping the projector lowered the context or refused a context that fit before. Every --hf
projector now goes through the same comparison of the seat's plan with and without it; --mmproj and a token limit
still keep it at any cost. The V4.1 and GLM seats' costs read only the stage reserve, so an off-plan tower still
comes out free there. The test drops an off-plan projector whose media plan costs context and keeps it when the
plan is free or the flags ask for images.
@juliankang4
juliankang4 force-pushed the fix-review-bot-issue-457-vision branch from 2d5e1ef to 60b7d65 Compare October 19, 2026 12:22

@github-actions github-actions Bot 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.

Verdict: CLEAN: The shared cost check now covers off-plan encoders and preserves explicit image requests.

Checked

Duplicates: 1 new test checked by Grep; no duplicate contract. The existing test covers cost calculation, while the new test covers encoder retention. No dryer pairs were supplied.
Complexity: crapper flagged no functions. kept loses one condition; the new test is linear.
Silent failure: 0 new fallback sites. Both planner-error paths were followed: text-plan errors propagate; media-plan errors produce a refusal record and text-only service.
Tests: static mutation check of crates/gpu-gates/src/vision_seat.rs:557: restoring the off-plan bypass fails the new first assertion. Removing either explicit-image override fails its assertion. Tests were not executed during this review.
Gates: no pins, thresholds or existing cases moved. The PR reports FAIL-first for the new test.
Adversarial checks: costly, free and refused media plans, absent encoders and explicit overrides are handled. All three callers use the shared owner; the existing record exposes the cost. Work added by this change runs at startup.
Escape catalog: C1–C4 do not match.

Notes

Dryer did not run; diagnostics report no changed Rust file under crates/, although the diff includes such files.
GPU evidence is incomplete: no nvidia-smi card/driver line. The reported test head f4ff0278 differs from the supplied head 60b7d65e.

Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/serve_seats/qwen3.rs, crates/gpu-gates/src/vision_seat.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit b5ddb22 into midagedev:main Oct 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vision: off-plan projector bypasses the sequence-table cost check

1 participant