dxbc: record console container fixtures for the shader reader #531

Merged
csj0oe merged 5 commits from upstream-pr/531 into main 2026-11-29 21:27:38 +00:00
csj0oe commented 2026-11-29 20:11:18 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-29T20:11:18Z.


What

The console container layout is pinned by tests: an outer DXBC directory with a DXIL part holding an XDAT program list, each program carrying a stage word and an FSSM instruction image padded to a 256-byte block.

  • runtime/dxbc/src/tests/console_container.rs builds the containers itself from our own bytes — directory, program header, XDAT, FSSM image and padding — and asserts what the reader reports: the program count, the stage number from the header word, the instruction span it wrote, the stripped end-of-program dwords, and the padding dword for the rest of the block.
  • A second case builds two containers with different counts, stages and entry names, so the reader is shown following each container's own bytes.
  • No compiled container is committed and no test reads a fixture file.

Verification

  • cargo test --target x86_64-unknown-linux-gnu -p tuxbox-dxbc --features native-bindings — 118 passed.
  • python tuxbox.py check --no-gpu — all steps pass.
<!-- greyfinch-sync:brcly/TuxBox:issue:5554642670 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/531). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-29T20:11:18Z. --- ## What The console container layout is pinned by tests: an outer DXBC directory with a `DXIL` part holding an XDAT program list, each program carrying a stage word and an FSSM instruction image padded to a 256-byte block. - `runtime/dxbc/src/tests/console_container.rs` builds the containers itself from our own bytes — directory, program header, XDAT, FSSM image and padding — and asserts what the reader reports: the program count, the stage number from the header word, the instruction span it wrote, the stripped end-of-program dwords, and the padding dword for the rest of the block. - A second case builds two containers with different counts, stages and entry names, so the reader is shown following each container's own bytes. - No compiled container is committed and no test reads a fixture file. ## Verification - `cargo test --target x86_64-unknown-linux-gnu -p tuxbox-dxbc --features native-bindings` — 118 passed. - `python tuxbox.py check --no-gpu` — all steps pass.
brcly commented 2026-11-29 20:37:57 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T20:37:57Z.


Thanks for the careful tooling. I can't take the committed fixtures, though: compute.dxbc, pixel.dxbc and the .code files are output of the console reference compiler, a licensed tool we don't redistribute output from. The same goes for the hardware code and stage names it reports.

The comparison tool itself is fine if it keeps everything on the contributor's machine: compile with the local reference, compare with our reader, report the differences, and commit nothing it produced. Could you rework it that way, with the Rust tests using only bytes we can share (ones we build ourselves, or synthetic containers)?

<!-- greyfinch-sync:brcly/TuxBox:comment:7262235169 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/531#issuecomment-7262235169). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T20:37:57Z. --- Thanks for the careful tooling. I can't take the committed fixtures, though: `compute.dxbc`, `pixel.dxbc` and the `.code` files are output of the console reference compiler, a licensed tool we don't redistribute output from. The same goes for the hardware code and stage names it reports. The comparison tool itself is fine if it keeps everything on the contributor's machine: compile with the local reference, compare with our reader, report the differences, and commit nothing it produced. Could you rework it that way, with the Rust tests using only bytes we can share (ones we build ourselves, or synthetic containers)?
brcly commented 2026-11-29 21:11:44 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T21:11:44Z.


Thanks, this addresses what I raised. We're putting it through the full check on both of our cards with your other ready PRs now, and will merge it if it passes.

<!-- greyfinch-sync:brcly/TuxBox:comment:7262680625 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/531#issuecomment-7262680625). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T21:11:44Z. --- Thanks, this addresses what I raised. We're putting it through the full check on both of our cards with your other ready PRs now, and will merge it if it passes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!531
No description provided.