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

Closed
opened 2026-11-26 20:21:32 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1495
Author: @ubiquitarianism
Created: 11/25/2026
Status: ❌ Closed

Base: main ← Head: integration/palmetto-parity


📝 Commits (10+)

  • 4b9a891 fspx_unpack: code_range takes the 24-byte prologue of some pipeline-library programs
  • 1ea2ffb rdna2spirv: s_bitreplicate_b64_b32 into VCC, s_flbit_i32_b64 of a lane mask
  • ce98fbe fix: rdna2spirv decodes scalar, image and buffer tuples that run into vcc from the blob when llvm-mc rejects them
  • f7a338b rdna2spirv: clamp restore_vcc_tuples decode slice to code_end
  • f8d0c75 Merge remote-tracking branch 'origin/main' into HEAD
  • f605f8a rdna2spirv: put back the instructions llvm-mc's junk swallowed after a tuple into vcc
  • 6886740 test_vcc_tuple_fallback: cover where a resync starts and stops
  • ebcb0ac tools: decode the pipeline-library compute programs llvm-mc refuses
  • bf0c4d9 tests: fspx_unpack takes the decoder listing when llvm-mc reports invalid words
  • bec14f2 tools: the last pipeline-library compute programs of 1.0.2.1

📊 Changes

298 files changed (+37958 additions, -2463 deletions)

View changed files

📝 .gitignore (+4 -0)
📝 README.md (+1 -1)
📝 docs/README.md (+4 -0)
📝 docs/boot.md (+16 -0)
📝 docs/buffer_bounds.md (+4 -0)
📝 docs/cpu_features.md (+7 -0)
📝 docs/d3d12_command_objects.md (+11 -4)
📝 docs/d3d12_vulkan.md (+229 -14)
➕ docs/d3d12_xs_console_abi.md (+279 -0)
📝 docs/design.md (+42 -20)
📝 docs/directstorage.md (+75 -30)
📝 docs/embedded_shaders.md (+57 -8)
📝 docs/fspx.md (+83 -0)
➕ docs/linux_proton.md (+120 -0)
📝 docs/movies.md (+16 -15)
📝 docs/pipeline_check.md (+2 -0)
📝 docs/retail_boot_chain.md (+1 -1)
📝 docs/runtime_imports.md (+71 -21)
📝 docs/shader_library.md (+38 -4)
📝 docs/xdxr.md (+34 -0)

...and 80 more files

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1495 **Author:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Created:** 11/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `integration/palmetto-parity` --- ### 📝 Commits (10+) - [`4b9a891`](https://github.com/ubiquitarianism/leonida/commit/4b9a89124a470d266f0ed314db17a79fc45957be) fspx_unpack: code_range takes the 24-byte prologue of some pipeline-library programs - [`1ea2ffb`](https://github.com/ubiquitarianism/leonida/commit/1ea2ffbcadac0ea8cd58fe0794a513ff68661af4) rdna2spirv: s_bitreplicate_b64_b32 into VCC, s_flbit_i32_b64 of a lane mask - [`ce98fbe`](https://github.com/ubiquitarianism/leonida/commit/ce98fbefee2bee293e04835ed30183164be2fd31) fix: rdna2spirv decodes scalar, image and buffer tuples that run into vcc from the blob when llvm-mc rejects them - [`f7a338b`](https://github.com/ubiquitarianism/leonida/commit/f7a338b14d5b70b6d183be5f1e7427582d41e3b3) rdna2spirv: clamp restore_vcc_tuples decode slice to code_end - [`f8d0c75`](https://github.com/ubiquitarianism/leonida/commit/f8d0c75ad4e3add424d547e666fbf4c7694c2a22) Merge remote-tracking branch 'origin/main' into HEAD - [`f605f8a`](https://github.com/ubiquitarianism/leonida/commit/f605f8aee471020da29f9bf63df5036cd04ccd26) rdna2spirv: put back the instructions llvm-mc's junk swallowed after a tuple into vcc - [`6886740`](https://github.com/ubiquitarianism/leonida/commit/688674095cba178f3e0ae9d66710f364af4f5d50) test_vcc_tuple_fallback: cover where a resync starts and stops - [`ebcb0ac`](https://github.com/ubiquitarianism/leonida/commit/ebcb0acad599f0199b827a7ebc8008585aaa5dd6) tools: decode the pipeline-library compute programs llvm-mc refuses - [`bf0c4d9`](https://github.com/ubiquitarianism/leonida/commit/bf0c4d99ce4fca375a89538d200efdd7cb70f84d) tests: fspx_unpack takes the decoder listing when llvm-mc reports invalid words - [`bec14f2`](https://github.com/ubiquitarianism/leonida/commit/bec14f22599924c9d6d98b76714e00b6e0cc798a) tools: the last pipeline-library compute programs of 1.0.2.1 ### 📊 Changes **298 files changed** (+37958 additions, -2463 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+4 -0) 📝 `README.md` (+1 -1) 📝 `docs/README.md` (+4 -0) 📝 `docs/boot.md` (+16 -0) 📝 `docs/buffer_bounds.md` (+4 -0) 📝 `docs/cpu_features.md` (+7 -0) 📝 `docs/d3d12_command_objects.md` (+11 -4) 📝 `docs/d3d12_vulkan.md` (+229 -14) ➕ `docs/d3d12_xs_console_abi.md` (+279 -0) 📝 `docs/design.md` (+42 -20) 📝 `docs/directstorage.md` (+75 -30) 📝 `docs/embedded_shaders.md` (+57 -8) 📝 `docs/fspx.md` (+83 -0) ➕ `docs/linux_proton.md` (+120 -0) 📝 `docs/movies.md` (+16 -15) 📝 `docs/pipeline_check.md` (+2 -0) 📝 `docs/retail_boot_chain.md` (+1 -1) 📝 `docs/runtime_imports.md` (+71 -21) 📝 `docs/shader_library.md` (+38 -4) 📝 `docs/xdxr.md` (+34 -0) _...and 80 more files_ </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:21:32 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1524
No description provided.