Skip to content

Lanterns (2/n): stage 1, a title-shaped guest through gta6rt --run with FSSM shaders, depth/stencil solids and shared edges (TEST-1063) - #4863

Open
tedin7 wants to merge 14 commits into
ItsNotRexed:mainfrom
tedin7:lanterns-stage1
Open

tedin7 wants to merge 14 commits into
ItsNotRexed:mainfrom
tedin7:lanterns-stage1

Conversation

@tedin7

@tedin7 tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-1063, #4816 (comment) (the Lanterns proposal; this is piece 2)

Depends on: #4820 (fssm_pack.py). Its three commits appear here until it lands. This PR's commits are the last eight: the guest, the fixes from two reviews (runner, CMake dependencies, guest checks), the docs, the draw with the title's s8 table layout, then two more fixes from review (the shaders also depend on tools/*.json; the runner's wineserver stop is hard-bounded and it needs the subreaper on Linux).

Checked against #313: this stage only uses methods already on main (it passes on main as it is); it does not implement or duplicate a layer method.

What and why

Lanterns is a synthetic, title-shaped guest. It goes through the chain a title would, end to end:

  • Hand-written RDNA2 shaders are packed into FSSM programs inside the title's DXBC { DXIL { XDAT { XBCH + zlib(FSSM) } } } container.
  • fssm_unpack.py, shader_disasm.py and rdna2spirv.py translate them offline.
  • gta6rt --run maps the guest and answers d3d12_xs.dll!D3D12XboxCreateDevice with the Vulkan device.
  • The guest creates its PSOs from the containers through the D3D12 API, and the layer finds each shader by its FSSM hash.
  • The guest draws, reads back, and compares every pixel with a CPU reference.

The milestone gates in docs/d3d12_vulkan.md section 6 each check one capability from a host program: d3d12_draw_test (M1), d3d12_translated_draw_test (M1.5), d3d12_m2_textured_test, d3d12_m3_frame_test and d3d12_m4_compute_test. #1865 is the M5 gate. Lanterns runs them together in one guest, through the real container path and gta6rt --run. Later stages add compute queues, ExecuteIndirect, fp16 post-processing, BC textures and shadow maps. This PR is stage 1 only.

Stage 1: five DrawIndexedInstanced calls (prisms, cubes, octahedra, pyramids, a checker floor) into a 384x256 RGBA32F target with D32 depth.

  • Vertex, index and instance buffers sit in DEFAULT heaps, filled by CopyBufferRegion from an upload buffer.
  • The VS fetches through two V#s in two descriptor tables. Heap start handles come through slots 9 and 10.
  • The model matrix and tint come from 16 root constants, and the camera from a root CBV.
  • The floor PS reads its checker colours from its own FSSM program through the code base. Its two inputs carry slot bytes 6 and 3, so a reader that took the slot byte for the attribute number would get them wrong.
  • The octahedra are drawn with a wave64 VS/PS pair (; wave: 64), so the native wave64 graphics path runs too.
  • The vertex shader's container has two XDAT 0x0D payloads, as 195 of the title's containers do; the runtime must take the last.

The checks:

  1. Interior pixels must match the CPU reference bit for bit. All colours are short binary fractions, so the products are exact.
  2. Edge, depth-tie and checker-border pixels must be one of their candidate colours. The background is a candidate only where no surface certainly covers the pixel; near an edge two faces of one solid share, one of the two must show, so a crack there fails.
  3. Lookup control: the guest writes the VS's FSSM program into two containers with the same writer. The unmodified one must give a pipeline. The other has one byte of the program's name changed (vs_lanterns to vs_lanternS), so its hash is unknown, and it must be refused with E_INVALIDARG.
  4. Negative control: with the depth test off, exactly the certain pixels the reference predicts must change, and at least 1,000 of them.

