Repository navigation
d3d12: a landing pool asks its limit once a batch, and parks no thread without LEONIDA_AB (D3D12-LAND-POOL-LIMIT-ONCE) - #2692
Conversation
…d without LEONIDA_AB (D3D12-LAND-POOL-LIMIT-ONCE) Since the helper counts went by turns, the views pool (8 threads, 4 at work) and the records pool (10 threads, 6 at work) have a limit function. Each helper called it under the pool's state lock before every number it took and after every wake, and the function read the environment (std::env::var for its _WIDE switch). As the limit was below the thread count, every batch also woke the parked helpers with notify_all: they read the environment under the lock and slept again. The limit is now asked once when a batch begins, kept in the pool's state, and helpers compare with that. Unless LEONIDA_AB names the _WIDE switch, the pool is made with exactly the threads that take part, as before the counts went by turns, so none is parked. By turns, the wide count is made and how many take part follows the switch, as it did.
|
Independent native Windows landing-pool verification. I tested I also ran a local synthetic probe on CPU scheduling checks only. No game inputs, GPU dispatch or gameplay timing. AI-assisted with OpenAI Codex (GPT-6.2 Sol). |
|
A note for reviewers: with
The only difference on that path: the limit function is called once per batch instead of once per item, and that function is a constant. The existing |
|
Independent check on Windows 11 (Rust toolchain from
AI-assisted (Claude Code). |
|
The |
|
Independent
Naming just CachyOS, Rust 1.97.1. Synthetic CPU scheduling check. AI-assisted with OpenAI Codex. |
|
RUN - in-game gate (Verified by OreoFR), PROVISIONAL - RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11.
Result: PASS - 0 device loss, 0 panics, every run alive at the end (653-668 s of world frames).
This run was AI-assisted (Claude Code, oreofr-agent). |
|
@TheGeogeo the in-game gate on an RTX 4070 (OreoFR, above) passes on this head, and the only red check is AI-assisted (Claude Code). |
|
Closing and reopening so that CI runs against current AI-assisted (Claude Code). |
|
Verified by MoonEyes on head
AI-assisted (Claude Code). |
|
Merging. Head AI-assisted (Claude Code). |
Claimed in the coordination issue as: D3D12-LAND-POOL-LIMIT-ONCE (#2570 (comment))
What and why
Since
ff1874c6f("helper counts by turns"), the two landing pools inland.rshave a limit function. The views pool runs 8 threads with 4 at work, and the records pool runs 10 threads with 6 at work. The records pool's batches are what the submitting thread waits for at the end of a submission. The views pool's batches are the heap pass's "looking at slots".On
main:Pool::helpcalls the limit function before every number it takes and after every wake, while it holds the pool's state mutex.wide(), which runsstd::env::varfor its_WIDEswitch on every call.Pool::eachusesnotify_all. Every batch therefore also wakes the 3 or 4 parked helpers that cannot work. They read the environment under the lock and go back to sleep.This change:
State::limit); helpers compare with that value;LEONIDA_ABdoes not name the_WIDEswitch, as beforeff1874c6f, so no thread is parked;LEONIDA_AB: the wide count is made, and how many take part follows the switch.LEONIDA_VIEW_THREADS,LEONIDA_VIEW_THREADS_WIDEandLEONIDA_RECORD_THREADS_WIDEmean what they meant before.Tested
On Windows 11, from
d3d12\:land::tests::a_pools_limit_is_asked_once_a_batch: a pool with a counting limit runs three batches of 256 items, and the limit must be asked once per batch. Onmainit fails, with the limit asked 4 times in the first batch; with the change it passes.cargo test -p leonida-gpu --locked: 553 passed, 49 ignored.rustfmtwithd3d12/rustfmt.tomlreports nothing in the changed lines.git diff --checkandcheck_no_game_data.pyare clean.build-nvidia.ps1, featuresdiagnostics,dlss,mimalloc) built.land.rs, D3D12-CLIPPY-LEONIDA-GPU: fix all clippy warnings in leonida-gpu #2682 and runtime, d3d12: memory leak fixes from one sweep (RT-LEAK-SWEEP) #2569 (git merge-tree).mainthen this branch, twice. Each run went from the menus to the world, then 150 s of a scripted cutscene in the Series S preset. Frame times come from PresentMon 2.6, processor time from the process counters, and the waits from the per-second frame lines (means over the cutscene):How to read it:
mainrun was the session's first start and had an 11 s hitch, so I compare against the second one.GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140, Windows 11 Pro 10.0.26300.
AI-assisted: yes
Checklist
mainand merges cleanly (also with runtime, d3d12: memory leak fixes from one sweep (RT-LEAK-SWEEP) #2569 and D3D12-CLIPPY-LEONIDA-GPU: fix all clippy warnings in leonida-gpu #2682, which touchland.rs).docs/design.md, with how it was confirmed. (Not applicable: no translator change.)