Skip to content

Fix constant-buffer metadata in the pool reflection test - #2256

Closed
akratch wants to merge 1 commit into
seedds:mainfrom
akratch:contrib/pool-reflection-fixture-20261110
Closed

akratch wants to merge 1 commit into
seedds:mainfrom
akratch:contrib/pool-reflection-fixture-20261110

Conversation

@akratch

@akratch akratch commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

What and why

The pool-reflection fixture declares fp_c5 but supplies no cbufs metadata. On current main this raises KeyError: 'cbufs' before the existing pool/image assertions run. Supply a synthetic slot-5 constant buffer with a 64-byte fixed bound, and verify its reflected kind, register and bound alongside the existing assertions.

Only the test input and assertions change. Translator code, shader chain and runtime behavior are unchanged.

Checked

  • Exact base: ced3612134b9e16b20a866bde990a1092fee7360; unmodified pool-array suite runs 8 tests with this one error.
  • Fixed pool-array suite: 8 tests pass.
  • Complete dm/tools/tests: 1,441 tests pass, including 27 skips.
  • Full Python ratchet remains failed on the inherited unused dmsh_fetch import at dm/gfx/tools/dmsh_entry.py:7 (324 findings versus 323 baseline). The changed test has no new finding; the translator import and baseline are untouched. This is not a claim that global lint or CI is green.
  • Apple M4 Max, macOS 27.2, Python 3.13. No game runs are needed for this synthetic test-only change; no game behavior or performance claim.

Docs

This restores the existing fixture to the reflection resource contract; no player-facing behavior or reference entry changes. No game files, keys or extracted data are included. Front ends require no action.

The synthetic MSL declares fp_c5, but its reflection input supplied only storage buffers. Reflection now reads constant-buffer metadata, so this case raised KeyError before reaching the pool and image assertions. Supply slot 5 with a fixed 64-byte bound and assert the resulting kind, register and bound while retaining the existing pool assertions.

All eight pool-array tests pass; unmodified ced3612 fails this case. No translator code, shader chain or runtime behavior changes.

Front-ends: no action required.

Co-authored-by: Adam Kratch <70729875+akratch@users.noreply.github.com>
@github-actions github-actions Bot added the tools Tools and scripts (dm/tools, scripts) label Nov 10, 2026
seedds added a commit that referenced this pull request Nov 11, 2026
…45694b made reflect() read res['cbufs'] for each game uniform slot, which the translator's report always carries, and the suite's three calls still passed only sbufs, so test_pools_and_attributes raised KeyError: 'cbufs' on main (8 tests, 1 error). The calls now pass cbufs, and the first gives slot 5 a fixed extent of 64 bytes and checks that fp_c5 reflects as KIND_CBUF, reg 2, fixed 64, which no test covered. Tests only: no chain tool changes. 8 of 8 pass (PR #2248, PR #2256)

Co-authored-by: Pedro Nascimento <91118+lunks@users.noreply.github.com>
Co-authored-by: akratch <70729875+akratch@users.noreply.github.com>
@seedds

seedds commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Landed on main as c823c3c, together with #2248, which fixed the same error and covered all three reflect() calls. Your slot-5 entry and its assertion on the reflected kind, register and fixed bytes are in that commit, and you are credited as co-author. Thank you.

@seedds seedds closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants