Indirect args may be read early: 281k clamped-after-write hits a window, unverified #124
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory#124
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@TheRifai on GitHub · 2026-12-01 16:37 UTC · original
Finding (rules 12, 14, 29)
greenfield/vkback/src/lib.rs:3609countsExecuteIndirect clamped in its epoch's prologue after shader writes in that epoch (args may be read early)whenever a draw/dispatch wrote in the epoch before a later indirect op whose arguments the epoch prologue already clamped. The code calls it an upper bound — the writes may be to unrelated memory — but no task or issue owns the counter, and the volume is very high.Seen on: main
cab86d1, house save, scripted camera walk (VICTORY_KEYSW/I/K/J/L/O/P/Enter), 180 s, GE-Proton11-16 / RX 9070 XT. Run:/tmp/opencode/capture/explore/walk/runs/20261201-173035.vk.logstats lines: +281,018 in one window (cumulative 453,758), with 9 distinct sampled pipelines (top0x1c1d5430, kind Dispatch). The Series X console run shows the same kind; no validation error or rule-32 line accompanies it.The risk is concrete: if one of those shader writes really targets the indirect argument bytes, the clamp saw older values and the dispatch could use stale counts/offsets — a silent wrong draw, exactly the class of bug rule 32 is for.
VKB_CLAMP_VERIFY=1already exists (sync.rs::verify_clamp) to compare the record against a check run right before the op.Next
Run the house scene once with
VKB_CLAMP_VERIFY=1and count real differences (clampreport.rs) against the 281k upper bound. If none, turn the counter into a note with the reason and a TASKS row; if some, name the pipeline and find which shader writes the argument bytes. Evidence: verified difference count + the pipeline's shader family fromgpuprof/names.py, not a picture alone.@TheRifai on GitHub · 2026-12-01 16:42 UTC · original
Verified with the same camera walk and VKB_CLAMP_VERIFY=1 (main
cab86d1, GE-Proton11-16): the sync line reports 11,835,169 indirect clamps and 2,442,363 checked in line, and GPU clamp reports produced zero differences (no 'clamp report' line, no rule-32 in loud.txt). So the 281k/window upper bound did not translate into a wrong argument in this run. The counter is still unowned in TASKS and the check only covers one scene; leaving this open for a second scene or a different title, with the no-difference measurement as evidence. Run: /tmp/opencode/capture/verify-clamp2/runs/20261201-173946.@vktory6 on GitHub · 2026-12-01 16:44 UTC · original
Good catch that nobody had answered this in the house scene. It was checked in the prison: with
VKB_CLAMP_VERIFY=1, a 60 s prison run checked 102,170 at-risk dispatches in line, and 0 had changed arguments (docs/learnings/upstream-review-1129.md, "gpu-hints counts"). That's why the counter is an upper-bound note, not a loud error.The house walk hasn't been verified, though, and your numbers are higher there. Your proposed next step is exactly right: one house run with
VKB_CLAMP_VERIFY=1, thengrep 'arguments changed' vk.logand the sync line'schecked in linecount. If it's 0 again, post the counts here and I'll add them to the learning and close this. If there are any, the pipeline names are the lead. Leaving it open for that run.@vktory6 on GitHub · 2026-12-01 16:50 UTC · original
Thanks for running it. 2,442,363 dispatches checked in line, 0 changed, on top of the prison's 102,170 with 0 changed. That's two scenes, verified in line, with no difference, which is the evidence this counter needed. It's an upper-bound note by construction (any shader write in the epoch counts), and it doesn't stand for a known deviation, so I added your numbers to the learning that explains it (
github.com/vktory6/VKtory@491cd34) and I'm closing this. If aVKB_CLAMP_VERIFY=1run ever shows anarguments changedline, that's a loud error with the pipeline named; please open an issue then.