startup: add upload buffer lifetime coverage and guard (Part of #1758) #2061
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2068"
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 R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T23:58:00Z.
Part of #1758
What this unblocks: the ABI and lifetime control that #1758 asks for before command-list slot 148 (the builder's upload allocation) is wired into production.
What it adds
startup_upload_lifetimereuses the #1774 upload arena. With the queue blocked on a fence:Also checked: CPU pointer and GPU address are both 16-byte aligned, the GPU address equals the page base plus the offset, a retired A range no longer translates, and no copy ran before the gate opened.
The overwrite control writes B into A's live range before the gate opens. A's readback must then show B, which proves the harness sees late GPU reads.
The arena reset drops the arena's own page reference, so the fixture holds A's page until the queue drains. This stands in for the retirement a production caller owes.
Not covered: refusal after a normal Close, and any command-buffer interaction (still a separate hypothesis per the thread).
Verification
Executed locally (Linux):
git diff --check: clean.x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -Isrc tests/startup_upload_lifetime.cpp: no errors.Win2025 commands not yet executed (this host has no Windows build):
cmake --build --preset release --target startup_upload_lifetimectest --preset release --no-tests=error -R '^startup_upload_lifetime_' -VPlease run the two ctest cases (WARP and hardware) before merge.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:07:38Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
3a2310fℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T00:11:05Z.
Windows Release at
3a2310f3:startup_upload_lifetime_warpandstartup_upload_lifetime_hardwarewere 2/2 on WARP and RTX 4060 Laptop, debug layer enabled, no skips. Both read back A and B after the gate, and the overwrite control read B in A's copy. Command:ctest --preset release --no-tests=error -R '^startup_upload_lifetime_' -V.Before marking it ready, check the HRESULTs from queue Wait and CPU gate Signal. The cleanup currently waits for fence value 2 even if the code never submitted B's completion signal. Track a successfully signaled completion (or enqueue a drain after opening the gate), and never report the normal lifetime result if the gate setup or completion failed. The standalone result still uses a page reference kept by the fixture. Keep the production Close/Reset check under #1758.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T00:14:38Z.
I pushed the gate and drain fix. A failed queue wait now stops before recording, a failed gate signal is reported, and the fixture waits only on an enqueued completion signal, including when B is never submitted. Windows Release passed both WARP and RTX 4060 Laptop again, debug layer enabled, no skips. The fixture still holds its old page explicitly, as expected for the standalone test.