run_lanterns.py passes a run only when three things hold: exit 0, the whole PASS line exactly once with numbers that fit together, and the shim's complete factory line D3D12XboxCreateDevice -> proxy 0x... (Vulkan device 0x...). Each run writes into a new folder under --out. With --wine it first stops the prefix's wineserver (-k, then -w, 10 s each): a launch under a new virtual X server while the last run's explorer.exe lives can hang in winevulkan's device creation. On timeout it kills everything the run started (on Linux also a process that left the session, as a child subreaper; if the kernel refuses the subreaper, the runner does not launch and exits 4), so a stalled guest, Wine or GPU fails with exit 3 instead of hanging; if something survives, or taskkill fails, the run fails with exit 4. The guest bounds each fence wait at 30 s.

The title's register layout (s8). The title's VS and PS read their first table pointer at s8 (docs/d3d12_vulkan.md 3.5). The layer packs root arguments from s0 in root-signature order, so a second draw uses a root signature that starts with eight 32-bit constants (s0..s7) and then a table (s[8:9]). Its wave64 VS and PS (vs_lanterns_edges, ps_lanterns_edges) read exactly that. The draw is a fan of eight triangles around one vertex with every vertex on a pixel centre, so 673 pixel centres lie exactly on a shared edge; each triangle has its own flat colour and additive blending counts the draws. The CPU applies D3D's top-left rule in exact integers, and every pixel must match: each shared-edge centre drawn once, by the triangle the rule names, no pixel twice, no gap.

Opt-in: -DLEONIDA_TEST_LANTERNS=ON, off by default. Default CI builds and runs no part of the GPU guest. The CPU test of the runner (tests/test_run_lanterns.py) does run, in the check job's stdlib loop. The shader rule depends on every tools/*.py and tools/*.json (the translator imports the scripts and reads gfx10_formats.json), so an incremental build cannot keep a stale spirv/index.json. Checked on the pod: before, touching tools/gfx10_formats.json left the shaders as they were (the index rule did not list it); after, the next build packs and translates again. The ctest lanterns_stage1 exists only in an opt-in native Windows build.

No port of #3913 needed. The guest links d3d12_xs_stub, the failing link-time stub already on main for tiny_frame (runtime/test/fixtures/d3d12_xs_stub.cpp, #3488). It is byte-for-byte the function #3913 carries. The include sits right after that target in runtime/CMakeLists.txt. Nothing else came from #3913's code. The factory-line guard in the runner is #3913's idea.

docs/lanterns.md says what it is, what stage 1 proves, the check line, both controls, how to build and run it (native Windows ctest, and Linux + Wine), and its limits. It is linked from docs/README.md, with a short paragraph after the milestone table in docs/d3d12_vulkan.md section 6.

Tested

