Skip to content

lanes: draw through the second of two raster root tables - #208

Merged
brcly merged 1 commit into
brcly:mainfrom
postblink:test/lanes-raster-tables
Nov 26, 2026
Merged

brcly merged 1 commit into
brcly:mainfrom
postblink:test/lanes-raster-tables

Conversation

@postblink

Copy link
Copy Markdown
Contributor

Summary

This adds a raster-tables Lanes self-test scenario: the GPU coverage that #168 (reflected raster roots with several descriptor tables) left for a follow-up.

Two hand-written console programs (examples/lanes/raster_fixture.py) draw a fullscreen triangle through the Xbox stream pipeline. The pixel program loads one dword from slot 2 of the root's second descriptor table. Its FSSM records and PSV binding name that t3, space2, while the title's root declares t0 to t3 in space 1 for that table.

  • Only under the root the provider reflects from both programs does the draw write the expected value.
  • Under the title's root the pipeline becomes a stand-in and the target keeps its clear value.
  • A wrong table or slot reads a decoy whose value names its view, so a failure says which descriptor was read.

The reflected root is serialized while the game runs, so nothing can be prepared before launch. The lanes-raster-tables verify suite therefore runs the scenario with the host worker and TUXBOX_TRACE_RASTER_ROOTS=1. It requires:

  • the reflected trace and pipeline lines;
  • no stand-in;
  • no translation of either program without a root.

It removes only these programs' cache entries. Like xbox-shader, the scenario stays out of LANES_SCENARIOS.

The gate also matches the trace when Wine's +debugstr escapes its quotes ({\"reflected\": 1}). test_trace_escaped_by_debugstr_passes covers that, and fails without the fix.

The production xshader translates both programs against three roots: none, the title's, and the expected reflected root. DXC and DXV accept all six results. A dxbc test pins the binding the pixel program resolves to under the title's root.

Verified on Lanes

  • python tuxbox.py check passed on this branch
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below

GPU, driver and backend: NVIDIA GeForce RTX 5080 (10de:2c02), driver 620.73.04, and AMD Radeon 610M iGPU (1002:13c0, RADV, Mesa 26.3.1), GE-Proton11-14. CachyOS, Linux 7.3.6, Ryzen 7 9800X3D.

Summary printed at the end (python tuxbox.py check --adapter 10de:2c02, on this commit, on cb8c38b):

Summary
  passed   Build the shader compiler (0s)
  passed   Python tests (3s)
  passed   Shader compiler tests (7s)
  passed   DXBC tests (1s)
  passed   XG layout tests (1s)
  passed   D3D12 Windows typecheck (2s)
  passed   Build (23s)
  passed   Lanes and fixtures on the GPU (208s)
  passed   D3D12 regression controls (35s)
  passed   Shader translator on the GPU (109s)

All checks passed.

Checks

Python unit tests pass locally (359 tests). This change has no evidence JSON.

Add the `raster-tables` self-test scenario, the Lanes coverage brcly#168 left for
a follow-up. Two hand-written console programs (`raster_fixture.py`) draw a
fullscreen triangle through the Xbox stream pipeline. The pixel program loads
one dword from slot 2 of the root's second descriptor table, which its FSSM
records and PSV binding name `t3, space2`. The title's root declares `t0` to
`t3` in space 1 for that table, so the draw writes the expected value only
under the root the provider reflects from both programs. Under the title's
root the pipeline becomes a stand-in and the target keeps its clear value; a
wrong table or slot reads a decoy that names its view.

The reflected root is serialized while the game runs, so nothing can be
prepared before launch. The `lanes-raster-tables` verify suite runs the
scenario with the host worker and `TUXBOX_TRACE_RASTER_ROOTS=1`. It requires
the reflected trace and pipeline lines, no stand-in, and no translation of
either program without a root, and removes only these programs' cache
entries. Like `xbox-shader`, the scenario stays out of `LANES_SCENARIOS`.

The production xshader translates both programs against no root, the
title's root and the expected reflected root, and DXC and DXV accept all
six. A dxbc test pins the binding the pixel program resolves to under the
title's root.
@brcly

brcly commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Seem's useful, however, there are conflicts that need resolving

@postblink
postblink force-pushed the test/lanes-raster-tables branch from 90e906a to ff9d54c Compare November 26, 2026 02:28
@brcly
brcly merged commit bc4ba79 into brcly:main Nov 26, 2026
2 checks passed
@postblink

Copy link
Copy Markdown
Contributor Author

Rebased onto 4f7fa84 (now ff9d54c). The conflicts were with the new wave64-shader scenario, which sits in the same three places: examples/lanes/selftest.cpp, examples/lanes/README.md and project_tuxbox/verify.py. Both scenarios are kept.

Checks on the rebased branch, as CONTRIBUTING now asks for both vendors:

  • NVIDIA RTX 5080 (10de:2c02, driver 620.73.04): python tuxbox.py check --adapter 10de:2c02 passes every stage. lanes-raster-tables passes 3 of 3, and fails as intended with the multi-table arm of reflected disabled.
  • AMD Radeon 610M (1002:13c0, RADV, Mesa 26.3.1): lanes-raster-tables passes. The full check fails only the five guest-present* gates, which read the frame back from the desktop (screen colors on frame 1: 0xf5f5f5…). Plain main at 4f7fa84 fails the same five gates on this machine with the same receipts, 93 passed and 5 failed against this branch's 94 and 5, so that's a desktop-capture issue on this host rather than this change. This iGPU drives no display here; the monitors are on the NVIDIA card.

Both runs used Proton Experimental on CachyOS, Linux 7.3.6.

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