tombox-xshader tests: pin the refusal of GS emit and cut on streams 1-3 #232

Closed
github-bot wants to merge 1 commit from gh-pr/232/head into gh-pr/232/base
Owner

@⁠azerioxfr on GitHub · 2026-11-23 06:21 UTC · original
azerioxfr:xshader-pin-gs-stream-refusal → main · +26 −0 · 1 files · 1 commits · closed without merging

Library / area: tombox-xshader tests, geometry shader s_sendmsg (emit_sendmsg)

Exports changed (exports.txt rows): none

Source of the behaviour: your answer on #104: streams 1-3 only feed stream-out, and the D3D12 layer has no stream-out path, so the translator keeps the explicit error rather than dropping those emits. No translator change.

One topic, +25: one helper and one test in tests/synthetic.rs, next to geometry_adjacency_primitives_translate.

What was missing

That decision had no test. A later change could drop or remap stream 1-3 emits (the remap #104 first proposed, SV_RenderTargetArrayIndex, would be wrong), and no test would notice.

The test

geometry_emit_and_cut_on_streams_1_to_3_are_refused builds a geometry shader whose body is one s_sendmsg (message 2 = GS) and s_endpgm:

simm16 expected result
GS cut / emit / emit-cut (op 1, 2, 3) on stream 1, 2, 3 (9 cases) Err("GS output stream != 0 unsupported") 9 / 9
message 3 (GS_DONE) translates ok
guard in emit_sendmsg disabled (if false && stream != 0) test fails fails at the first case

cargo test --locked -p tombox-xshader --test synthetic geometry: 2 passed. I ran on x86_64-pc-windows-gnu, because this machine has no MSVC linker. The test does no floating-point maths.

  • cargo test -p tombox-xshader --test synthetic passes for the new test
  • No game or console files and no binaries included
  • No fake success; anything not possible is left missing with a note
**@⁠azerioxfr** on GitHub · 2026-11-23 06:21 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/232) `azerioxfr:xshader-pin-gs-stream-refusal` → `main` · +26 −0 · 1 files · 1 commits · closed without merging **Library / area:** tombox-xshader tests, geometry shader `s_sendmsg` (`emit_sendmsg`) **Exports changed (exports.txt rows):** none **Source of the behaviour:** your answer on #104: streams 1-3 only feed stream-out, and the D3D12 layer has no stream-out path, so the translator keeps the explicit error rather than dropping those emits. No translator change. One topic, +25: one helper and one test in `tests/synthetic.rs`, next to `geometry_adjacency_primitives_translate`. ### What was missing That decision had no test. A later change could drop or remap stream 1-3 emits (the remap #104 first proposed, `SV_RenderTargetArrayIndex`, would be wrong), and no test would notice. ### The test `geometry_emit_and_cut_on_streams_1_to_3_are_refused` builds a geometry shader whose body is one `s_sendmsg` (message 2 = GS) and `s_endpgm`: | simm16 | expected | result | |---|---|---| | GS cut / emit / emit-cut (op 1, 2, 3) on stream 1, 2, 3 (9 cases) | `Err("GS output stream != 0 unsupported")` | 9 / 9 | | message 3 (GS_DONE) | translates | ok | | guard in `emit_sendmsg` disabled (`if false && stream != 0`) | test fails | fails at the first case | `cargo test --locked -p tombox-xshader --test synthetic geometry`: 2 passed. I ran on `x86_64-pc-windows-gnu`, because this machine has no MSVC linker. The test does no floating-point maths. - [x] `cargo test -p tombox-xshader --test synthetic` passes for the new test - [x] No game or console files and no binaries included - [x] No fake success; anything not possible is left `missing` with a note
Issue #104 was answered with: streams 1-3 only feed stream-out, the
D3D12 layer has no stream-out path, so emit_sendmsg keeps the explicit
"GS output stream != 0 unsupported" error instead of dropping those
emits. Nothing tested that. geometry_emit_and_cut_on_streams_1_to_3_are_refused
sends s_sendmsg GS cut, emit and emit-cut on each of streams 1, 2 and 3
and checks for that error; GS_DONE still translates. With the guard
removed the test fails.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:14:59 +00:00
github-bot closed this pull request 2026-11-26 06:15:00 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-23 14:08 UTC · original

Applied locally on main with your authorship kept (cherry-picked, 6d86929); the tombox-xshader suite passes in a sandbox (exec 155/155 on WARP). It ships in the next release; this PR will be closed when that is pushed. Thanks.

**@⁠omonkeyz** on GitHub · 2026-11-23 14:08 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/232#issuecomment-7103538367) Applied locally on main with your authorship kept (cherry-picked, 6d86929); the tombox-xshader suite passes in a sandbox (exec 155/155 on WARP). It ships in the next release; this PR will be closed when that is pushed. Thanks.
Author
Owner

@⁠kiwe147 on GitHub · 2026-11-23 18:57 UTC · original

Tested head bdcae1f53b, applied with git apply (whitespace ignored, the line endings of my checkout differ) on main f89e410, together with #199, #229 (one tree; the PRs touch different files). It applied without conflicts and built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1.

run result
tombox-xshader lib + opcodes, synthetic, mesh, linkage, mixed_table, ps_linkage, centroid, gcn_dims, amp, xshader_cli, isa_sweep 206 passed, 0 failed
the tests the PRs of this tree add, in the exec suite on WARP 2 passed, 0 failed
the same tests with TOMBOX_EXEC_HW=1 (RTX 3080) 2 passed, 0 failed

No new failure against main f89e410 in any of these. This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

**@⁠kiwe147** on GitHub · 2026-11-23 18:57 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/232#issuecomment-7110886042) Tested head `bdcae1f53b`, applied with `git apply` (whitespace ignored, the line endings of my checkout differ) on `main` `f89e410`, together with #199, #229 (one tree; the PRs touch different files). It applied without conflicts and built. Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1. | run | result | |---|---| | `tombox-xshader` lib + `opcodes`, `synthetic`, `mesh`, `linkage`, `mixed_table`, `ps_linkage`, `centroid`, `gcn_dims`, `amp`, `xshader_cli`, `isa_sweep` | 206 passed, 0 failed | | the tests the PRs of this tree add, in the `exec` suite on WARP | 2 passed, 0 failed | | the same tests with `TOMBOX_EXEC_HW=1` (RTX 3080) | 2 passed, 0 failed | No new failure against `main` `f89e410` in any of these. This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code)
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:08 UTC · original

Applied on main in 6d86929 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:08 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/232#issuecomment-7163350122) Applied on main in 6d86929 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.