leonida-gpu: read the pipeline stream of the title unaligned (D3D12-GPU-PIPELINE-BYTECODE-ALIGNMENT) #2632

Manually merged
github merged 4 commits from github-bot/gh-2632 into gh-pr/2632/base 2026-11-30 16:05:11 +00:00 AGit
Owner

@⁠imShangLi on GitHub · 2026-11-29 20:04 UTC · original
imShangLi:fix/d3d12-gpu-pipeline-bytecode-alignment → main · +77 −5 · 1 files · 4 commits · merged 2026-11-30 15:59 UTC

Claimed in the coordination issue as: D3D12-GPU-PIPELINE-BYTECODE-ALIGNMENT

Depends on: #2569 (same file and test module; the current diff applies cleanly, but the branches may overlap if #2569 lands first)

Fixes: none

What and why

create_stream reads the title-owned StreamDesc and each shader Bytecode through aligned Rust references. The title chooses these buffer addresses and need not align them. Read both with read_unaligned() and add an odd-address stream regression test.

Tested

Prior measured branch result on Windows 11 / Rust 1.98.1, base cc0f662a70b6e6e561692f56342b5a7df3831bd7:

  • New test a_stream_at_an_odd_address_yields_its_shaders aborts on pristine main at pipeline.rs:1185 with a misaligned pointer dereference and passes with the change.
  • cargo test --package leonida-gpu --lib --locked --offline: pristine 536 passed; 1 failed; 47 ignored; patched 537 passed; 1 failed; 47 ignored.
  • The remaining descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in failure is also red on pristine main on the AMD Radeon 780M host.
  • Clippy findings were identical before and after, with none in pipeline.rs.
  • Current branch has latest main merged and still changes only d3d12/crates/leonida-gpu/src/pipeline.rs (+77/-5).

GPUs tested: AMD Radeon 780M for the prior host test run; no game files or GPU workload used by the new regression.

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly
  • One topic
  • No game data, keys or decryption
  • No new translator rule

Independent verification

  • Native Windows 11 Pro + AMD Radeon RX 7900 XTX (driver 32.0.32029.2010), Rust 1.98.
  • Fast-forward cleanly onto current main; zero conflicts.
  • cargo test -p leonida-gpu --lib -- --test-threads=4: 550 passed; 0 failed; 47 ignored.
  • python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline.rs: PASS.
  • Current CI: translator/viewer/no-game-data/change-scope pass; the remaining semantic failure is the upstream baseline test_interp_computed_ij_fallback.
**@⁠imShangLi** on GitHub · 2026-11-29 20:04 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2632) `imShangLi:fix/d3d12-gpu-pipeline-bytecode-alignment` → `main` · +77 −5 · 1 files · 4 commits · merged 2026-11-30 15:59 UTC Claimed in the coordination issue as: `D3D12-GPU-PIPELINE-BYTECODE-ALIGNMENT` Depends on: #2569 (same file and test module; the current diff applies cleanly, but the branches may overlap if #2569 lands first) Fixes: none ### What and why `create_stream` reads the title-owned `StreamDesc` and each shader `Bytecode` through aligned Rust references. The title chooses these buffer addresses and need not align them. Read both with `read_unaligned()` and add an odd-address stream regression test. ### Tested Prior measured branch result on Windows 11 / Rust 1.98.1, base `cc0f662a70b6e6e561692f56342b5a7df3831bd7`: - New test `a_stream_at_an_odd_address_yields_its_shaders` aborts on pristine `main` at `pipeline.rs:1185` with a misaligned pointer dereference and passes with the change. - `cargo test --package leonida-gpu --lib --locked --offline`: pristine `536 passed; 1 failed; 47 ignored`; patched `537 passed; 1 failed; 47 ignored`. - The remaining `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` failure is also red on pristine `main` on the AMD Radeon 780M host. - Clippy findings were identical before and after, with none in `pipeline.rs`. - Current branch has latest `main` merged and still changes only `d3d12/crates/leonida-gpu/src/pipeline.rs` (`+77/-5`). GPUs tested: AMD Radeon 780M for the prior host test run; no game files or GPU workload used by the new regression. AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly - [x] One topic - [x] No game data, keys or decryption - [x] No new translator rule ### Independent verification - Native Windows 11 Pro + AMD Radeon RX 7900 XTX (driver 32.0.32029.2010), Rust 1.98. - Fast-forward cleanly onto current `main`; zero conflicts. - `cargo test -p leonida-gpu --lib -- --test-threads=4`: **550 passed; 0 failed; 47 ignored**. - `python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline.rs`: **PASS**. - Current CI: translator/viewer/no-game-data/change-scope pass; the remaining semantic failure is the upstream baseline `test_interp_computed_ij_fallback`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 20:08:35 +00:00
Author
Owner

