upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 18:10:07 +0100
committerVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 19:20:09 +0100
commit0d938dedd8dd8910a2d081dd90bc245d627fd65e (patch)
tree02b7c371c0ce77e8527e7c87198fcabdc81cef32 /docs
parentec8ec4c9a46c6623f1a9c125afd3566da97f1e0c (diff)
Docs: 51 of the BVH builder's 52 FSSM programs translate on main; one rule (buffer_store_short) left (PROC-120)
Recounted with main 49475796 on the 1.0.2.1 package (counts only): 52/52 unpack, 42 clean and 10 with invalid words in the disassembly, 51 translate and pass spirv-val. The four rules embedded_shaders.md listed are three since 427c1376 (#1968); Box16Rehydration stops at buffer_store_short (#1864). d3d12_vulkan.md and the docs index quoted 41/42 and four rules in seven places. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/README.md2
-rw-r--r--docs/d3d12_vulkan.md25
-rw-r--r--docs/embedded_shaders.md32
3 files changed, 32 insertions, 27 deletions
diff --git a/docs/README.md b/docs/README.md
index d771de0aa..4cfbdc867 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -70,7 +70,7 @@ method, scope and caveats. No game data is included.
70| [buffer_bounds.md](buffer_bounds.md) | V# `OOB_SELECT` bounds measured natively: RDNA2 (gfx1036) follows Mesa's GFX11 column (729/732 cases), not GFX10; raw mode also counts `soffset`. | 70| [buffer_bounds.md](buffer_bounds.md) | V# `OOB_SELECT` bounds measured natively: RDNA2 (gfx1036) follows Mesa's GFX11 column (729/732 cases), not GFX10; raw mode also counts `soffset`. |
71| [fssm_crosscheck.md](fssm_crosscheck.md) | FSSM/RDNA2 facts cross-checked against SCARAB; code starts at `code_off + 0x28`. | 71| [fssm_crosscheck.md](fssm_crosscheck.md) | FSSM/RDNA2 facts cross-checked against SCARAB; code starts at `code_off + 0x28`. |
72| [fspx.md](fspx.md) | `FSPX`, the FidelityFX DLL's native compute programs (its shaders' `ACCC` part): directory as the DLL reads it, kind-0 dispatch state, the hash prologue, `gfx1030` for its `v_dot4` code; 13 of 29 translate with `tools/fspx_unpack.py`. | 72| [fspx.md](fspx.md) | `FSPX`, the FidelityFX DLL's native compute programs (its shaders' `ACCC` part): directory as the DLL reads it, kind-0 dispatch state, the hash prologue, `gfx1030` for its `v_dot4` code; 13 of 29 translate with `tools/fspx_unpack.py`. |
73| [embedded_shaders.md](embedded_shaders.md) | DXBC containers embedded in the package's DLLs: 52 in `XboxBvhBuilder.dll` (console `FSSM` via the `XDAT`/`XBCH` record; 42/52 pass `spirv-val` today) and 29 `ACCC`/`FSPX` in the FidelityFX upscaler; the scan/extract tool and the four rules still missing. | 73| [embedded_shaders.md](embedded_shaders.md) | DXBC containers embedded in the package's DLLs: 52 in `XboxBvhBuilder.dll` (console `FSSM` via the `XDAT`/`XBCH` record; 51/52 pass `spirv-val` today) and 29 `ACCC`/`FSPX` in the FidelityFX upscaler; the scan/extract tool and the one rule still missing. |
74| [first_light.md](first_light.md) | The first draw of a real game model with its own translated VS/PS on a GPU: 4,213 vertices / 7,968 triangles, 78.1% coverage on an RTX 2060 SUPER; `tools/first_light.py`, the `vk_harness` mesh mode, and the same draw through the D3D12 layer (`d3d12_first_light`). | 74| [first_light.md](first_light.md) | The first draw of a real game model with its own translated VS/PS on a GPU: 4,213 vertices / 7,968 triangles, 78.1% coverage on an RTX 2060 SUPER; `tools/first_light.py`, the `vk_harness` mesh mode, and the same draw through the D3D12 layer (`d3d12_first_light`). |
75| [coder.md](coder.md) | The compressed mass in `story000_script.rpf`: entry framing (`align16(entry+8)` payload), the 32-value tag alphabet, deflate-shaped but proprietary, variable-length 7/8-bit LSB-first codes with no stored table, and the `n7 = 116..127` search that finishes it. | 75| [coder.md](coder.md) | The compressed mass in `story000_script.rpf`: entry framing (`align16(entry+8)` payload), the 32-value tag alphabet, deflate-shaped but proprietary, variable-length 7/8-bit LSB-first codes with no stored table, and the `n7 = 116..127` search that finishes it. |
76| [mission_logic.md](mission_logic.md) | Mission state tables: 0x20 record layout (band counter, byte offsets), the 64-byte pool element with world transforms, case-folding joaat keys, 53.5 % of states named, 113 state-set clusters covering 82.4 % of files. | 76| [mission_logic.md](mission_logic.md) | Mission state tables: 0x20 record layout (band counter, byte offsets), the 64-byte pool element with world transforms, case-folding joaat keys, 53.5 % of states named, 113 state-set clusters covering 82.4 % of files. |
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md
index c57a34280..fb0b2109e 100644
--- a/docs/d3d12_vulkan.md
+++ b/docs/d3d12_vulkan.md
@@ -2312,9 +2312,9 @@ own names use the `XDXR` prefix for Xbox's raytracing path:
2312 2312
2313**The builder's own shaders are console FSSM, not Xbox DXIL.** Each of the 52 containers carries an LLVM 2313**The builder's own shaders are console FSSM, not Xbox DXIL.** Each of the 52 containers carries an LLVM
2314bitcode blob and an `XDAT`/`XBCH` record; the PC experiment below compiled the bitcode, but the console runtime 2314bitcode blob and an `XDAT`/`XBCH` record; the PC experiment below compiled the bitcode, but the console runtime
2315executes the `XBCH` record. Measured from that record: 52/52 unpack to `FSSM`, 42 translate and all 42 pass 2315executes the `XBCH` record. Measured from that record: 52/52 unpack to `FSSM`, 51 translate and all 51 pass
2316`spirv-val` with the same translator the game's 26,503 shaders use; the 10 left need `global_atomic_fmax`/`fmin`, 2316`spirv-val` with the same translator the game's 26,503 shaders use; the one left, `Box16Rehydration`, needs
2317`buffer_load_ushort` and `tbuffer_load_format_x` with format 8 ([embedded_shaders.md](embedded_shaders.md)). The 2317`buffer_store_short` ([embedded_shaders.md](embedded_shaders.md)). The
2318raw 64-bit addresses are the corpus's existing raw-address path, not a separate lowering. Open: whether the game 2318raw 64-bit addresses are the corpus's existing raw-address path, not a separate lowering. Open: whether the game
2319uses the builder at all (RT-5) and whether the translated programs match a reference on a GPU. 2319uses the builder at all (RT-5) and whether the translated programs match a reference on a GPU.
2320 2320
@@ -2583,7 +2583,7 @@ M0–M2 do not need the executable.
2583| **M3** | Depth/stencil, multiple render targets, resource barriers, render passes, occlusion queries, fences, 2–3 frames in flight; run the game's first frames | Real frame structure and the first game code | The game reaches its first rendered frame (loading screen/menu or whatever the executable does) or stops on a single unsupported call with a clean report. **Synthetic part met** by `d3d12_m3_frame_test`: through the proxy, D3D12 API only, six frames through a ring of three slots (three frames in flight; each slot has its own allocator, list, targets, depth buffer, query and fence, and a frame waits with `SetEventOnCompletion` + an event for the fence its slot signalled three frames earlier before reading back and recording the slot again). Pass 1 draws three rectangles from root constants with translator-output shaders (`vs_m3.asm`, `ps_m3.asm`, hand-written RDNA2) through `OMSetRenderTargets` into two render targets (R8G8B8A8_UNORM and R32_FLOAT) and a `D24_UNORM_S8_UINT` depth/stencil buffer (the layer substitutes D32_SFLOAT_S8_UINT on the Radeon; the RTX has it natively): depth LESS with write, stencil REPLACE with references 1 and 2, then a draw with no depth test whose stencil test is EQUAL; the far rectangle runs inside `BeginQuery`/`EndQuery(OCCLUSION)` and `ResolveQueryData` writes its sample count to a readback buffer. Resource barriers move the first target RENDER_TARGET → PIXEL_SHADER_RESOURCE\|COPY_SOURCE and the second to COPY_SOURCE (and back at the next frame, from resources created in those states). Pass 2 samples the first target through an SRV in a descriptor table (the M2 path) with `ps_m3_post.asm` into a third target. Every pixel of all three targets (the float one bit for bit) matches the CPU reference with error 0 in each of the six frames, and the occlusion count equals the exact visible area of the far rectangle in each frame (3555 samples over the six frames); validation (with synchronization validation) clean on the AMD Radeon 880M and the RTX 5070 Laptop. @whattheflop's run on #1584 (GeForce RTX 3080 and a Ryzen 7 9800X3D Radeon iGPU) sampled the fences with nonblocking reads after each submit and saw 1, 2, 3, 1, 2, 3 slots still incomplete on NVIDIA and 1, 1, 1, 1, 1, 1 on AMD: up to three slots in flight on NVIDIA, one on AMD (sampled fence completion; GPU execution overlap was not measured). **Still open for M3:** render passes (`BeginRenderPass`, D3D-27) are not exercised, nor `BINARY_OCCLUSION`, occlusion during pipeline statistics (D3D-162), MSAA or depth/stencil copies and read-only DSV states in this test; the game's own first frames need the executable | 2583| **M3** | Depth/stencil, multiple render targets, resource barriers, render passes, occlusion queries, fences, 2–3 frames in flight; run the game's first frames | Real frame structure and the first game code | The game reaches its first rendered frame (loading screen/menu or whatever the executable does) or stops on a single unsupported call with a clean report. **Synthetic part met** by `d3d12_m3_frame_test`: through the proxy, D3D12 API only, six frames through a ring of three slots (three frames in flight; each slot has its own allocator, list, targets, depth buffer, query and fence, and a frame waits with `SetEventOnCompletion` + an event for the fence its slot signalled three frames earlier before reading back and recording the slot again). Pass 1 draws three rectangles from root constants with translator-output shaders (`vs_m3.asm`, `ps_m3.asm`, hand-written RDNA2) through `OMSetRenderTargets` into two render targets (R8G8B8A8_UNORM and R32_FLOAT) and a `D24_UNORM_S8_UINT` depth/stencil buffer (the layer substitutes D32_SFLOAT_S8_UINT on the Radeon; the RTX has it natively): depth LESS with write, stencil REPLACE with references 1 and 2, then a draw with no depth test whose stencil test is EQUAL; the far rectangle runs inside `BeginQuery`/`EndQuery(OCCLUSION)` and `ResolveQueryData` writes its sample count to a readback buffer. Resource barriers move the first target RENDER_TARGET → PIXEL_SHADER_RESOURCE\|COPY_SOURCE and the second to COPY_SOURCE (and back at the next frame, from resources created in those states). Pass 2 samples the first target through an SRV in a descriptor table (the M2 path) with `ps_m3_post.asm` into a third target. Every pixel of all three targets (the float one bit for bit) matches the CPU reference with error 0 in each of the six frames, and the occlusion count equals the exact visible area of the far rectangle in each frame (3555 samples over the six frames); validation (with synchronization validation) clean on the AMD Radeon 880M and the RTX 5070 Laptop. @whattheflop's run on #1584 (GeForce RTX 3080 and a Ryzen 7 9800X3D Radeon iGPU) sampled the fences with nonblocking reads after each submit and saw 1, 2, 3, 1, 2, 3 slots still incomplete on NVIDIA and 1, 1, 1, 1, 1, 1 on AMD: up to three slots in flight on NVIDIA, one on AMD (sampled fence completion; GPU execution overlap was not measured). **Still open for M3:** render passes (`BeginRenderPass`, D3D-27) are not exercised, nor `BINARY_OCCLUSION`, occlusion during pipeline statistics (D3D-162), MSAA or depth/stencil copies and read-only DSV states in this test; the game's own first frames need the executable |
2584| **M4** | Compute PSOs, UAVs, storage images, indirect dispatch, copy queues, async streaming | Asset loading and GPU compute | The world's streaming path runs without device loss; compute results match a CPU/reference check. **Synthetic part met** by `d3d12_m4_compute_test`: through the proxy, D3D12 API only, with translator-output compute shaders (`cs_m4_fill.asm` and `cs_m4_indirect.asm`, hand-written RDNA2). A COPY queue streams an input buffer in (`CopyBufferRegion` from an UPLOAD buffer into a DEFAULT buffer created in COMMON), `Signal`; a COMPUTE queue `Wait`s on it and runs one list: a compute root signature (four root constants and a descriptor table of five UAVs: a structured buffer, three raw buffers and an `R32_UINT` `RWTexture2D`), a compute PSO and `Dispatch` (256 threads) that fills the structured buffer and the image from the input and writes the arguments of the next dispatch into a raw buffer; barriers (the argument buffer to `INDIRECT_ARGUMENT`, UAV barriers on the buffer and the image); `ExecuteIndirect` with a dispatch command signature running a second PSO for the 3 groups the first dispatch asked for, which reads the buffer and the image back (`image_load`) and writes a raw output; then everything to COMMON and `Signal`. A COPY queue `Wait`s on that fence, copies the five results (the image through `CopyTextureRegion`) to a readback buffer, and the CPU waits with `SetEventOnCompletion`. Each D3D12 queue has its own `VkQueue` where the family has two (both test GPUs); all 1,924 result words match the CPU reference with error 0; validation (with synchronization validation) clean on the AMD Radeon 880M and the RTX 5070 Laptop. Layer gaps this test found, closed with it: buffer UAVs (structured and raw) were not written (`CreateUnorderedAccessView` stubbed them, now a V# in the slot); `ExecuteIndirect` of a dispatch ran whatever pipeline and root arguments the command buffer had bound instead of the list's (now recorded with the command, as `Dispatch` does); an image created in `UNORDERED_ACCESS` and first used by a shader was zero-filled by the first barrier or copy that named it, losing the shader's writes (now moved to GENERAL, zeroed, by the first submission after its UAV view is created that is not on a copy queue and dispatches or draws; every other queue's next submission waits for that one). **Still open for M4:** the storage-image initialization is tied to the first shader-running submission, not to the list that uses the image, so a list that only reaches an image through a barrier or copy before any dispatch or draw is submitted still zero-fills it first (as before), and an image used by a shader only on a queue that never runs one of its own dispatches or draws first relies on another queue's submission; buffer SRVs and CBVs as V#s (typed buffer UAVs and UAV counters are done: `d3d12_buffer_uav_test`, section 3.4 "Buffer UAVs"), a queue submitted before the queue whose fence it waits on, when a resource's layout is handed over between them (the layout tracker follows submission order, so the copy list was replayed against the layout from before the compute list ran and the run stopped on a validation error; d3d12_queue_wait_test covers Wait-before-Signal without a resource), `ExecuteIndirect` signatures that change root arguments or use count buffers for dispatches, and async streaming itself and the world's streaming path, which need the game | 2584| **M4** | Compute PSOs, UAVs, storage images, indirect dispatch, copy queues, async streaming | Asset loading and GPU compute | The world's streaming path runs without device loss; compute results match a CPU/reference check. **Synthetic part met** by `d3d12_m4_compute_test`: through the proxy, D3D12 API only, with translator-output compute shaders (`cs_m4_fill.asm` and `cs_m4_indirect.asm`, hand-written RDNA2). A COPY queue streams an input buffer in (`CopyBufferRegion` from an UPLOAD buffer into a DEFAULT buffer created in COMMON), `Signal`; a COMPUTE queue `Wait`s on it and runs one list: a compute root signature (four root constants and a descriptor table of five UAVs: a structured buffer, three raw buffers and an `R32_UINT` `RWTexture2D`), a compute PSO and `Dispatch` (256 threads) that fills the structured buffer and the image from the input and writes the arguments of the next dispatch into a raw buffer; barriers (the argument buffer to `INDIRECT_ARGUMENT`, UAV barriers on the buffer and the image); `ExecuteIndirect` with a dispatch command signature running a second PSO for the 3 groups the first dispatch asked for, which reads the buffer and the image back (`image_load`) and writes a raw output; then everything to COMMON and `Signal`. A COPY queue `Wait`s on that fence, copies the five results (the image through `CopyTextureRegion`) to a readback buffer, and the CPU waits with `SetEventOnCompletion`. Each D3D12 queue has its own `VkQueue` where the family has two (both test GPUs); all 1,924 result words match the CPU reference with error 0; validation (with synchronization validation) clean on the AMD Radeon 880M and the RTX 5070 Laptop. Layer gaps this test found, closed with it: buffer UAVs (structured and raw) were not written (`CreateUnorderedAccessView` stubbed them, now a V# in the slot); `ExecuteIndirect` of a dispatch ran whatever pipeline and root arguments the command buffer had bound instead of the list's (now recorded with the command, as `Dispatch` does); an image created in `UNORDERED_ACCESS` and first used by a shader was zero-filled by the first barrier or copy that named it, losing the shader's writes (now moved to GENERAL, zeroed, by the first submission after its UAV view is created that is not on a copy queue and dispatches or draws; every other queue's next submission waits for that one). **Still open for M4:** the storage-image initialization is tied to the first shader-running submission, not to the list that uses the image, so a list that only reaches an image through a barrier or copy before any dispatch or draw is submitted still zero-fills it first (as before), and an image used by a shader only on a queue that never runs one of its own dispatches or draws first relies on another queue's submission; buffer SRVs and CBVs as V#s (typed buffer UAVs and UAV counters are done: `d3d12_buffer_uav_test`, section 3.4 "Buffer UAVs"), a queue submitted before the queue whose fence it waits on, when a resource's layout is handed over between them (the layout tracker follows submission order, so the copy list was replayed against the layout from before the compute list ran and the run stopped on a validation error; d3d12_queue_wait_test covers Wait-before-Signal without a resource), `ExecuteIndirect` signatures that change root arguments or use count buffers for dispatches, and async streaming itself and the world's streaming path, which need the game |
2585| **M5** | Mesh shaders, `ExecuteIndirect`, bindless-table pressure, multi-threaded command lists, pipeline cache | World rendering | A stable open-world frame at any frame rate; then profile and optimise | 2585| **M5** | Mesh shaders, `ExecuteIndirect`, bindless-table pressure, multi-threaded command lists, pipeline cache | World rendering | A stable open-world frame at any frame rate; then profile and optimise |
2586| **M6** | Ray tracing/XDXR: standard AS builds or the shipped `XboxBvhBuilder` compute path; BVH node format; the builder's 52 console `FSSM` programs (42 pass `spirv-val`, four rules left: [embedded_shaders.md](embedded_shaders.md)) | RT shadows and any RT effects | RT output matches a reference; the builder's shaders run through the `FSSM` translator or a substitute; no unknown XDXR call remains | 2586| **M6** | Ray tracing/XDXR: standard AS builds or the shipped `XboxBvhBuilder` compute path; BVH node format; the builder's 52 console `FSSM` programs (51 pass `spirv-val`, one rule left: [embedded_shaders.md](embedded_shaders.md)) | RT shadows and any RT effects | RT output matches a reference; the builder's shaders run through the `FSSM` translator or a substitute; no unknown XDXR call remains |
2587| **M7** | HDR, VRS, `PresentX` planes (2-plane HDR + GameDVR compose, `ImmediateThresholdPercent`), resize, alt-tab, `SuspendX`/`ResumeX`, frame pacing and `GetFrameStatisticsX` | Presentation polish | HDR and resize work on the target display; no validation errors over a long run. **Partly met:** `ImmediateThresholdPercent` (late frame flipped at once through `VK_KHR/EXT_swapchain_maintenance1` IMMEDIATE/FIFO_RELAXED, section 4.5; checked on the fake-clock decision and on the Vulkan present mode, 0 VUIDs in our runs with `LEONIDA_VK_VALIDATION=1` on two GPUs, no tearing observed on a display; the console's real semantics are unmeasured). `SuspendX`/`ResumeX`, frame pacing and a minimal `GetFrameStatisticsX` exist; HDR, VRS, plane compose, alt-tab are open | 2587| **M7** | HDR, VRS, `PresentX` planes (2-plane HDR + GameDVR compose, `ImmediateThresholdPercent`), resize, alt-tab, `SuspendX`/`ResumeX`, frame pacing and `GetFrameStatisticsX` | Presentation polish | HDR and resize work on the target display; no validation errors over a long run. **Partly met:** `ImmediateThresholdPercent` (late frame flipped at once through `VK_KHR/EXT_swapchain_maintenance1` IMMEDIATE/FIFO_RELAXED, section 4.5; checked on the fake-clock decision and on the Vulkan present mode, 0 VUIDs in our runs with `LEONIDA_VK_VALIDATION=1` on two GPUs, no tearing observed on a display; the console's real semantics are unmeasured). `SuspendX`/`ResumeX`, frame pacing and a minimal `GetFrameStatisticsX` exist; HDR, VRS, plane compose, alt-tab are open |
2588 2588
2589**M3 occlusion portability (D3D-209).** Vulkan's [occlusion query specification](https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#queries-occlusion) 2589**M3 occlusion portability (D3D-209).** Vulkan's [occlusion query specification](https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#queries-occlusion)
@@ -2701,7 +2701,7 @@ folded into the table below with the measurement basis noted per row; nothing is
2701 Our earlier "forward the blob to the host" was too simple; the PC serializer rejects the Xbox bits. 2701 Our earlier "forward the blob to the host" was too simple; the PC serializer rejects the Xbox bits.
2702- **BVH builder.** Its console programs are `FSSM`; the bitcode in the same container is the representation the 2702- **BVH builder.** Its console programs are `FSSM`; the bitcode in the same container is the representation the
2703 PC compiler consumed. "Run the builder's dispatches" therefore takes the same FSSM → SPIR-V path as the game, 2703 PC compiler consumed. "Run the builder's dispatches" therefore takes the same FSSM → SPIR-V path as the game,
2704 with four rules still missing ([embedded_shaders.md](embedded_shaders.md)). 2704 with one rule still missing ([embedded_shaders.md](embedded_shaders.md)).
2705 2705
2706**Narrows.** 2706**Narrows.**
2707 2707
@@ -2721,11 +2721,10 @@ folded into the table below with the measurement basis noted per row; nothing is
2721The builder's 52 compute shaders are a second *corpus*, not a second shader front end. Each container carries an 2721The builder's 52 compute shaders are a second *corpus*, not a second shader front end. Each container carries an
2722LLVM bitcode blob and an `XDAT`/`XBCH` record; the bitcode is what the PC D3D12 compiler experiment consumed 2722LLVM bitcode blob and an `XDAT`/`XBCH` record; the bitcode is what the PC D3D12 compiler experiment consumed
2723(44 of 53 rejected, 22 lowered), while the console runtime executes the `XBCH` record. That record decompresses 2723(44 of 53 rejected, 22 lowered), while the console runtime executes the `XBCH` record. That record decompresses
2724to `FSSM`, the same container the game's own compute shaders use: 52/52 unpack, 42 translate and all 42 pass 2724to `FSSM`, the same container the game's own compute shaders use: 52/52 unpack, 51 translate and all 51 pass
2725`spirv-val` with `tools/rdna2spirv.py`. The 10 left stop at `global_atomic_fmax`/`fmin` (6 programs), 2725`spirv-val` with `tools/rdna2spirv.py`. The one left, `Box16Rehydration`, stops at `buffer_store_short`;
2726`buffer_load_ushort` (3) and `tbuffer_load_format_x` with format 8 (1); [embedded_shaders.md](embedded_shaders.md) 2726[embedded_shaders.md](embedded_shaders.md) lists the rules that closed the other nine. The raw 64-bit addresses are the translator's existing raw-address path, so no address-to-resource
2727lists them. The raw 64-bit addresses are the translator's existing raw-address path, so no address-to-resource 2727table is needed on top. A port that runs `XboxBvhBuilder` therefore needs the FSSM translator plus one rule,
2728table is needed on top. A port that runs `XboxBvhBuilder` therefore needs the FSSM translator plus four rules,
2729not a DXIL front end (a substitute builder remains the alternative). 2728not a DXIL front end (a substitute builder remains the alternative).
2730Correctness is still unverified on a GPU and the call sites need the executable (RT-5). 2729Correctness is still unverified on a GPU and the call sites need the executable (RT-5).
2731 2730
@@ -2807,8 +2806,8 @@ nothing is copied from their trees.
2807- **Xbox tiling/DCC.** Slot 76 and layout `0x101` are known, but the tiled data layout, detile path and DCC remain 2806- **Xbox tiling/DCC.** Slot 76 and layout `0x101` are known, but the tiled data layout, detile path and DCC remain
2808 unknown. If the game assumes console tiling or compression metadata, the layer needs a detile/repack step. 2807 unknown. If the game assumes console tiling or compression metadata, the layer needs a detile/repack step.
2809- **BVH builder shaders.** The container's DXIL bitcode is Xbox DXIL that PC drivers reject; its console `XBCH` 2808- **BVH builder shaders.** The container's DXIL bitcode is Xbox DXIL that PC drivers reject; its console `XBCH`
2810 record is `FSSM`, and 41 of the 52 programs already pass `spirv-val` through the same translator as the game 2809 record is `FSSM`, and 51 of the 52 programs already pass `spirv-val` through the same translator as the game
2811 ([embedded_shaders.md](embedded_shaders.md)). The 10 left need four small rules. Translation is not execution: 2810 ([embedded_shaders.md](embedded_shaders.md)). The one left needs `buffer_store_short`. Translation is not execution:
2812 there is no GPU reference for any of the 52 yet. 2811 there is no GPU reference for any of the 52 yet.
2813- **Ray tracing.** The game's RT work includes 64 compute shaders that traverse AMD-format BVH nodes, and it ships 2812- **Ray tracing.** The game's RT work includes 64 compute shaders that traverse AMD-format BVH nodes, and it ships
2814 a BVH builder; a standard D3D12 AS path may also exist. If it is used, the layer must build AMD-format nodes, not 2813 a BVH builder; a standard D3D12 AS path may also exist. If it is used, the layer must build AMD-format nodes, not
@@ -2949,7 +2948,7 @@ on a PC device behind the Xbox-ABI proxy). Measured:
2949 prints the reason with the adapter's PCI vendor id. WARP creates all 53 PSOs, and the constructor and destructor 2948 prints the reason with the adapter's PCI vendor id. WARP creates all 53 PSOs, and the constructor and destructor
2950 return. 2949 return.
2951 - **The runtime itself still shouldn't hand Xbox DXIL to a PC driver.** The same container carries the console 2950 - **The runtime itself still shouldn't hand Xbox DXIL to a PC driver.** The same container carries the console
2952 `XBCH` record, which decompresses to `FSSM`; 41 of the 52 programs translate and pass `spirv-val` today 2951 `XBCH` record, which decompresses to `FSSM`; 51 of the 52 programs translate and pass `spirv-val` today
2953 ([embedded_shaders.md](embedded_shaders.md)). Translating that record is the path that avoids a DXIL lowering 2952 ([embedded_shaders.md](embedded_shaders.md)). Translating that record is the path that avoids a DXIL lowering
2954 front end (section 7.2, M6); the bitcode is a second representation. 2953 front end (section 7.2, M6); the bitcode is a second representation.
2955 2954
diff --git a/docs/embedded_shaders.md b/docs/embedded_shaders.md
index cfd316094..62a488961 100644
--- a/docs/embedded_shaders.md
+++ b/docs/embedded_shaders.md
@@ -79,16 +79,21 @@ that expands to `FSSM` ([fssm_crosscheck.md](fssm_crosscheck.md)). On all 52 con
79|---|---| 79|---|---|
80| `tools/fssm_unpack.py` | **52/52** decompress to a valid `FSSM` blob (716 B to 101,320 B, median 2,200 B) | 80| `tools/fssm_unpack.py` | **52/52** decompress to a valid `FSSM` blob (716 B to 101,320 B, median 2,200 B) |
81| `tools/shader_disasm.py --mcpu gfx1013` | **52/52** disassemble; 42 with no invalid word, 10 with invalid words in the code | 81| `tools/shader_disasm.py --mcpu gfx1013` | **52/52** disassemble; 42 with no invalid word, 10 with invalid words in the code |
82| `tools/rdna2spirv.py` | **42** translate and pass `spirv-val` | 82| `tools/rdna2spirv.py` | **51** translate and pass `spirv-val` (`main` `49475796`) |
83 83
84The 10 untranslated programs stop at four rules: 84When this page was first written, 42 translated and 10 stopped at four rules. Three of those rules have landed since
85(`427c1376`, from #1968), and one program still waits on a fifth rule:
85 86
86| module(s) | blocker | 87| module(s) | blocker then | now |
87|---|---| 88|---|---|---|
88| `BuildKDOP`, `LoadInstances`, `ReloadProcedurals`, `LoadProceduralGeometry`, `LoadTriangles` | `global_atomic_fmax` | 89| `BuildKDOP`, `LoadInstances`, `ReloadProcedurals`, `LoadProceduralGeometry`, `LoadTriangles` | `global_atomic_fmax` | translate |
89| `PT_LoadInstances` | `global_atomic_fmin` | 90| `PT_LoadInstances` | `global_atomic_fmin` | translates |
90| `Box16Rehydration`, `Box32Rehydration`, `ReloadTriangles` | `buffer_load_ushort` | 91| `Box32Rehydration`, `ReloadTriangles` | `buffer_load_ushort` | translate |
91| `LeafRehydration` | `tbuffer_load_format_x GFX10_FORMAT_8_UINT` | 92| `LeafRehydration` | `tbuffer_load_format_x GFX10_FORMAT_8_UINT` | translates |
93| `Box16Rehydration` | `buffer_load_ushort` | stops at `buffer_store_short` (#1864, open) |
94
95The disassembly count is unchanged: the same 42 programs have no invalid word, and 10 have invalid words in the
96code. All 10 of those translate; `Box16Rehydration` is one of the 42 clean ones.
92 97
93Reproduction, after `--extract` above: 98Reproduction, after `--extract` above:
94 99
@@ -100,16 +105,17 @@ python -I tools/rdna2spirv.py <work>/embedded/dxbc/disasm --out <work>/embedded/
100 105
101## 5. What this changes 106## 5. What this changes
102 107
103* **The RT builder does not need a DXIL path for the console code.** Its programs are RDNA2 `FSSM`, and 41 of 108* **The RT builder does not need a DXIL path for the console code.** Its programs are RDNA2 `FSSM`, and 51 of
104 52 already pass `spirv-val` with the translator the project uses for the game's 26,503 shaders. The bitcode in 109 52 already pass `spirv-val` with the translator the project uses for the game's 26,503 shaders. The bitcode in
105 the same container is a second representation (the one the PC-compiler experiment measured); it is not what 110 the same container is a second representation (the one the PC-compiler experiment measured); it is not what
106 the console runtime executes. 111 the console runtime executes.
107* **The four missing rules are small and have real fixtures.** `global_atomic_fmax`/`fmin` cover 6 programs, 112* **The missing rules were small, and only one is left.** `global_atomic_fmax`/`fmin` (6 programs),
108 `buffer_load_ushort` 3 and `tbuffer_load_format_x` with format 8 one. They are ordinary translator rules, not 113 `buffer_load_ushort` (3) and `tbuffer_load_format_x` with format 8 (1) were ordinary translator rules, not a new
109 a new compiler backend. 114 compiler backend, and they are on `main`. The one left is `buffer_store_short`, for `Box16Rehydration`.
110* **The rehydration programs are the ones closest to the shipped data.** `Box16Rehydration`, 115* **The rehydration programs are the ones closest to the shipped data.** `Box16Rehydration`,
111 `Box32Rehydration` and `LeafRehydration` are exactly the programs that would turn the dehydrated BVH packs 116 `Box32Rehydration` and `LeafRehydration` are exactly the programs that would turn the dehydrated BVH packs
112 into runtime trees ([bvh.md](bvh.md) §3.1). Two of the four rules stand between them and translation. 117 into runtime trees ([bvh.md](bvh.md) §3.1). `Box32Rehydration` and `LeafRehydration` translate;
118 `Box16Rehydration` needs `buffer_store_short`.
113* **What is still open.** None of the 52 has been executed on a GPU; translation and `spirv-val` do not prove the 119* **What is still open.** None of the 52 has been executed on a GPU; translation and `spirv-val` do not prove the
114 output. Which of them the game actually creates is a call-site question (RT-5). The module-to-pipeline order 120 output. Which of them the game actually creates is a call-site question (RT-5). The module-to-pipeline order
115 above comes from `ILDN`, not from a runtime trace. The `STAT` bitcode and the `0x07 NOBC` record are not 121 above comes from `ILDN`, not from a runtime trace. The `STAT` bitcode and the `0x07 NOBC` record are not