WIP: [integration] RT-PALMETTO-PARITY: #984 story-load boot on current main, plus the pipeline-library translator fixes #1495

Closed
leonida/mandy
ubiquitarianism wants to merge 0 commits from integration/palmetto-parity into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

ubiquitarianism commented 2026-11-25 01:56:42 +00:00

Claimed in the coordination issue as: RT-PALMETTO-PARITY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148001600)

Depends on: #984, #674, #593, #583, #1281, #1317, #998

What this is

This is one branch that moves the retail boot forward on current main. It is the furthest-along boot integration open here (#984), merged onto main with its conflicts resolved, plus the open translator decode fixes that the title's pipeline-library compute programs need. Each merged PR keeps its own commits and author.

The claim also named a port of measurement notes and a boot-report tool. Those are left out: they do not move the boot.

1. #984 (RT-PROTON-STORY-LOAD, Moriz82), merged onto current main

#984 boots the package through:

  • the launch movie;
  • the first-run pages;
  • the landing prompt;
  • the story load, to its end.

It conflicted with main in 41 files, because main has since merged reviewed versions of many slots it carried (#391, #727, #383, #385, #377, #375). In each conflict I kept main's version and added only what #984 brings on top.

Decisions to check in review:

  • Slots and present routing in d3d12_xs_device.cpp, kept from main:

    • Slot 81 stays GetFrameStatisticsX with the presenter, and the presenter routing still runs before #984's built-in PresentX.
    • Slots 25, 26, 108 and 127 follow main.
    • Slot 127 gets #984's null-heap check, but not its tight-alignment flag.
    • Slots 61 and 74 keep main's check on who is calling.
    • Slot 73 answers the console list IID as ID3D12GraphicsCommandList, so #984's d3d12_xs_command_list_iid.h is dropped.
  • Taken from #984 in d3d12_xs_device.cpp: the console list proxy, queue layout detection, the slot 9 allocator callback, slots 55, 57, 70, 71, 86 and 133, Vulkan-backed CPU heaps and the frame token source.

  • d3d12_vulkan_device.cpp: #984's staged and deferred title images, inside main's create_image and its NVIDIA host-transfer retry.

  • file_system.cpp / dstorage.cpp: #984's kernel_writes reads, with main's touch_pages retry as the fallback.

  • rdna2_decode.py: main's version is kept, because #984's f32-only DPP block ran first and broke main's decode.

  • Hard-coded game addresses: three #984 code paths now read the location from an environment variable and are off when it is unset:

    • the hang-watchdog kick reads LEONIDA_TITLE_WATCHDOG_KICK;
    • the transient-pool dump reads LEONIDA_POOL_DIAG_AT;
    • the boot script reads LEONIDA_GAME_STATE_RVA and LEONIDA_SESSION_STATE_RVA.

    This changes #984's behaviour: on an unconfigured machine the title's hang watchdog stays armed.

  • Docs and scripts: executable addresses and offsets are removed from #984's doc and script text.

2. Translator fixes for the pipeline-library programs

Merged, each with its author kept: #674, #593, #583, #1281 (resolved against #583), #1317 and #998 (resolved against main, #583 and #593).

Not merged:

Where #984 and these PRs implement the same rule, one implementation is kept:

  • Skipped words: restore_vcc_tuples (#674) is the one restore pass, because it follows only reachable code and protects branch targets. #984's restore_skipped_instructions is removed. #984's two extra forms (DPP f32 compares, and the dot4 op_sel 2 / op_sel_hi 5 word) are accepted inside restore_vcc_tuples.
  • dot4 fields: a v_dot4_i32_i8 that llvm-mc prints with default op_sel now takes op_sel/op_sel_hi from the stored words, but only when those two fields are the whole difference. This replaces #984's single-case restore_dot4_inline_sel. It has a sentence in the design.md contract table and a hand-built test (test_dot4_printed_op_sel.py). The approach comes from luizwidmer/palmetto (GPL-3.0).
  • VCC in wave32: #984's wave64-only rule is kept for a VCC destination of s_bitreplicate_b64_b32 and for s_flbit_i32_b64 of a lane mask, because in wave32 vcc_hi holds data. #593's wave32 VCC test now expects a refusal.
  • Lane-mask source into scalar data (#998): the s_bitreplicate_b64_b32 rule now has a semantic test and a contract-table sentence. It is checked by the CPU interpreter only.
  • Changed tests: two cases in tests/test_rdna2spirv_decode.py used the dot4 word as their "undecodable" input. That word now decodes, so they use the same word with clamp set, which is still refused.

Not included, because they are claimed in #14

Each has a finding: there for its owner:

  • slot-57 record to graphics PSO (RT-SLOT57-NATIVE-GRAPHICS-PSO)
  • rebasing title VAs into the arena (RT-TITLE-RESERVATION-ARENA / RT-TITLE-HOST-REGION)
  • crash unwinding (RT-CRASH-STACK, #994)
  • the startup-trace additions (RT-STARTUP-TRACE)

Tested

Windows 11, VS 2026. There is no retail run with this branch, because no game package is on the test machine.

  • compileall and make_game.py --help pass.
  • Runtime build: builds clean. There is no Vulkan SDK on the machine, so it was configured with -DLEONIDA_VULKAN_HEADERS_FETCH=ON.
  • ctest: 305 passed, 2 failed, the rest skipped (game files, validation layers) or disabled. The failures are d3d12_texture_tiles and d3d12_clear, and both fail the same way on plain main. xmem_no_write_watch failed once under -j 8 in an earlier run, then passed when run alone and in a serial run.
  • Translator suite (run_semantic_tests.py): 486 files, 6,292 tests, 0 failed, in 423 s on 12 jobs.
  • Other tests: test_shader_library.py, test_fspx_unpack.py, test_shader_disasm.py and test_rdna2spirv_decode.py pass.
  • python -I scripts/check_no_game_data.py is clean on every file #984 adds.
  • Not measured: translated and spirv-val counts over the corpus, because there is no work folder on the test machine.
Claimed in the coordination issue as: RT-PALMETTO-PARITY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148001600) Depends on: #984, #674, #593, #583, #1281, #1317, #998 ## What this is This is one branch that moves the retail boot forward on current `main`. It is the furthest-along boot integration open here (#984), merged onto `main` with its conflicts resolved, plus the open translator decode fixes that the title's pipeline-library compute programs need. Each merged PR keeps its own commits and author. The claim also named a port of measurement notes and a boot-report tool. Those are left out: they do not move the boot. ### 1. #984 (RT-PROTON-STORY-LOAD, Moriz82), merged onto current `main` #984 boots the package through: - the launch movie; - the first-run pages; - the landing prompt; - the story load, to its end. It conflicted with `main` in 41 files, because `main` has since merged reviewed versions of many slots it carried (#391, #727, #383, #385, #377, #375). In each conflict I kept `main`'s version and added only what #984 brings on top. Decisions to check in review: - **Slots and present routing in `d3d12_xs_device.cpp`, kept from `main`:** - Slot 81 stays `GetFrameStatisticsX` with the presenter, and the presenter routing still runs before #984's built-in PresentX. - Slots 25, 26, 108 and 127 follow `main`. - Slot 127 gets #984's null-heap check, but not its tight-alignment flag. - Slots 61 and 74 keep `main`'s check on who is calling. - Slot 73 answers the console list IID as `ID3D12GraphicsCommandList`, so #984's `d3d12_xs_command_list_iid.h` is dropped. - **Taken from #984 in `d3d12_xs_device.cpp`:** the console list proxy, queue layout detection, the slot 9 allocator callback, slots 55, 57, 70, 71, 86 and 133, Vulkan-backed CPU heaps and the frame token source. - **`d3d12_vulkan_device.cpp`:** #984's staged and deferred title images, inside `main`'s `create_image` and its NVIDIA host-transfer retry. - **`file_system.cpp` / `dstorage.cpp`:** #984's `kernel_writes` reads, with `main`'s `touch_pages` retry as the fallback. - **`rdna2_decode.py`:** `main`'s version is kept, because #984's f32-only DPP block ran first and broke `main`'s decode. - **Hard-coded game addresses:** three #984 code paths now read the location from an environment variable and are off when it is unset: - the hang-watchdog kick reads `LEONIDA_TITLE_WATCHDOG_KICK`; - the transient-pool dump reads `LEONIDA_POOL_DIAG_AT`; - the boot script reads `LEONIDA_GAME_STATE_RVA` and `LEONIDA_SESSION_STATE_RVA`. **This changes #984's behaviour:** on an unconfigured machine the title's hang watchdog stays armed. - **Docs and scripts:** executable addresses and offsets are removed from #984's doc and script text. ### 2. Translator fixes for the pipeline-library programs Merged, each with its author kept: #674, #593, #583, #1281 (resolved against #583), #1317 and #998 (resolved against `main`, #583 and #593). Not merged: - #596: all of its commits are inside #674. - #281: it is the same fix as #1317. Where #984 and these PRs implement the same rule, one implementation is kept: - **Skipped words:** `restore_vcc_tuples` (#674) is the one restore pass, because it follows only reachable code and protects branch targets. #984's `restore_skipped_instructions` is removed. #984's two extra forms (DPP f32 compares, and the dot4 op_sel 2 / op_sel_hi 5 word) are accepted inside `restore_vcc_tuples`. - **dot4 fields:** a `v_dot4_i32_i8` that llvm-mc prints with default op_sel now takes op_sel/op_sel_hi from the stored words, but only when those two fields are the whole difference. This replaces #984's single-case `restore_dot4_inline_sel`. It has a sentence in the design.md contract table and a hand-built test (`test_dot4_printed_op_sel.py`). The approach comes from luizwidmer/palmetto (GPL-3.0). - **VCC in wave32:** #984's wave64-only rule is kept for a VCC destination of `s_bitreplicate_b64_b32` and for `s_flbit_i32_b64` of a lane mask, because in wave32 `vcc_hi` holds data. #593's wave32 VCC test now expects a refusal. - **Lane-mask source into scalar data (#998):** the `s_bitreplicate_b64_b32` rule now has a semantic test and a contract-table sentence. It is checked by the CPU interpreter only. - **Changed tests:** two cases in `tests/test_rdna2spirv_decode.py` used the dot4 word as their "undecodable" input. That word now decodes, so they use the same word with clamp set, which is still refused. ## Not included, because they are claimed in #14 Each has a `finding:` there for its owner: - slot-57 record to graphics PSO (RT-SLOT57-NATIVE-GRAPHICS-PSO) - rebasing title VAs into the arena (RT-TITLE-RESERVATION-ARENA / RT-TITLE-HOST-REGION) - crash unwinding (RT-CRASH-STACK, #994) - the startup-trace additions (RT-STARTUP-TRACE) ## Tested Windows 11, VS 2026. There is no retail run with this branch, because no game package is on the test machine. - `compileall` and `make_game.py --help` pass. - **Runtime build:** builds clean. There is no Vulkan SDK on the machine, so it was configured with `-DLEONIDA_VULKAN_HEADERS_FETCH=ON`. - **ctest:** 305 passed, 2 failed, the rest skipped (game files, validation layers) or disabled. The failures are `d3d12_texture_tiles` and `d3d12_clear`, and both fail the same way on plain `main`. `xmem_no_write_watch` failed once under `-j 8` in an earlier run, then passed when run alone and in a serial run. - **Translator suite** (`run_semantic_tests.py`): 486 files, 6,292 tests, 0 failed, in 423 s on 12 jobs. - **Other tests:** `test_shader_library.py`, `test_fspx_unpack.py`, `test_shader_disasm.py` and `test_rdna2spirv_decode.py` pass. - `python -I scripts/check_no_game_data.py` is clean on every file #984 adds. - **Not measured:** translated and `spirv-val` counts over the corpus, because there is no work folder on the test machine.
QemmHD commented 2026-11-25 03:21:23 +00:00

Real-data check on Windows 11 with an: main 3ff2a2adc translates the FidelityFX upscaler DLL's programs 27 of 29. Programs 03 and 18 are refused with "reachable instruction with normalized encoding". The same disassembly through this PR's tools/rdna2spirv.py gives 29 of 29 translated, all 29 passing spirv-val. So this fixes a real gap on main (#984's testers had 29/29 on their branch). Counts only.

AI-assisted (Claude Code, Claude Opus 5.5).

Real-data check on Windows 11 with an: main 3ff2a2adc translates the FidelityFX upscaler DLL's programs **27 of 29**. Programs 03 and 18 are refused with "reachable instruction with normalized encoding". The same disassembly through this PR's `tools/rdna2spirv.py` gives **29 of 29 translated, all 29 passing spirv-val**. So this fixes a real gap on main (#984's testers had 29/29 on their branch). Counts only. AI-assisted (Claude Code, Claude Opus 5.5).
akimfomin commented 2026-11-25 03:52:51 +00:00

For the #984 staged-image review, PortBridge transferred the dirty-region copy test from VIctory #1135 to Moriz82's warm staged-image case. On an RTX 4070 Ti SUPER, one Vulkan update with two regions submitted 128 KiB versus 1 MiB for a whole-texture update. Both initialized images matched all 1,048,576 bytes, with zero Khronos synchronization-validation errors in either worker.

Source, exact XG header pins and raw results. This is a standalone synthetic follow-up to the staged image path in #1495. A warm, private slot-70 image is the candidate for later integration. It needs a known prior layout and a confirmed authoritative snapshot, with whole uploads for first use or unclear write coverage. The 18-case CPU contract found the integration boundary: the current helper can fail after primary queue acceptance. Keep the image and staging until completion is known and preserve the dirty state until publication. The existing callback cannot report an incomplete publication to the caller. I have no boot or frame-time measurement. AI-assisted PortBridge verification (OpenAI Codex).

A follow-up source-extracted fake-driver test exercised the staging lifetime. If primary submission succeeds but its host wait returns an error while still pending, the pinned helper admits another mapped write and frees the old staging allocation on growth. A localized reference gate denies reuse until that exact timeline value completes. It tracks primary completion separately from visibility on other queues and adds no counter query to the ordinary successful path. Patch and fail-before/pass-after logs. These are simulated error paths. Real device loss and the destination image's own lifetime still need integration coverage.

For the #984 staged-image review, [PortBridge](https://github.com/akimfomin/PortBridge) transferred the dirty-region copy test from [VIctory #1135](https://github.com/Marvisak/VIctory/pull/1135) to Moriz82's warm staged-image case. On an RTX 4070 Ti SUPER, one Vulkan update with two regions submitted 128 KiB versus 1 MiB for a whole-texture update. Both initialized images matched all 1,048,576 bytes, with zero Khronos synchronization-validation errors in either worker. [Source, exact XG header pins and raw results](https://github.com/akimfomin/PortBridge/blob/c4dc7e8f8ae6b2652714c4d2f45182f524610db4/research/rendering-night/continued-regional-upload/README.md). This is a standalone synthetic follow-up to the staged image path in #1495. A warm, private slot-70 image is the candidate for later integration. It needs a known prior layout and a confirmed authoritative snapshot, with whole uploads for first use or unclear write coverage. The [18-case CPU contract](https://github.com/akimfomin/PortBridge/blob/ec0bb3f53f2373567ac6d7027b87e11dd857ec48/research/rendering-night/continued-upload-contract/README.md) found the integration boundary: the current helper can fail after primary queue acceptance. Keep the image and staging until completion is known and preserve the dirty state until publication. The existing callback cannot report an incomplete publication to the caller. I have no boot or frame-time measurement. AI-assisted PortBridge verification (OpenAI Codex). A follow-up source-extracted fake-driver test exercised the staging lifetime. If primary submission succeeds but its host wait returns an error while still pending, the pinned helper admits another mapped write and frees the old staging allocation on growth. A localized reference gate denies reuse until that exact timeline value completes. It tracks primary completion separately from visibility on other queues and adds no counter query to the ordinary successful path. [Patch and fail-before/pass-after logs](https://github.com/akimfomin/PortBridge/blob/36163aad4dcc320eb46910fc923e8492d127ac94/research/rendering-night/continued-upload-lifetime/README.md). These are simulated error paths. Real device loss and the destination image's own lifetime still need integration coverage.
QemmHD commented 2026-11-25 06:32:35 +00:00

Real-boot evidence that this PR is on the critical path (Windows 11, RTX 4070 SUPER, NVIDIA 621.24; main c7e82e26e + #1558 + LEONIDA_TITLE_WINDOWS_MB=1024 for #1537). On main, the two FSPX programs main can't translate show up as "no translated compute shader for FSPX kind-6 and kind-0" at world start, and about 219 s in the process dies on a null pointer inside the upscaler library. With those two programs present, taken from a translation made with this PR's tools (29/29), both log lines are gone and the null-pointer crash no longer happens; the boot goes on about 30 s further. That's one run each way with the same build and settings.

To be clear, this was a local experiment rather than a clean build of this PR: the two missing modules came from this PR's translator, while the other 27 came from main's (22 of the 27 common modules are byte-identical between the two translations, and 5 differ).

AI-assisted (Claude Code, Claude Opus 5.5).

Real-boot evidence that this PR is on the critical path (Windows 11, RTX 4070 SUPER, NVIDIA 621.24; main c7e82e26e + #1558 + `LEONIDA_TITLE_WINDOWS_MB=1024` for #1537). On main, the two FSPX programs main can't translate show up as "no translated compute shader for FSPX kind-6 and kind-0" at world start, and about 219 s in the process dies on a null pointer inside the upscaler library. With those two programs present, taken from a translation made with this PR's tools (29/29), both log lines are gone and the null-pointer crash no longer happens; the boot goes on about 30 s further. That's one run each way with the same build and settings. To be clear, this was a local experiment rather than a clean build of this PR: the two missing modules came from this PR's translator, while the other 27 came from main's (22 of the 27 common modules are byte-identical between the two translations, and 5 differ). AI-assisted (Claude Code, Claude Opus 5.5).
djrolfes commented 2026-11-25 07:00:15 +00:00

Independent corpus confirmation for the owned packed-dot fixes on Linux / llvm-mc 23.1.5 / SPIRV-Tools: main 42537e7b6 produces 27/29 FSPX modules (two refusals: reachable instruction with normalized encoding). In a separate local validation tree, applying #1317 (4e1ca11a6) and this PR’s d4b2afe0e stored-selector fix restores 29/29 translated modules; all 29 independently pass spirv-val --target-env vulkan1.3. No refusal was skipped and no stale modules copied into the output.

Integration-test caveat: #1317’s test_fspx_dot4_op_sel_disasm.py still expects Unsupported for decoded op_sel=0/op_sel_hi=5. That expectation conflicts with the deliberate stored-selector recovery here. Locally I retained every still-undecodable case and converted that one into a positive asymmetric-value control (recovered output 6 versus the adjacent default-selector output 5), rather than dropping coverage. The four focused files now pass 34 tests with real llvm-mc; full semantic validation is running.

The runtime test branch also includes the separately owned #1558, but it does not affect translation. Runtime assertion/watchdog bypasses remain off. No retail run with the fixed FSPX set yet; no world/frame claim. Raw corpus and diagnostics stay local. AI-assisted.

Independent corpus confirmation for the owned packed-dot fixes on Linux / llvm-mc 23.1.5 / SPIRV-Tools: main 42537e7b6 produces 27/29 FSPX modules (two refusals: reachable instruction with normalized encoding). In a separate local validation tree, applying #1317 (4e1ca11a6) and this PR’s d4b2afe0e stored-selector fix restores 29/29 translated modules; all 29 independently pass spirv-val --target-env vulkan1.3. No refusal was skipped and no stale modules copied into the output. Integration-test caveat: #1317’s test_fspx_dot4_op_sel_disasm.py still expects Unsupported for decoded op_sel=0/op_sel_hi=5. That expectation conflicts with the deliberate stored-selector recovery here. Locally I retained every still-undecodable case and converted that one into a positive asymmetric-value control (recovered output 6 versus the adjacent default-selector output 5), rather than dropping coverage. The four focused files now pass 34 tests with real llvm-mc; full semantic validation is running. The runtime test branch also includes the separately owned #1558, but it does not affect translation. Runtime assertion/watchdog bypasses remain off. No retail run with the fixed FSPX set yet; no world/frame claim. Raw corpus and diagnostics stay local. AI-assisted.
aslan2142 commented 2026-11-26 03:09:12 +00:00

Closing as superseded by #2138, merged as 0b11d86bc.

  • Included: its three commits (dot4 op_sel, bitreplicate, the vcc test).
  • Dropped on purpose: the general dot4 op_sel rule, because it also translated a form that was never measured (op_sel 0 / op_sel_hi 5). Only measured forms translate now; the design.md row says how each was confirmed.
  • Already on main: the older merge of #984 it carries.

AI-assisted (Claude Code, Claude Opus 5.5).

Closing as superseded by #2138, merged as `0b11d86bc`. - **Included:** its three commits (dot4 `op_sel`, `bitreplicate`, the vcc test). - **Dropped on purpose:** the general dot4 op_sel rule, because it also translated a form that was never measured (op_sel 0 / op_sel_hi 5). Only measured forms translate now; the `design.md` row says how each was confirmed. - **Already on `main`:** the older merge of #984 it carries. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No description provided.