@⁠bobcatchris on GitHub · 2026-11-29 20:08 UTC · original

Independent verification on native Windows 11 Pro (10.0.26200) + AMD Radeon RX 7900 XTX (gfx1100, driver 32.0.32029.2010, Rust 1.98):

  • Fast-forward cleanly onto main (720bd3b4e..eddf401a2) — zero conflicts.
  • cargo test -p leonida-gpu --lib -- --test-threads=4 — 550 passed; 0 failed; 47 ignored (13.06s), including the new unaligned pipeline stream unit tests.
  • python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline.rs — PASS.

AI-assisted: Antigravity (Gemini 4 Neon)

**@⁠bobcatchris** on GitHub · 2026-11-29 20:08 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2632#issuecomment-7261840232) Independent verification on native Windows 11 Pro (`10.0.26200`) + **AMD Radeon RX 7900 XTX** (`gfx1100`, driver `32.0.32029.2010`, Rust `1.98`): - Fast-forward cleanly onto `main` (`720bd3b4e..eddf401a2`) — zero conflicts. - `cargo test -p leonida-gpu --lib -- --test-threads=4` — **`550 passed; 0 failed; 47 ignored`** (`13.06s`), including the new unaligned pipeline stream unit tests. - `python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/pipeline.rs` — **PASS**. AI-assisted: Antigravity (Gemini 4 Neon)
Author
Owner

@⁠imShangLi on GitHub · 2026-11-29 20:14 UTC · original

CI note: the remaining semantic-tests (ubuntu-latest) failure is test_interp_computed_ij_fallback, the same upstream baseline failure observed on the previous PR/base. This PR changes only d3d12/crates/leonida-gpu/src/pipeline.rs; translator-tests, viewer-tests, no-game-data, and change-scope pass.

Independent native Windows verification is already recorded above: 550 passed / 0 failed on RX 7900 XTX.

AI-assisted: yes.

**@⁠imShangLi** on GitHub · 2026-11-29 20:14 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2632#issuecomment-7261915621) CI note: the remaining `semantic-tests (ubuntu-latest)` failure is `test_interp_computed_ij_fallback`, the same upstream baseline failure observed on the previous PR/base. This PR changes only `d3d12/crates/leonida-gpu/src/pipeline.rs`; `translator-tests`, `viewer-tests`, `no-game-data`, and `change-scope` pass. Independent native Windows verification is already recorded above: 550 passed / 0 failed on RX 7900 XTX. AI-assisted: yes.
Author
Owner

@⁠imShangLi on GitHub · 2026-11-29 20:23 UTC · original

@⁠MoonEyes ready for maintainer review when convenient. Independent RX 7900 XTX verification is 550 passed / 0 failed; the only red CI is the known upstream semantic baseline. AI-assisted: yes.

**@⁠imShangLi** on GitHub · 2026-11-29 20:23 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2632#issuecomment-7262044087) @⁠MoonEyes ready for maintainer review when convenient. Independent RX 7900 XTX verification is 550 passed / 0 failed; the only red CI is the known upstream semantic baseline. AI-assisted: yes.
Author
Owner

@⁠OreoFR on GitHub · 2026-11-29 21:38 UTC · original