RunPod, RTX 5080, Linux, Wine 11.0, clang-cl 21 + xwin cross-build (runtime/cmake/clang-cl-xwin.cmake), Vulkan SDK 1.4.363, -DLEONIDA_TEST_LANTERNS=ON, targets gta6rt lanterns.

  • run_lanterns.py --wine --stage 1: exit 0 in about 3 s:
    Lanterns stage 1: PASS, 97926 of 98304 pixels exact, 378 edge pixels plausible, depth-off control changed 11610 pixels; shared edges through a wave64 VS/PS with the title's s8 table: 98304 of 98304 pixels exact, 673 centres on shared edges each drawn once.
    • Depth on: 97,926 of 97,926 certain pixels exact, 378 of 378 uncertain pixels one of their candidates. 47 pixels lie on an edge two faces share.
    • Depth off: 97,889 of 97,889 and 415 of 415. The control changed 11,610 pixels, and the reference expects 11,610.
    • The unmodified container gave a pipeline; the renamed one was refused.
    • Edge fan: 98,304 of 98,304 pixels exact; 673 of 673 shared-edge centres drawn once by the triangle the top-left rule names; 0 pixels drawn twice, 0 gaps.
    • All 19 Wine runs of this series (stages 1, 3, 5, 6 and 8 on their trees, then the runner checks) ran back to back with no wineserver -k between them, only the runner's own stop. All passed.
  • Falsified, each reverted afterwards:
    • Floor checker colour red 0.4375 to 0.5: 77,496 of 97,926 certain pixels exact, first bad pixel (99, 106), exit 1.
    • A crack: every cube face pulled 0.16% (and 0.2%) towards its centre, under 1/32 pixel at the edges. Fails (377 and 376 of 378 uncertain pixels); with the background still a candidate there, as before, the same frames passed.
    • A runtime that refuses the guest-written container (DXBC size field 0): fails at the unmodified container's pipeline. The guest before this fix passed.
    • Stage 3 frame waiting for a fence value nobody signals (stage 3 PR; the wait helper is in this one): fails in 33 s with a fence stayed at 2 for 30000 ms, waiting for 3. Before, the run hung until the runner killed it at 120 s (exit 3).
    • The edge PS reading table slot 0 instead of slot 1: 31,884 of 98,304 pixels exact, fails. The reference with a bottom-right rule: 0 of 673 shared-edge centres right, 319 gaps, fails.
  • tests/test_run_lanterns.py (stdlib, about 12 s): a stalled launcher, its child and a grandchild that called setsid() are all killed, exit 3; each run gets its own folder; twelve incomplete or malformed transcripts are refused (among them PASS followed by other words, counts that do not add up, no depth-off change, one wrong edge-fan pixel, the line without its shared-edge part); the wineserver stop runs before the launch, and a hanging wineserver, or one that ignores SIGTERM and leaves a child, fails the run with exit 4 within its bound, with that child dead; with prctl refused, nothing is launched and the exit is 4. Against the runner before the last fix: 2 failures (the child survived; the launch went ahead). The new tests against the runner before the fixes: 5 failures (counted before the wineserver test was added).
  • Neighbours OK, from the branch head: test_fssm_pack, test_fssm_pack_chain (pytest, 6 passed), test_runtime_paths, test_ci_registration, test_docs_links, test_docs_repo_paths, test_docs_list_items, test_docs_table_rows, test_text_encoding, test_text_write_line_endings, all under -W error; compileall clean.

Not covered

  • Tested on one machine only: RTX 5080, Linux, Wine 11. No native Windows run yet, so the lanterns_stage1 ctest and the runner's taskkill path are untested. No AMD or Intel GPU yet.
  • The wineserver hang did not reproduce on this machine (back-to-back runs passed with the stop removed). The fix rests on another setup's report (20 of 20 hung without it, 20 of 20 passed with it) and on the runner test with a fake wineserver.
  • No validation claim. Vulkan validation layers under Wine on that pod are still being looked into, so we do not say the run is validation clean.
  • One frame drawn twice, offscreen. No present, no frame loop.
  • The FSSM programs are synthetic. They carry only the fields the tools read, and the code is ours.
  • The reference is computed on the CPU, not by another D3D12 implementation.

Credits

AI-assisted (Claude Code). No game files.

…ssembly

runtime/test/lanterns/fssm_pack.py assembles .asm with llvm-mc and packs the code
into an FSSM program in the layout docs/design.md and tools/fssm_header.py
describe (code section at 0xC0/0xC8 with the code 0x28 in, the wave flag at
0xD4, the code end at 0xE8, the 0x120/0x12C/0x130 directory, the PS input table
or the CS thread-group header at 0x138, the binding-table tail). It wraps the
program in the container the title ships (DXBC { DXIL { XDAT { 0x0D: XBCH +
zlib(FSSM) } } }, plus an ISG1 part when a pixel shader reads SV_Position).
With --translate it runs fssm_unpack.py, shader_disasm.py and rdna2spirv.py on
the folder, as make_game.py's shaders stage does, and fails unless every shader
comes back: same blob, decoded from the header with no invalid word, and a row
in spirv/index.json keyed by the packed program's SHA-256.

It is a test helper, so it does not live in tools/: make_game.py's
translator_digest() hashes every file there, and a new one would make a resumed
shaders stage throw away its finished shards.

tests/test_fssm_pack.py (standard library, the check job) reads the packed
fields back with fssm_header.py, the code range with shader_disasm.py and the
container with fssm_unpack.py, and checks the refusals. tests/test_fssm_pack_chain.py
(pytest, the translator-tests job, which has llvm-mc 21 and spirv-tools) runs
the whole offline chain on three small programs.

