leonida-gpu: read the pipeline stream of the title unaligned (D3D12-GPU-PIPELINE-BYTECODE-ALIGNMENT) #2632
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2632"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-11-29T20:04:00Z.
Claimed in the coordination issue as:
D3D12-GPU-PIPELINE-BYTECODE-ALIGNMENTDepends 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_streamreads the title-ownedStreamDescand each shaderBytecodethrough aligned Rust references. The title chooses these buffer addresses and need not align them. Read both withread_unaligned()and add an odd-address stream regression test.Tested
Prior measured branch result on Windows 11 / Rust 1.98.1, base
cc0f662a70b6e6e561692f56342b5a7df3831bd7:a_stream_at_an_odd_address_yields_its_shadersaborts on pristinemainatpipeline.rs:1185with a misaligned pointer dereference and passes with the change.cargo test --package leonida-gpu --lib --locked --offline: pristine536 passed; 1 failed; 47 ignored; patched537 passed; 1 failed; 47 ignored.descriptor::host::tests::views_are_made_beside_the_heap_and_copied_infailure is also red on pristinemainon the AMD Radeon 780M host.pipeline.rs.mainmerged and still changes onlyd3d12/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
mainand merges cleanlyIndependent verification
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.test_interp_computed_ij_fallback.Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-29T20:08:29Z.
Independent verification on native Windows 11 Pro (
10.0.26200) + AMD Radeon RX 7900 XTX (gfx1100, driver32.0.32029.2010, Rust1.98):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)
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-11-29T20:14:08Z.
CI note: the remaining
semantic-tests (ubuntu-latest)failure istest_interp_computed_ij_fallback, the same upstream baseline failure observed on the previous PR/base. This PR changes onlyd3d12/crates/leonida-gpu/src/pipeline.rs;translator-tests,viewer-tests,no-game-data, andchange-scopepass.Independent native Windows verification is already recorded above: 550 passed / 0 failed on RX 7900 XTX.
AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-11-29T20:23:40Z.
@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.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T21:38:22Z.
Verified by OreoFR
eddf401a2f1d578c676c612f176eaf288064476b, merged with--no-ffontomain060c4716046d8c17f5a124d9ae9d56cc0070c225: clean, no conflict.--locked.leonida-gpu.cargo test -p leonida-gpu --lockedon the merge: 550/550 passed, 0 failed, 47 ignored (doc-test targets 0/0).a_stream_at_an_odd_address_yields_its_shaderspasses.create_streamchange restored tomainand the new test kept: the test binary aborts,pipeline.rs:1185"misaligned pointer dereference: address must be a multiple of 0x8" (exit0xc0000409). Red to green seen; this is the first red recorded by someone other than the author.cargo clippy -p leonida-gpu --locked -- -D warningsstops on lints that are already onmainin crates this PR does not touch (leonida-shaderemit/lower.rs,emit/bitcode/opt.rs;leonida-luainput.rs,memory.rs). Without-D warnings, no lint points atpipeline.rs. Nothing new from this PR.eade9562c).StreamDescand each shaderBytecodeare now copied withread_unaligned(), which matches the subobject kind read andhost::GraphicsState::read, which already read unaligned. On Windows the test also runs thegraphics.readpath 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.This verification was AI-assisted (Claude Code, oreofr-agent).
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-11-30T09:50:36Z.
Updated head
c33baf89with latestmain(4014af7f), which includes the merged semantic baseline fix #2633. This should clear the previoustest_interp_computed_ij_fallbackCI failure without changing this PR's one-file diff.AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T15:59:34Z.
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.