Skip to content

Report compute thread-group dimensions in shader refusals and offline listings - #3506

Open
steven-seagull27 wants to merge 1 commit into
Marvisak:mainfrom
steven-seagull27:fix/3502-compute-group-diagnostics
Open

steven-seagull27 wants to merge 1 commit into
Marvisak:mainfrom
steven-seagull27:fix/3502-compute-group-diagnostics

Conversation

@steven-seagull27

Copy link
Copy Markdown

Addresses the missing per-program numthreads in item 4 of #3502. A total of 24 threads could mean [4, 2, 3] or [2, 4, 3]. The distinction matters when investigating which programs need 2-D thread-ID tiling.

The runtime adds the guest program’s declared [x, y, z] to its existing one-time compute translation warning, including when the refusal comes from the disk cache. victory translate --list prints those dimensions and the runtime’s 16-character container hash on each compute program’s outcome. This lets a reporter match the offline row to the warning. The default batch summary keeps its existing format.

Verification

Used generated shader containers on Windows. The refusal fixture declares [12, 2, 1] and contains an unsupported s_trap. Each runtime run issued two Dispatch(1, 1, 1) calls.

Adapter On main, fresh and warm caches With this patch, fresh and warm caches
NVIDIA GeForce RTX 5080 One refusal per run, no dimensions One refusal per run with numthreads=[12, 2, 1]
Microsoft WARP One refusal per run, no dimensions One refusal per run with numthreads=[12, 2, 1]

Both adapters still dropped the two dispatches as expected. The offline row and runtime warning agreed on hash=1292b6b95e562fcf. A refusal already cached by the parent build also gained the dimensions. A container whose first selected program was a vertex shader did not pick up a later compute program’s dimensions.

On eight generated program rows, the Windows SDK validator accepted five and the translator refused three. The two vertex rows retained their original output. Scanning two compute containers together or separately produced the same hash for each container. The new regression exercises both emission and refusal with trailing data after the DXBC record.

The CLI suite passed 19/19. Strict Clippy passed for the CLI and GPU crates. The full local GPU suite gave the same result on the parent and this branch — 229 passed, one ignored, and two descriptor-heap tests failed (dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views).

AI-assisted with Codex.

Include the native group size in the one-time translation refusal, including cache hits. Add the same dimensions and container hash to compute outcomes in translate --list so offline and runtime reports can be matched.

Cover an emitted and a refused ACCC program with different group shapes and trailing bytes after their DXBC records.

AI assistance: OpenAI Codex.
@neonbyte1

Copy link
Copy Markdown

Tested 329968e9 merged onto our test stack (main plus the unmerged PRs we need on NVIDIA under Wine, including the wave64 stack #2176 → #2711 → #2925 and #2999). One conflict in crates/victory-gpu/src/pipeline.rs, where our tree had split the same "first supported program" read into a helper; resolved by pointing both callers at your native_program(). Clippy --workspace --all-targets -D warnings, default and --all-features: clean.

Census, victory translate --list --host-lanes 32-32 over the full 1.0.2.1 shader pack (Linux, Wine, run on the CPU):

  • Totals unchanged against the same stack without this PR: 14,246 / 14,247 vertex and pixel, 2,657 / 2,682 compute, 8,765 / 8,765 mesh. Of the 25,897 rows both runs share, 0 differ in outcome.
  • Every compute row, emitted or refused, carries hash=<16 hex> numthreads=[x, y, z]: 2,682 rows, 2,682 distinct hashes. No other stage gets the fields, as described.
  • The hashes match the runtime's: all 50 programs refused in our game logs, and 34 hashes from another tester's logs, were found by hash.

What it answered for #3502 (item 4): of the 50 programs refused on our base, 25 have 2-D groups, all with an x that is not a multiple of 32 ([16, 16, 1] ×15, [8, 16, 1] ×6, [8, 8, 1] ×4). Pack-wide, 895 of 2,682 compute programs are multi-dimensional and 869 of those have x not a multiple of 32, which sizes the class #2126 is about.

Not covered here: the runtime warning's new field was compiled but not observed in a game run.

AI-assisted (Claude); measured on my machine, no game data shared.

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