Skip to content

Shaders: every loop-cap hit is counted and named like the superstep caps - #30

Merged
ThatRecompDev merged 2 commits into
ThatRecompDev:mainfrom
Sr-0w:diagnostics/guard-reports
Nov 25, 2026
Merged

ThatRecompDev merged 2 commits into
ThatRecompDev:mainfrom
Sr-0w:diagnostics/guard-reports

Conversation

@Sr-0w

@Sr-0w Sr-0w commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

The loop cap keeps the device alive when a loop runs on. A program that reaches it still produces wrong output, and until now nothing reported it unless --trace-pool-stores was on. A hit is a bug to fix at the wrong input or translation that caused it, so it should be visible on every run.

  • The loop guard calls the new loop_cap_hit. It keeps the trace and counts the hit once per wave in dword 3 of the program's slot in the window guard's cap table. That dword was unused until now.
  • The loader's cap report names each program with its waves past the loop cap, next to the threads past the superstep block cap and the groups past the round bound.

Tests:

  • On WARP, two nested loops of 1,000 iterations go past the compute cap and count in the program's slot. Bounds of 10 count nothing. This test fails without the count.
  • SuperstepCapTableTests reads the new dword.
  • Full suite green locally.

Docs: the "Loop guard" section of shader-translation.md.

🤖 Generated with Claude Code

Sr-0w and others added 2 commits November 25, 2026 14:27
The loop cap keeps the device alive when a loop runs on, but a program
that reaches it draws or computes the wrong thing, and nothing said so
unless --trace-pool-stores was on. A hit is a bug to fix where the wrong
input or translation comes from, so it has to be seen on every run.

The loop guard now calls loop_cap_hit, which keeps the trace and counts
the hit once per wave in dword 3 of the program's slot of the window
guard's cap table (unused until now). The loader's cap report names the
programs with their waves past the loop cap beside the threads past the
superstep block cap and the groups past the round bound.

Tests: on WARP, two nested loops of 1,000 iterations (past the compute
cap of 65,536) count in the program's slot and bounds of 10 count
nothing; the test fails without the count. The loader reads the new
dword and reports only what grew.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ThatRecompDev
ThatRecompDev merged commit 79ad433 into ThatRecompDev:main Nov 25, 2026
2 checks passed
@ThatRecompDev

Copy link
Copy Markdown
Owner

nice, every loop-cap hit visible on every run is exactly what we want after today's runaway loops. merged. heads up: main also got a report of the cap table on every 30 s thread sample (not just captured presents), so I merged your loop column into that, worth a look if you touch WindowGuard again.

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.

2 participants