Repository navigation
shader/opt: the visit-budget test uses 5 phi levels, where the budget decides (D3D12-SHADER-BOUNDED-BUDGET-TEST) - #2969
Conversation
… decides `bounded_budget_caps_wide_phi_dag` built 10 levels of a 4-way phi DAG. At 10 levels the depth limit answers None after 12 visits, before the 64-visit budget is reached, so the test also passed with the budget removed. Five levels needs 2,729 visits without it, so the test now fails if the budget is taken away: None with it, Some(0.0) without. AI-assisted.
KelboLive
left a comment
There was a problem hiding this comment.
Identical to #2959 (535c14094), which I reviewed: 5 phi levels cost exactly 2,729 visits, the 64 budget is the limiter at that depth, and the mutations agree (removing the budget or raising it to 2,729 fails). merge-tree is clean. Good to merge; only the optional low-side assertion (budgets 13–2,728 still pass) is open.
|
Thanks for the mutation check. The optional low-side assertion is real: the test pins the cap, not that a small tree still answers a bound. The 2-level diamond above it does return AI-assisted. |
VERIFY-2969 — Linux, Fedora 45, Rust 1.98.1 (the pinned toolchain), no GPU device, no game filesVerdict: PASS. A test-only change that makes an existing visit-budget test actually discriminate. I confirmed the Head 1. What it changesThe test // 5-level 4-way diamond DAG with distinct ops per edge: 2,729 visits
// without the budget, more than the 64 it allows, so the budget (not
// the depth limit, which 10 levels would hit first) caps it to None.
for _ in 0..5 {The call under test is unchanged: 2. The new test checks the property that mattersThe property is: the wide-DAG value is capped to I verified this empirically rather than by argument. I mutated
So the pull request's test notices a broken budget and the old one did not. That is exactly what a discriminating test 3. What the tests do here
I also ran the whole crate suite on the merge base and the head on clean target dirs:
Identical. (The count differs from red_green's 252 because red_green's target had the two 4. Any failure I saw, and why it is not this pull request
5. What I did not check
|
Re-created from the original #2959.
aznohonza/mandy-contribwas made private at 21:41 UTC on 2026-12-01, which detached the fork and permanently closed its pull requests; GitHub refuses to reopen them (422 state cannot be changed). Same branch, same head535c140949179bb31da20d0ecf45375fd3227ea7. The original review thread is at #2959.bounded_budget_caps_wide_phi_dagis named for the 64-visit budget inModule::bounded(), but it built 10 levels of a 4-way phi DAG. At 10 levels the depth limit answersNoneafter 12 visits, before the budget is reached: taking the budget away (let mut budget = u32::MAX) left the test passing, so it did not test what it says.Five levels needs 2,729 visits without the budget, so there the budget is what answers
None. The test now builds 5 levels, and its comment says why the depth limit no longer decides first.Verification (Linux, no GPU, no game files):
cargo test -p leonida-shader --features host: 250 passed, 2 ignored, 0 failed.let mut budget = u32::MAX, the 5-level test fails (assertion left == right failed: left: Some(0.0), right: None), while the same test at 10 levels still passes — the gap this closes.Test-only: no translator output, no switch, no game data.
Claimed in #2570 (
D3D12-SHADER-BOUNDED-BUDGET-TEST). AI-assisted.