Verified by OreoFR

  • PR head eddf401a2f1d578c676c612f176eaf288064476b, merged with --no-ff onto main 060c4716046d8c17f5a124d9ae9d56cc0070c225: clean, no conflict.
  • Windows 11 Pro / RTX 4070 Laptop / NVIDIA 621.40 (no GPU used), stable Rust, --locked.
  • Crate tested: leonida-gpu. cargo test -p leonida-gpu --locked on the merge: 550/550 passed, 0 failed, 47 ignored (doc-test targets 0/0). a_stream_at_an_odd_address_yields_its_shaders passes.
  • Red: same merge with the create_stream change restored to main and the new test kept: the test binary aborts, pipeline.rs:1185 "misaligned pointer dereference: address must be a multiple of 0x8" (exit 0xc0000409). Red to green seen; this is the first red recorded by someone other than the author.
  • Clippy: cargo clippy -p leonida-gpu --locked -- -D warnings stops on lints that are already on main in crates this PR does not touch (leonida-shader emit/lower.rs, emit/bitcode/opt.rs; leonida-lua input.rs, memory.rs). Without -D warnings, no lint points at pipeline.rs. Nothing new from this PR.
  • Rebase on #2566 needed: no (the merge result merges cleanly with the #2566 head eade9562c).
  • Diff read: StreamDesc and each shader Bytecode are now copied with read_unaligned(), which matches the subobject kind read and host::GraphicsState::read, which already read unaligned. On Windows the test also runs the graphics.read path at the odd address. The PR says it may overlap #2569 in the same file; one of them will need a rebase after the other lands.
  • Verdict: READY. Ready to merge per the maintainers' plan.

This verification was AI-assisted (Claude Code, oreofr-agent).

**@⁠OreoFR** on GitHub · 2026-11-29 21:38 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2632#issuecomment-7263033962) **Verified by OreoFR** - PR head `eddf401a2f1d578c676c612f176eaf288064476b`, merged with `--no-ff` onto `main` `060c4716046d8c17f5a124d9ae9d56cc0070c225`: clean, no conflict. - Windows 11 Pro / RTX 4070 Laptop / NVIDIA 621.40 (no GPU used), stable Rust, `--locked`. - Crate tested: `leonida-gpu`. `cargo test -p leonida-gpu --locked` on the merge: **550/550 passed**, 0 failed, **47 ignored** (doc-test targets 0/0). `a_stream_at_an_odd_address_yields_its_shaders` passes. - Red: same merge with the `create_stream` change restored to `main` and the new test kept: the test binary aborts, `pipeline.rs:1185` "misaligned pointer dereference: address must be a multiple of 0x8" (exit `0xc0000409`). Red to green seen; this is the first red recorded by someone other than the author. - Clippy: `cargo clippy -p leonida-gpu --locked -- -D warnings` stops on lints that are already on `main` in crates this PR does not touch (`leonida-shader` `emit/lower.rs`, `emit/bitcode/opt.rs`; `leonida-lua` `input.rs`, `memory.rs`). Without `-D warnings`, no lint points at `pipeline.rs`. Nothing new from this PR. - Rebase on #2566 needed: **no** (the merge result merges cleanly with the #2566 head `eade9562c`). - Diff read: `StreamDesc` and each shader `Bytecode` are now copied with `read_unaligned()`, which matches the subobject kind read and `host::GraphicsState::read`, which already read unaligned. On Windows the test also runs the `graphics.read` path at the odd address. The PR says it may overlap #2569 in the same file; one of them will need a rebase after the other lands. - Verdict: **READY**. Ready to merge per the maintainers' plan. This verification was AI-assisted (Claude Code, oreofr-agent).
Author
Owner

@⁠imShangLi on GitHub · 2026-11-30 09:50 UTC · original

Updated head c33baf89 with latest main (4014af7f), which includes the merged semantic baseline fix #2633. This should clear the previous test_interp_computed_ij_fallback CI failure without changing this PR's one-file diff.

AI-assisted: yes.

**@⁠imShangLi** on GitHub · 2026-11-30 09:50 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2632#issuecomment-7274760823) Updated head `c33baf89` with latest `main` (`4014af7f`), which includes the merged semantic baseline fix #2633. This should clear the previous `test_interp_computed_ij_fallback` CI failure without changing this PR's one-file diff. AI-assisted: yes.
github-bot changed target branch from main to gh-pr/2632/base 2026-11-30 16:04:52 +00:00
github manually merged commit c33baf8903 into gh-pr/2632/base 2026-11-30 16:04:54 +00:00
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-30 15:59 UTC · original

Verified: independent Windows checks pass, including 550 leonida-gpu tests; a red-on-main / green-on-PR misaligned-pointer regression was confirmed, and CI/no-game-data are green. Ready for merge.

**@⁠MoonEyes** on GitHub · 2026-11-30 15:59 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2632#issuecomment-7283941836) Verified: independent Windows checks pass, including 550 leonida-gpu tests; a red-on-main / green-on-PR misaligned-pointer regression was confirmed, and CI/no-game-data are green. Ready for merge.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/ubiquitarianism--leonida!2632
No description provided.