The runtime workflow's path filter gains tools/rdna2_decode.py and
tools/rdna2_isa_tables.py: shader_disasm.py imports them, and
tests/test_runtime_paths.py requires every tool a runtime/ script runs to be
listed there.
…2_isa_tables.py

runtime/test/lanterns/fssm_pack.py runs shader_disasm.py, which imports them,
and tests/test_runtime_paths.py requires every tool a runtime/ script reaches
to be in the runtime workflow's path filter.
…yloads

The packer wrote one narrow container layout: every PS input's slot byte
was position + 1, the tail had no binding records, and XDAT had one 0x0D
entry. A reader that took the slot byte for the attr number, or the first
of two payloads, would still pass on what it packed.

- "; input: ... slot=N" sets byte 6 of the record; the attr number stays
  the table position.
- "; binding: W0 W1 W2 W3 W4" adds a 20-byte record to the tail
  (fssm_header.binding_table reads them back in order).
- "; first-payload: NAME" puts a second program (the same code under
  NAME, so another hash) in a first 0x0D entry, as 195 of the title's
  containers have two. fssm_unpack.py and the runtime take the last.

Tests: the slot bytes, records and both payloads read back
(test_fssm_pack.py), and through the offline chain a PS with slot 9, a
binding record and a first payload is keyed by its own blob with its flat
input at position 0 (test_fssm_pack_chain.py; the old packer fails it).
Every output is named after its shader (<name>.dxbc, fssm/<name>.fssm,
disasm/<name>.s, the SPIR-V). Two inputs such as a/ps_tile.asm and
b/ps_Tile.asm, or a native variant named like its shader in another case,
wrote one file on a case-insensitive volume (Windows, macOS) while
index.json listed two rows, and the packer exited 0. The first row then
read the second shader's container.

pack_file() now only packs; main() compares all names after casefold()
and refuses a clash, naming both inputs, before it creates the output
folder or writes any file.
…gta6rt --run

Lanterns is an x64 guest that goes through the chain a title would: its
hand-written RDNA2 shaders are packed into FSSM programs inside DXBC/XDAT/XBCH
containers (runtime/test/lanterns/fssm_pack.py) and translated by
fssm_unpack.py, shader_disasm.py and rdna2spirv.py; gta6rt --run maps it and
answers d3d12_xs.dll!D3D12XboxCreateDevice with the Vulkan device; the guest
builds its pipelines from the containers through the D3D12 API. lanterns.cpp
is the guest's checks, lanterns_gpu.cpp/.h its D3D12 side and lanterns_d3d12.h
the shared helpers, the layout later stages extend.

Stage 1: five DrawIndexedInstanced calls (prisms, cubes, octahedra, pyramids,
a checker floor) into a 384x256 RGBA32F target with D32 depth. Vertex, index
and instance buffers sit in DEFAULT heaps, filled by upload copies; the VS
fetches through two V#s in two descriptor tables, the model matrix and tint
come from root constants, the camera from a root CBV, and the floor PS reads its
colours through the code base. Interior pixels must match the CPU reference
bit for bit; edge, depth-tie and checker-border pixels must be one of their
candidate colours. A container whose FSSM program the index does not know must
be refused, and with the depth test off exactly the pixels the reference
predicts must change.

run_lanterns.py passes a run only on exit 0, the PASS line once and the shim's
complete factory line, and kills the whole process group when its timeout
expires (tests/test_run_lanterns.py, with a launcher that never ends).

Opt-in with -DLEONIDA_TEST_LANTERNS=ON; nothing is built or run by default. The
guest links tiny_frame's failing d3d12_xs stub (test/fixtures, ItsNotRexed#3488) instead of
a copy. docs/lanterns.md says what it covers, how to run it and its limits.
…cleanup fails

- The PASS line must match its stage's full pattern, with numbers that fit
  together; "PASS" followed by anything else no longer passes.
- Each run writes into a new folder under --out, so an old run's dumps or
  pictures cannot stand in for a missing one.
