D3D12: anchor the placed-view regression to its backing buffer #2538
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2538
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/d3d12-descriptor-view-backing"
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?
Pull request successfully merged and closed
D3D12-DESCRIPTOR-VIEW-BACKING-TEST. Claim.
The placed-view test assumes its 456-byte structured element starts exactly one element into a backing buffer. It supplied only loose process memory. Aligning start to 4 KiB does not give the host window that origin, so the shared-buffer assertion could fail with the default LEONIDA_STRUCTURED_BYTES=0. Register a 4 KiB backing range for the existing fixture and release the registration before its memory drops, including on a panic. The same raw/structured resource-width and copy-span assertions still exercise the production path.
On Windows at 431ceba4f, running the single test separately failed with STRUCTURED_BYTES=0 and passed with =1. On this branch the single test passed in separate processes with each setting (
cargo test --manifest-path d3d12/Cargo.toml --locked -p leonida-gpu --lib views_off_their_elements_get_a_copy_of_their_bytes -- --test-threads=1). In a local combined checkout with #2537 the full GPU library suite passed: 483 passed, 46 ignored. Diff whitespace and no-game-data checks passed.GPUs tested: Windows system with RTX 4070 Laptop GPU, driver 610.74. Synthetic descriptor test; retail rendering was not measured. Independent of #2537. AI-assisted with OpenAI Codex (GPT-6).
Static review at head
243e536bd(Rust toolchain is not installed in this local environment, socargo testwas not executed locally).Notes
d3d12/crates/leonida-gpu/src/descriptor/host.rs:6405-6421) eliminates window-grid alignment drift in loose shadow lookups (shadow.rs:5913-5927,6033-6068,6125-6136), and the RAII guard unregisters the same key before the backing allocation drops (including on unwind).Approve.
AI-assisted static review.
Reviewed the diff and tested merged onto
main(493867366) on Windows 11 with Rust 1.100.1 (MSVC).Registering a 4 KiB backing range via
crate::shadow::registerwith aDropguard cleanly anchors the placed-view fixture for bothLEONIDA_STRUCTURED_BYTES=0and=1.Tests run
cargo test --manifest-path d3d12/Cargo.toml --locked -p leonida-gpu --lib views_off_their_elements_get_a_copy_of_their_bytes -- --test-threads=1:LEONIDA_STRUCTURED_BYTES=0: 1 passed, 0 failed (0.23 s).LEONIDA_STRUCTURED_BYTES=1: 1 passed, 0 failed (0.21 s).GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88).
AI-assisted (Antigravity, Gemini).
VERIFY-2538-D3D12— verified head243e536bd8merged cleanly withmainc7f5330e0on Windows 11 Pro (build 26200), NVIDIA GeForce RTX 3090 (driver 610.88), synthetic descriptor test inputs only.Red (
mainc7f5330e0) -> Green (c7f5330e0+243e536bd8)main:LEONIDA_STRUCTURED_BYTES=0 cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib descriptor::host::tests:: -- --test-threads=1-> FAILED (45 passed; 1 failed; 1 ignored:descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytespanicked atd3d12/crates/leonida-gpu/src/descriptor/host.rs:6457withassertion 'left != right' failed: its buffer's copywheneverstartlands on one of the 15 non-64-KiB-aligned 4 KiB pages inside a loose 64 KiB host window, so(start % 65536 + 456) % 456 != 0).LEONIDA_STRUCTURED_BYTES=0 cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib descriptor::host::tests:: -- --test-threads=1-> 46 passed; 0 failed; 1 ignored (0.85s).LEONIDA_STRUCTURED_BYTES=0andLEONIDA_STRUCTURED_BYTES=1isolated runs (--exact --test-threads=1) -> 1 passed; 0 failed in both modes.AI-assisted.
Red/green: On main the views_off_their_elements test fails because its placed views have no shared backing buffer, and with the PR cargo test -p leonida-gpu --lib -- views_off_their_elements passes (2 OK) on Windows 11 at OreoFR's (RTX 4070).
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.
Verified by OreoFR
54d27d988+ PR head243e536bd; green run in a merge package of 5 PRs, no new ctest failure vs maincargo test -p leonida-gpu --lib --locked -- views_off_their_elementsAI-assisted (Claude Code, Claude Opus 5.5).