gpu: the split list ahead's textures half runs on one kept thread (D3D12-AHEAD-SPLIT-KEPT-THREAD) #2828
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!2828
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ahead-split-kept-thread"
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
Claimed in the coordination issue as:
D3D12-AHEAD-SPLIT-KEPT-THREAD(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7299620961). enlighted-agent, who owns the reaper/scratch work, confirmed on the agents' bridge that this one was free.What and why
With
LEONIDA_AHEAD_SPLIT(set by the launcher),record_ahead_split(queue.rs) made a new OS thread with an 8 MiB stack every frame for the textures' half of the list ahead, chose the fast cores for it (cores::keep_on_fast_cores, a CPU-set call and an info line in the log) and joined it. The line's thread waits for that half, so the spawn, the CPU-set call and the log line were on its path. On an RTX 4070 Laptop / Core Ultra 7 155H the log had 14,271 of those lines in about 2.5 minutes of play.Now one thread is kept for it (
queue::beside::Kept): made at the first split, pinned once, handed each frame's textures half through a channel and waited for, with the same panic handling and the same fallback (no thread → both halves here, one after the other).LEONIDA_AHEAD_KEPT_THREAD(on;0brings back the thread made each frame), readable byLEONIDA_ABfor an A/B in one binary.d3d12/docs/switches.mdregenerated withtools/d3d12_switches.py(--checkpasses).Measured (one binary,
LEONIDA_AB=10,LEONIDA_AHEAD_KEPT_THREAD)RTX 4070 Laptop 8 GB, NVIDIA 621.40, Core Ultra 7 155H, Windows 11 Pro;
-SeriesS -NoDlss -NoFrameGen, standing, 600 s in the world, the steady phases only (18 a side):queueline)The wait for the list ahead halves; the frame time moved by less than its spread, so no frame-rate claim.
d3d12_ab_compare.py phases(24 pairs, draw jumps left out): "no clear difference" on the median frame. 0 ERROR lines and no device loss in the run.Tested
queue::beside::tests::pieces_run_on_one_thread_made_once_and_a_panic_stays_in_its_piece: 200 pieces run on one thread (not the caller's), its start runs once, a piece that panics returnsErrand the same thread runs the next.Kept::startspawning a thread per piece (the old behaviour), the test fails at "one thread for all the pieces".cargo test --locked -p leonida-gpu: 591 passed, 0 failed on this branch merged withmain9d231d373;-p leonida-hle242/0. Note:main9d231d373does not build itsleonida-gputests (mod asbench;without its file, fixed by #2825), so that run used a local, untracked emptyindirect/asbench.rs, removed afterwards. On the base90c514437: 590 passed (589 + the new test).cargo clippy -p leonida-gpu --all-targets --features diagnostics: no warning in the changed lines.scripts/check_no_game_data.pyon the changed files: clean.GitHub CI will show
main's current reds (tools/make_amplify_dxil.py, fixed by #2827) until those land.AI-assisted: yes (Claude Code, Claude Opus 5.5, agent
oreofr-agentfor OreoFR). GPU: RTX 4070 Laptop 8 GB, driver 621.40.🤖 Generated with Claude Code
RUN (in-game A/B only, RTX 3090; #2828 head 169c99060 built as it is,
d3d12/scripts/build-nvidia.ps1 -NoDlss, diag profile; not merged with a newermain. No out-of-game checks here: no red/green, tests or clippy.)scripts/play-d3d12.ps1 -SeriesS -NoDlss -NoFrameGenat the launcher's defaults, the same save restored, standing still,LEONIDA_NO_WATCHDOG=1,LEONIDA_AB=10,LEONIDA_AHEAD_KEPT_THREAD(switch by turns every 10 s, the first 4 s of each phase left out); warm-up and a throwaway run first; 601 s measured, nothing else running on the PC.Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40.