- On Linux the runner becomes a child subreaper and also kills descendants
  that left the launcher's session. taskkill and killpg results are
  checked; anything left alive fails the run with exit code 4.
- With --wine it stops the prefix's wineserver (-k, then -w, 10 s each)
  before the launch: a launch under a new virtual X server while the last
  run's explorer.exe is alive can hang in winevulkan's device creation.
- The docstring's Windows path no longer has an invalid escape
  (SyntaxWarning, fatal under -W error).

tests/test_run_lanterns.py: a grandchild that calls setsid() must die too,
each run gets its own folder, three malformed PASS lines are refused, and
the wineserver stop runs before the launch (fake wineserver and wine on
PATH; a hanging wineserver fails the run within its timeout).
The translator imports many files in tools/ (fssm_header, shader_ir,
shader_meta, mc_command, rdna2_decode, ...). Listing four of them let an
incremental build keep a stale spirv/index.json. Depend on the whole
tools/*.py glob, the set make_game.py's translator_digest() hashes.
…d bounds its fence waits

- Lookup control: both vertex-shader containers come from the same writer.
  The unmodified one must give a pipeline; the second differs in one byte
  of the program's name, so its FSSM hash is unknown and the layer must
  refuse it. Before, the refused container differed in padding only.
- A wave64 VS/PS pair (vs_lanterns_w64, ps_lanterns_lit_w64, "; wave: 64")
  draws the octahedra, so the native wave64 graphics path is checked too.
- The floor PS's inputs carry slot bytes 6 and 3 (the attr number is the
  table position), and vs_lanterns.asm's container has a first 0x0D
  payload before the real one.
- Reference: near an edge two faces of one solid share, one of the two
  must cover the pixel; the background is no longer a candidate there, so
  a crack along the edge fails.
- Every fence wait is bounded (30 s) and fails with a line naming it.
The lookup control, the shared-edge rule, the runner's strict line, run
folders, cleanup exit code and wineserver stop, the failures each fix was
shown to catch, output under the build folder, and which CI jobs run the
CPU tests.
… the title's s8 table

The title's VS and PS read their first table pointer at s8
(docs/d3d12_vulkan.md 3.5). The layer packs root arguments from s0 in
root-signature order, so a second draw's root signature starts with eight
32-bit constants (s0..s7) and then a table of two buffer SRVs (s[8:9]).
vs_lanterns_edges and ps_lanterns_edges are wave64 and read exactly that:
constants from s0..s3, vertices through table slot 0, the PS's alpha
through slot 1.

The draw is a fan of eight triangles around one vertex, every vertex on a
pixel centre, inner edges horizontal, vertical and at 1:1, 1:2, 3:2 and
1:4, so 673 pixel centres lie exactly on a shared edge. Each triangle has
its own flat colour from its provoking vertex; additive blending counts
the draws. lanterns_edges.h applies D3D's top-left rule in exact integers.
Every pixel must match: each shared-edge centre drawn once by the triangle
the rule names, nothing drawn twice, no gaps. The PASS line and the
runner's pattern gain this part; the sheet gains the fan.

Mutations on the RTX 5080: the PS reading slot 0 instead of 1 leaves
31884 of 98304 exact; a bottom-right reference leaves 0 of 673 (319 gaps).
rdna2spirv.py and rdna2_decode.py read tools/gfx10_formats.json, so a
change to the format table left spirv/index.json and the SPIR-V stale.
The shader rule now depends on tools/*.json as well as tools/*.py.
- wineserver -k/-w run through Popen with their output discarded; on
  overrun the process group is SIGKILLed and reaped within 5 s, and the
  run fails naming what was left. Before, a child of a hung wineserver
  survived the run.
- On Linux the runner does not launch unless prctl(PR_SET_CHILD_SUBREAPER)
  succeeds (exit 4): without it an escaped grandchild cannot be found, and
  the runner would claim a full cleanup it cannot check.
- Windows: taskkill failing for a launcher that already exited (128) is no
  longer reported as a survivor.

Tests: a wineserver that ignores SIGTERM and leaves a child (the child
must be dead after the run), and prctl mocked to fail (no launch, exit 4).
Both fail on the runner before this commit.
@PingasMech

Copy link
Copy Markdown

Native Windows on Intel UHD 770 (driver 32.0.101.7088, MSVC 19.44, CMake/Ninja Release): stage 1's depth and depth-off draws passed, but the shared-edge draw left all 66,420 expected covered pixels empty. Both edge shaders still used wave64 and the table at s8 throughout the comparisons below.

The fix that passed here was to put the edge vertices and the pixel shader's alpha word in DEFAULT-heap buffers. I filled one UPLOAD staging buffer, copied both ranges with CopyBufferRegion, transitioned the destinations to NON_PIXEL_SHADER_RESOURCE and PIXEL_SHADER_RESOURCE respectively, and kept the staging buffer alive through the copy fence. The two existing buffer descriptors then point at the DEFAULT buffers. The main scene already uses this upload pattern. Edge allocations · Main scene copy

Shared-edge draw Exact pixels Correct shared-edge centres Gaps Result
Original fixture on the stack at 6836fe86 31,884 / 98,304 0 / 673 66,420 Fail
Staged buffers, repeated on this PR at 13175c91 98,304 / 98,304 673 / 673 0 Pass
Staged buffers, only the uploaded alpha changed from 1 to 0.5 31,884 / 98,304 0 / 673 0 Fail

The edge fixture source was identical on the two heads. With the fix, the registered lanterns_stage1 CTest passed on each. Disabling depth changed exactly the predicted 11,610 pixels.

Two other stages on the original #4873 stack passed on this Intel device. Stage 6 (#4869) put all 98,144 certain pixels within the BC1/BC7 bounds and the mip control changed all 10,221 predicted pixels. Stage 8 (#4871) matched all 95,699 single-colour pixels exactly and clearing the shadow map changed the predicted 9,539 pixels. Stages 3 and 5 stopped at creation of the second queue, before producing frames. This adapter exposes one graphics/compute queue and two video-decode queues. AI-assisted, synthetic fixtures only.

The shared-edge draw read its vertices and the pixel shader's alpha word
straight from UPLOAD-heap buffers. On native Windows with an Intel UHD 770,
PingasMech found every covered pixel empty (31,884 of 98,304 exact, 0 of
673 edge centres). Both buffers now live in DEFAULT heaps, filled from one
UPLOAD staging buffer by CopyBufferRegion and moved to
NON_PIXEL_SHADER_RESOURCE / PIXEL_SHADER_RESOURCE, with the staging buffer
kept alive until the copy's fence has passed, as the main scene's buffers
already are. This is the change PingasMech tested on that machine.
@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @PingasMech, adopted as you did it, in 89127f0f, which credits you. The edge vertices and the PS alpha word now live in DEFAULT-heap buffers filled through one UPLOAD staging buffer with CopyBufferRegion, transitioned to NON_PIXEL_SHADER_RESOURCE / PIXEL_SHADER_RESOURCE, and the staging buffer is kept until the copy fence.

On the RTX 5080: 98,304 of 98,304 exact and 673 of 673 shared-edge centres. Both mutations still fail: slot 0 gives 31,884 and 0/673, and the bottom-right rule gives 0/673 with 319 gaps. #4865, #4869 and #4871 are restacked on it.

What your two findings say about the layer:

  1. Shader reads from an UPLOAD buffer. These are legal in D3D12. They fail in the layer through a V#, which is the known gap in docs/d3d12_vulkan.md (D3D-53, around lines 1235-1251): UPLOAD/READBACK buffers sit outside the BDA arena, so their console VA can come out negative, and the 48-bit V# base turns it into a wild address. Whether it bites depends on where the driver places the buffer. On our RTX 5080 it happens to work. On your UHD 770 it did not. Root CBVs and 64-bit root arguments are not affected.
  2. The second queue on your adapter. It fails because the layer gives every live D3D12 queue its own VkQueue (D3D-97, D3D-97: give live D3D12 queues distinct Vulkan queues #1404), and that family exposes queueCount 1. So the second queue of any type returns E_OUTOFMEMORY. That is a layer gap, not Lanterns. I claimed the fix (share a VkQueue between D3D12 queues when none is free) and will ask you to try it on the UHD 770.

@ricardotanaka

ricardotanaka commented Nov 23, 2026 •

Copy link
Copy Markdown

Tested the current head 89127f0f merged onto main 3faac557, native Windows: AMD Radeon RX 7600 (RDNA3, AMD 26.11.2 proprietary driver, subgroup 32..64), Windows 11 26200, MSVC 19.44, CMake/Ninja RelWithDebInfo with -DLEONIDA_TEST_LANTERNS=ON, targets gta6rt lanterns: pass.

  • ctest -C RelWithDebInfo -R lanterns_stage1: 3 of 3 runs pass, each with the same line: Lanterns stage 1: PASS, 97926 of 98304 pixels exact, 378 edge pixels plausible, depth-off control changed 11610 pixels; shared edges through a wave64 VS/PS with the title's s8 table: 98304 of 98304 pixels exact, 673 centres on shared edges each drawn once.
  • For the Intel report above (and matching the RDNA2 iGPU result in Lanterns (6/n): stage 5, an fp16 render target with a two-pass compute bloom (TEST-1063) #4873): I also rebuilt the previous head 13175c91 (edge buffers still in the UPLOAD heap) the same way, and its shared-edge draw passes here too (2 of 2 runs, the same line). So on this AMD driver the old layout already worked; the empty edge draw looks specific to the Intel UHD 770 driver, and the DEFAULT-heap version keeps passing on AMD.

AI-assisted (Claude Code).

@CryingLaughing

Copy link
Copy Markdown
Contributor

Native Windows RTX 4080 comparison for Lanterns stage 1. Windows 11 build 26200, NVIDIA 621.01, MSVC 19.44 Release, Khronos validation 1.4.357 with synchronization validation enabled. Both guest revisions used the same gta6rt executable and seven byte-identical SPIR-V modules.

Edge input path Runs passed Shared-edge pixels Edge centres Gaps / double draws
13175c91, direct UPLOAD 3/3 98,304/98,304 673/673 0 / 0
89127f0f, staged to DEFAULT 3/3 98,304/98,304 673/673 0 / 0

All six runs also matched 97,926 exact scene pixels and 378 plausible edge pixels. The depth-off control changed 11,610 pixels each time. Every run used the Vulkan factory proxy and reported zero Vulkan validation diagnostics. The current revision also passed its registered lanterns_stage1 CTest.

The old path passed on this RTX 4080 with Resizable BAR and UPLOAD heaps in host-visible VRAM. This adds a native Windows NVIDIA result alongside the Intel and AMD comparisons. Synthetic inputs only. AI-assisted (Codex).

@memorypressure

Copy link
Copy Markdown

Verified head 89127f0 against main 3faac55 at check time: merges cleanly; all CPU-runnable tests pass (run_lanterns 5/5 including bounded wineserver-stop via shell stubs, fssm_pack 10/10, chain 6/6 under pytest), shaders are hand-written listings and the docs guards pass. The D3D12 GPU half (frame-exactness, shared-edge draws) is unverifiable on a CPU-only host. This is the base of a stack — #4865 sits directly on top of it (verified ancestry). No CI checks were scheduled on this branch. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 89127f0 on Windows Server 2022, CPython 3.13.12: pass

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@lunarminus

Copy link
Copy Markdown

Tested 8bf1fc69 merged onto main d0835dd9 on an AMD Radeon 760M (RDNA3 iGPU, gfx1103, subgroup 32..64), RADV Mesa 26.3.1, CachyOS Linux: pass for the CPU side and the GPU suite. The merge was a fast-forward: the head already contains main up to 561b65a8, and the Lanterns guest itself was not run (see the first bullet).

  • Lanterns guest not run. It was not built or run here, because the Wine route needs the clang-cl + xwin cross-build and there is no xwin splat on this machine. So this is not an AMD/RADV result for run_lanterns.py --wine --stage 1.
  • Same Lanterns code as earlier testers. git diff 89127f0f 8bf1fc69 -- runtime/test/lanterns tests/test_run_lanterns.py tests/test_fssm_pack*.py is empty.
  • pytest. pytest tests/test_fssm_pack.py tests/test_fssm_pack_chain.py tests/test_run_lanterns.py: 21 passed, 24 subtests passed. This uses llvm-mc 23 with the AMDGPU target.
  • Standard-library runs with python -I -W error:
    • test_fssm_pack 10 OK and test_run_lanterns 5 OK.
    • Neighbours all OK: test_runtime_paths, test_ci_registration, test_docs_links, test_docs_repo_paths, test_docs_list_items, test_docs_table_rows, test_text_encoding, test_text_write_line_endings.
    • test_fssm_pack_chain imports pytest, so its 6 tests are counted in the pytest run above.
    • compileall exit 0, and git diff --check is clean.
  • Shaders. fssm_pack.py --translate on the 7 Lanterns shaders exited 0 and translated all 7. The three wave64 pairs report subgroup size 64. spirv-val --target-env vulkan1.3 passed 11 of 11 modules (the 7 shaders and 4 stubs).
  • Runtime build. Linux, RelWithDebInfo, exit 0.
  • GPU suite. run_gpu_tests.py gave 216/232 passed, 16 skipped, 0 failed, both without LEONIDA_W64_EMULATE and with LEONIDA_W64_EMULATE=1.
  • Per-test comparison with d0835dd9 without the PR (baseline 196/210 passed, 14 skipped, in both modes):
    • Every test in both runs has the same PASS/SKIP status.
    • The 22 new lines (20 PASS; ps_live_width and ps_m2_literal SKIP) are fixtures from main d0835dd9..561b65a8, not from this PR. The PR adds no suite fixture.

AI-assisted (Claude Code).

@TG0000

TG0000 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 8bf1fc6 on AMD Radeon RX 6800 (RDNA2 gfx1030, AMD 26.11.2, Windows 11): pass (runner and CPU tests only, the Lanterns guest was not run)

I trial-merged it onto main 924b1465 (clean merge), reconfigured the build because runtime/CMakeLists.txt changed, and rebuilt. The Lanterns stage itself was not run: it needs the opt-in -DLEONIDA_TEST_LANTERNS=ON and the Windows gta6rt runtime, and this build has LEONIDA_BUILD_WINDOWS_RUNTIME=OFF.

python -I scripts/run_gpu_tests.py --build build --work <scratch> --llvm-mc <llvm-mc.exe>
python -m pytest -q tests/test_fssm_pack.py tests/test_fssm_pack_chain.py tests/test_run_lanterns.py
  • Reconfigure and build after the merge: ok, with no new build failures
  • compileall: ok
  • GPU suite: 221/239 passed, 17 skipped, 1 failed (ms_wave_info_s3, which also fails on main, see below)
  • test_fssm_pack.py: 10 passed, 9 subtests passed
  • test_fssm_pack_chain.py: 6 passed
  • test_run_lanterns.py: 1 passed, 12 subtests passed, 4 skipped (each reason: "the stalled launcher is a POSIX shell script")

Setup: Vulkan test targets built once from main 924b1465 with llvm-mingw 20261117 (clang++), Ninja, -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF. llvm-mc and spirv-val from MSYS2 ucrt64, Python 3.12.10. No Vulkan validation layer was loaded. Repo tests only, no game files.

Pre-existing on main, not from this PR: ms_wave_info_s3 fails on this card with at (0,0): got (-1.0000,-1.0000,-1.0000,-1.0000), want (0.0078,0.0078,0.5,1.0). It failed 3 out of 3 times on bare main 924b1465 (--filter ms_wave_info). host_adapter_test also does not compile on main with this toolchain (d3d12_com.h:395: unknown type name 'ID3D12GraphicsCommandList8'), and the GPU runner does not use it.

AI-assisted (Claude Code).

@rideinstead

Copy link
Copy Markdown

✅ Automated security review: CLEAN (commit 8bf1fc69)

  • No findings.

Scope: static analysis of added diff lines only; no code was executed. Please review findings manually.

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.

9 participants