d3d12/list: more list threads where the processor has slow cores (D3D12-THIN-WIDE-HYBRID) #3411

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u  "d3d12-thin-wide-hybrid:Rockcabbage-d3d12-thin-wide-hybrid"
git switch "Rockcabbage-d3d12-thin-wide-hybrid"
Open
leonida/mandy
Rockcabbage wants to merge 5 commits from Rockcabbage/mandy:d3d12-thin-wide-hybrid into main

This pull request has changes conflicting with the target branch.

Merge manually to resolve the conflicts.

Conversation
Reviewers 0 approvals
  • No reviewers
Details

This pull request has changes conflicting with the target branch.

Merge manually to resolve the conflicts.

  • d3d12/docs/findings.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'd3d12-thin-wide-hybrid:Rockcabbage-d3d12-thin-wide-hybrid'
git switch 'Rockcabbage-d3d12-thin-wide-hybrid'
First-time contributor

Claimed in the coordination issue as: D3D12-THIN-WIDE-HYBRID (#3312). Related: #3140, closed, a docs pull request about four list threads on an i5-12600K. This change leaves that PC's count as it is.

This was ready on GitHub before the move but was never opened there. It is the same change as one commit on current main.

What and why

On processors with a slower class of cores (Intel hybrid), more of the threads that translate the title's lists now take work by default.

  • The count. It is the slow logical processors less 4 (room for our submitting, relay and helper threads), at most 12, and never fewer than LEONIDA_THIN_THREADS. LEONIDA_THIN_THREADS_WIDE sets it explicitly.

  • LEONIDA_THIN_WIDE. It is on unless set to 0, and it can be flipped by turns under LEONIDA_AB. With 0, LEONIDA_THIN_THREADS threads take work, as before.

  • Starting and parking. The larger count is started once. Threads past the working count stay parked and look at the switches every 2 ms, as LEONIDA_THIN_PARK already did. LEONIDA_THIN_PARK now uses the same parking. A wake-up that a thread takes while it is past the working count is passed on to a working thread.

  • A ready-queue meter. It runs under the queue's existing lock and measures:

    • time with recordings ready and no thread at them, by depth (1, 2, 3-4, 5-8 and more than 8);
    • how much of that time no working thread was waiting (a lower bound: a thread that was woken but is not at the queue yet still counts as waiting);
    • the waits, summed.

    The meter goes on the frame-rate log line and into LEONIDA_AB's counters: list_ready_ns, list_ready_starved_ns, list_ready_waits_ns and list_ready_deep_ns.

  • cores::slow_processors(). It counts the CPU sets whose efficiency class is below the best one. It returns 0 where all are alike.

Who is affected:

  • Machines where every core is alike: unchanged. With 0 slow processors the count is LEONIDA_THIN_THREADS, and the same number of threads is started and works.
  • i5-12600K (4 slow): unchanged. 4 − 4 is below the launcher's 6.
  • i9-13900K (16 slow): 12 threads take work instead of 6.

Why more threads help there:

  • The 6 in play-nvidia.ps1 dates from 66b486735. It was tuned on a 6-core Ryzen 5 7600X, where the title's threads waited for a core while 8 list threads stood idle 39 % of their time.
  • On an i9-13900K the title keeps its threads on the first fast cores with its own affinity masks, and the 16 slow logical processors stood 3-7 % busy.
  • One thread translates a recording at a time. With 6 threads, recordings stood ready while every working thread was busy.

Measured

These measurements were taken before the move, on the earlier head (the same diff on the main of that time, ff8b4965c). They were not taken again on this base.

The setup:

  • RTX 4090 and i9-13900K, hardware ray tracing, base LEONIDA_THIN_THREADS=6.
  • Walking in the world at about 7,000-8,000 draws a frame.
  • Turns of 20 s inside one run (LEONIDA_AB).
  • No device lost, no panic and no errors.

The first runs were on a local tree (that main plus local work), of which this pull request carries only the list-threads part:

wide minus 6 6 vs 12 (5 pairs) 6 vs 16 (6 pairs)
frame median −2.280 ± 0.416 ms −2.133 ± 0.115 ms
our hold of the title's present −2.42 ms −2.33 ms
ready with no working thread waiting (list_ready_starved) −18.6 ms −28.1 ms
list threads running +32.9 ms +49.3 ms
submitting thread's own work +0.20 ms +0.63 ms
the title's own part of the frame +0.25 ms +0.40 ms
  • Phase medians were 35.2 / 35.1 / 34.7 / 35.2 / 35.2 ms with 6 threads and 33.3 / 33.0 / 33.1 / 32.9 / 33.0 ms with 12.
  • Sixteen threads buy nothing over 12 and cost more processor time, so the count stops at 12.

Then, on the change alone, before the move: 470 s with the window up (about 360 s in the world), walking at 8,000-12,000 draws, no device lost, no panic, no errors.

  • Built with DLSS (diagnostics,dlss,mimalloc), frames of 40-44 ms: median −2.367 ± 0.242 ms (6 pairs), list_ready_starved −19.7 ms.
  • Built without DLSS (the title's own upscaler), frames of about 50 ms: median +0.143 ± 0.899 ms (7 pairs, no difference), list_ready_starved −18.2 ms. There something other than translation limits the frame, so the wider count neither helps nor hurts.

Memory: each extra thread keeps three things.

  • Its own view heap of 8,192 slots that the card does not see, about 256 KB.
  • A table of cached views, 8,192 × 136 B, about 1.1 MB.
  • A map of the views it made.

That is about 1.5-2.5 MB a thread. On an i9-13900K with the launcher's 6, it adds 6 threads, about 9-15 MB.

Files:

  • d3d12/crates/leonida-gpu/src/list/thin.rs: the pool, the working count, parking, the meter and the tests.
  • cores.rs: slow_processors().
  • ab.rs: the counters.
  • d3d12/scripts/play-nvidia.ps1: a comment only; no setting changes.
  • d3d12/docs/findings.md: a new section at the end.
  • d3d12/docs/switches.md: regenerated with tools/d3d12_switches.py.

Tested

On this branch, on main 312d88d1d.

New unit tests:

  • list::thin::tests::the_wider_count_follows_the_slow_processors
  • the_pool_starts_the_larger_count_and_works_with_the_one_asked
  • the_ready_meter_counts_time_by_depth
  • depths_fall_in_their_parts
  • a_wake_up_a_parked_thread_took_goes_on_to_a_working_one
  • slow_of cases in cores::tests

Red and green, by reverting the source by hand:

  • With the cap at 16, the count test fails (16 against 12).
  • Without the pass-on of a wake-up, the wake-up test fails in 10 of 10 runs. With it, the test passes in 100 of 100.
  • Restored, all pass.
  • On main the new tests do not build, because the functions are new.

Commands run:

  • cargo check -p leonida-gpu, with and without --features diagnostics: clean on this change's lines. The diagnostics build has one warning, in book.rs; it is on main too.
  • cargo test -p leonida-gpu --lib --locked: 734 passed, 0 failed, 59 ignored. With --features diagnostics: 815 passed, 0 failed, 59 ignored.
  • cargo build --workspace --all-targets --locked: builds.
  • cargo test --workspace --exclude xtask --locked --no-fail-fast: 1,775 passed, 0 failed, 75 ignored. An earlier run of the same command failed title_range::tests::a_request_at_a_held_address_is_made_there and upload::tests::arenas_take_the_held_range_and_keep_others_out ("another thread took part of the test range"). Both pass alone and in the full run; that is a race between parallel tests on main's test ranges, not this change.
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: passes.
  • python -I scripts/check_no_game_data.py on the changed files: exit 0.
  • python -m unittest discover -s tests -p "test_docs_*.py": 59 tests OK.

GPUs tested: NVIDIA GeForce RTX 4090, driver 621.24, Windows 11 (CPU: Intel i9-13900K)

AI-assisted: yes. Claude Code; Claude Fable 5.2 directing, Claude Opus 5.5 writing and reviewing.

  • Before the move, a separate read-only reviewer agent (Claude Opus 5.5) audited the diff, and its findings are in this change:
    • the parked threads look at the switches every 2 ms;
    • the wait loop is its own function, with its test;
    • the starved time is documented as a lower bound;
    • the docs do not claim fast-core placement by default;
    • the launcher comment is updated.
  • On this base, a second review pass by Claude Opus 5.5 found that findings.md named two commits by hashes that do not exist in this server's history. The follow-up commit names them by their hashes here (66b486735 and ff8b4965c).

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

Claimed in the coordination issue as: `D3D12-THIN-WIDE-HYBRID` (#3312). Related: #3140, closed, a docs pull request about four list threads on an i5-12600K. This change leaves that PC's count as it is. - Base: `main` at 312d88d1d. - Head: `d3d12-thin-wide-hybrid` at 84180e52e. This was ready on GitHub before the move but was never opened there. It is the same change as one commit on current `main`. ### What and why On processors with a slower class of cores (Intel hybrid), more of the threads that translate the title's lists now take work by default. - **The count.** It is the slow logical processors less 4 (room for our submitting, relay and helper threads), at most 12, and never fewer than `LEONIDA_THIN_THREADS`. `LEONIDA_THIN_THREADS_WIDE` sets it explicitly. - **`LEONIDA_THIN_WIDE`.** It is on unless set to `0`, and it can be flipped by turns under `LEONIDA_AB`. With `0`, `LEONIDA_THIN_THREADS` threads take work, as before. - **Starting and parking.** The larger count is started once. Threads past the working count stay parked and look at the switches every 2 ms, as `LEONIDA_THIN_PARK` already did. `LEONIDA_THIN_PARK` now uses the same parking. A wake-up that a thread takes while it is past the working count is passed on to a working thread. - **A ready-queue meter.** It runs under the queue's existing lock and measures: - time with recordings ready and no thread at them, by depth (1, 2, 3-4, 5-8 and more than 8); - how much of that time no working thread was waiting (a lower bound: a thread that was woken but is not at the queue yet still counts as waiting); - the waits, summed. The meter goes on the frame-rate log line and into `LEONIDA_AB`'s counters: `list_ready_ns`, `list_ready_starved_ns`, `list_ready_waits_ns` and `list_ready_deep_ns`. - **`cores::slow_processors()`.** It counts the CPU sets whose efficiency class is below the best one. It returns 0 where all are alike. Who is affected: - **Machines where every core is alike: unchanged.** With 0 slow processors the count is `LEONIDA_THIN_THREADS`, and the same number of threads is started and works. - **i5-12600K (4 slow): unchanged.** 4 − 4 is below the launcher's 6. - **i9-13900K (16 slow): 12 threads take work instead of 6.** Why more threads help there: - The 6 in `play-nvidia.ps1` dates from 66b486735. It was tuned on a 6-core Ryzen 5 7600X, where the title's threads waited for a core while 8 list threads stood idle 39 % of their time. - On an i9-13900K the title keeps its threads on the first fast cores with its own affinity masks, and the 16 slow logical processors stood 3-7 % busy. - One thread translates a recording at a time. With 6 threads, recordings stood ready while every working thread was busy. ### Measured These measurements were taken before the move, on the earlier head (the same diff on the main of that time, ff8b4965c). They were not taken again on this base. The setup: - RTX 4090 and i9-13900K, hardware ray tracing, base `LEONIDA_THIN_THREADS=6`. - Walking in the world at about 7,000-8,000 draws a frame. - Turns of 20 s inside one run (`LEONIDA_AB`). - No device lost, no panic and no errors. The first runs were on a local tree (that main plus local work), of which this pull request carries only the list-threads part: | wide minus 6 | 6 vs 12 (5 pairs) | 6 vs 16 (6 pairs) | |---|---|---| | frame median | **−2.280 ± 0.416 ms** | −2.133 ± 0.115 ms | | our hold of the title's present | −2.42 ms | −2.33 ms | | ready with no working thread waiting (`list_ready_starved`) | −18.6 ms | −28.1 ms | | list threads running | +32.9 ms | +49.3 ms | | submitting thread's own work | +0.20 ms | +0.63 ms | | the title's own part of the frame | +0.25 ms | +0.40 ms | - Phase medians were 35.2 / 35.1 / 34.7 / 35.2 / 35.2 ms with 6 threads and 33.3 / 33.0 / 33.1 / 32.9 / 33.0 ms with 12. - Sixteen threads buy nothing over 12 and cost more processor time, so the count stops at 12. Then, on the change alone, before the move: 470 s with the window up (about 360 s in the world), walking at 8,000-12,000 draws, no device lost, no panic, no errors. - Built with DLSS (`diagnostics,dlss,mimalloc`), frames of 40-44 ms: median **−2.367 ± 0.242 ms** (6 pairs), `list_ready_starved` −19.7 ms. - Built without DLSS (the title's own upscaler), frames of about 50 ms: median +0.143 ± 0.899 ms (7 pairs, no difference), `list_ready_starved` −18.2 ms. There something other than translation limits the frame, so the wider count neither helps nor hurts. Memory: each extra thread keeps three things. - Its own view heap of 8,192 slots that the card does not see, about 256 KB. - A table of cached views, 8,192 × 136 B, about 1.1 MB. - A map of the views it made. That is about 1.5-2.5 MB a thread. On an i9-13900K with the launcher's 6, it adds 6 threads, about 9-15 MB. Files: - `d3d12/crates/leonida-gpu/src/list/thin.rs`: the pool, the working count, parking, the meter and the tests. - `cores.rs`: `slow_processors()`. - `ab.rs`: the counters. - `d3d12/scripts/play-nvidia.ps1`: a comment only; no setting changes. - `d3d12/docs/findings.md`: a new section at the end. - `d3d12/docs/switches.md`: regenerated with `tools/d3d12_switches.py`. ### Tested On this branch, on `main` 312d88d1d. New unit tests: - `list::thin::tests::the_wider_count_follows_the_slow_processors` - `the_pool_starts_the_larger_count_and_works_with_the_one_asked` - `the_ready_meter_counts_time_by_depth` - `depths_fall_in_their_parts` - `a_wake_up_a_parked_thread_took_goes_on_to_a_working_one` - `slow_of` cases in `cores::tests` Red and green, by reverting the source by hand: - With the cap at 16, the count test fails (16 against 12). - Without the pass-on of a wake-up, the wake-up test fails in 10 of 10 runs. With it, the test passes in 100 of 100. - Restored, all pass. - On `main` the new tests do not build, because the functions are new. Commands run: - `cargo check -p leonida-gpu`, with and without `--features diagnostics`: clean on this change's lines. The diagnostics build has one warning, in `book.rs`; it is on `main` too. - `cargo test -p leonida-gpu --lib --locked`: 734 passed, 0 failed, 59 ignored. With `--features diagnostics`: 815 passed, 0 failed, 59 ignored. - `cargo build --workspace --all-targets --locked`: builds. - `cargo test --workspace --exclude xtask --locked --no-fail-fast`: 1,775 passed, 0 failed, 75 ignored. An earlier run of the same command failed `title_range::tests::a_request_at_a_held_address_is_made_there` and `upload::tests::arenas_take_the_held_range_and_keep_others_out` ("another thread took part of the test range"). Both pass alone and in the full run; that is a race between parallel tests on `main`'s test ranges, not this change. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md`: passes. - `python -I scripts/check_no_game_data.py` on the changed files: exit 0. - `python -m unittest discover -s tests -p "test_docs_*.py"`: 59 tests OK. GPUs tested: NVIDIA GeForce RTX 4090, driver 621.24, Windows 11 (CPU: Intel i9-13900K) AI-assisted: yes. Claude Code; Claude Fable 5.2 directing, Claude Opus 5.5 writing and reviewing. - Before the move, a separate read-only reviewer agent (Claude Opus 5.5) audited the diff, and its findings are in this change: - the parked threads look at the switches every 2 ms; - the wait loop is its own function, with its test; - the starved time is documented as a lower bound; - the docs do not claim fast-core placement by default; - the launcher comment is updated. - On this base, a second review pass by Claude Opus 5.5 found that `findings.md` named two commits by hashes that do not exist in this server's history. The follow-up commit names them by their hashes here (66b486735 and ff8b4965c). ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Where some logical processors are of a slower class, the list threads
that take work are by default the slow ones less 4, at most 12, never
fewer than LEONIDA_THIN_THREADS (LEONIDA_THIN_THREADS_WIDE sets the
count). LEONIDA_THIN_WIDE=0 (on unless 0; by turns under LEONIDA_AB)
keeps LEONIDA_THIN_THREADS working. The larger count is started once;
threads past the working count stay parked and look at the switches
every 2 ms (LEONIDA_THIN_PARK uses the same parking now), and a wake-up
one of them took goes on to a working thread. Where all processors are
alike nothing changes.

A meter of the ready queue (recordings with words ready and no thread
at them, by depth, and with no working thread free: the least such
time) goes on the frame-rate line and into LEONIDA_AB's counters
(list_ready_*).

By turns on an i9-13900K with an RTX 4090: 6 against 12 threads, the
frame's median -2.28 +- 0.42 ms; 6 against 16, -2.13 +- 0.12 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From a second review on this base: the section named "Six list threads
by default" and the main it was measured on by hashes of the history
before the move, which this one does not have (66b486735 and ff8b4965c
here, the same trees).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
First-time contributor

In-game run report, exe built at 84180e52e (the head is now 0e67f39d2, a merge of main that touches only the progress dashboard)

  • RTX 4090, driver 621.24, i9-13900K, 64 GB, Windows 11. Series X profile, 2560x1440, -HardwareRT -NoFrameGen, diag build (diagnostics,dlss,mimalloc), LEONIDA_WINDOWS_BAR_MB=8192, launcher's LEONIDA_THIN_THREADS=6. The log says started=12 asked=6 wide=12.
  • 440 s with the window up, about 6 minutes in the world, a scripted walk in a loop; LEONIDA_AB=20,LEONIDA_THIN_WIDE flips the count by turns of 20 s.
  • 0 device lost, 0 panics, 0 ERROR lines.
  • The scene was heavier than in the description's runs: 11,000-12,300 draws a frame, frames of 47-56 ms (median 50.5 ms over 5,765 frames in the world).

By turns, wide (12) minus 6, 10 pairs (2 left out for a draw jump):

on minus off
frame median -1.24 +- 0.90 ms (the tool's verdict: no clear difference)
list_ready_starved -24.7 +- 1.2 ms
list_ready -23.4 +- 1.1 ms
  • So on this base the meter moves as before (recordings no longer stand ready with every working thread busy), but the frame gain in this run is smaller than the -2.3 ms of the description and not clear of its error. Two things differ from those runs: the scene (11-12k draws against 7-8k) and other work on the PC during the run (two analysis jobs of mine), which makes the phases noisier. I would not read more into it than that; a quieter run can follow if wanted.
  • Pictures, six over the run, looked at: the scene is drawn in each. Four of them, from a covered porch on the street side, show a large very dark area on the house wall under the porch roof. It is there with the switch on and with it off (pictures at 200 s and 320 s are off phases, 260 s and 430 s on), so the working count does not make it. I have no picture of main from that spot yet to say whether main draws it the same; I will add one.

AI-assisted: yes (Claude Code; run started and its log and pictures read by Claude Fable 5.2).

### In-game run report, exe built at 84180e52e (the head is now 0e67f39d2, a merge of `main` that touches only the progress dashboard) - RTX 4090, driver 621.24, i9-13900K, 64 GB, Windows 11. Series X profile, 2560x1440, `-HardwareRT -NoFrameGen`, diag build (`diagnostics,dlss,mimalloc`), `LEONIDA_WINDOWS_BAR_MB=8192`, launcher's `LEONIDA_THIN_THREADS=6`. The log says `started=12 asked=6 wide=12`. - 440 s with the window up, about 6 minutes in the world, a scripted walk in a loop; `LEONIDA_AB=20,LEONIDA_THIN_WIDE` flips the count by turns of 20 s. - **0 device lost, 0 panics, 0 ERROR lines.** - The scene was heavier than in the description's runs: 11,000-12,300 draws a frame, frames of 47-56 ms (median 50.5 ms over 5,765 frames in the world). By turns, wide (12) minus 6, 10 pairs (2 left out for a draw jump): | | on minus off | |---|---| | frame median | **-1.24 +- 0.90 ms** (the tool's verdict: no clear difference) | | `list_ready_starved` | -24.7 +- 1.2 ms | | `list_ready` | -23.4 +- 1.1 ms | - So on this base the meter moves as before (recordings no longer stand ready with every working thread busy), but the frame gain in this run is smaller than the -2.3 ms of the description and not clear of its error. Two things differ from those runs: the scene (11-12k draws against 7-8k) and other work on the PC during the run (two analysis jobs of mine), which makes the phases noisier. I would not read more into it than that; a quieter run can follow if wanted. - Pictures, six over the run, looked at: the scene is drawn in each. Four of them, from a covered porch on the street side, show a large very dark area on the house wall under the porch roof. It is there with the switch on and with it off (pictures at 200 s and 320 s are off phases, 260 s and 430 s on), so the working count does not make it. I have no picture of `main` from that spot yet to say whether `main` draws it the same; I will add one. AI-assisted: yes (Claude Code; run started and its log and pictures read by Claude Fable 5.2).
From review: the pool's comment and the findings said the threads past
the working count stay parked. A thread that was already waiting at the
condition variable when a turn of LEONIDA_AB lowered the count stays in
that wait; when a wake-up reaches it, it passes the wake-up on (if a
recording is ready) and parks then. No wake-up is lost: the pass-on is
sent under the lock, and a working thread looks at the queue under the
lock before it waits. The comment on Pool and the findings line now say
so. Wording only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	d3d12/docs/findings.md
Author
First-time contributor

A second read-only review of this branch (Claude Opus 5.5), and what changed for it. The head is now 1b3c0635c, with main a9361504a merged in; the hashes in the description are older. The merge conflicted in findings.md only (both sides added a section at the end); both are kept.

What the review checked

  • No lost wake-up, deadlock or livelock found. A working thread looks at the queue under the lock before it waits, the pass-on is sent under the lock, and each thread past the count takes at most one wake-up before it parks.
  • The count is as described (slow processors less 4, at most 12, never fewer than LEONIDA_THIN_THREADS); an i5-12600K stays at 6 and machines with no slow cores keep their count.
  • cargo test -p leonida-gpu --lib --locked on the merged head: 742 passed, 0 failed, 60 ignored.

Changed (b58a2a0e4, wording only)

"Threads past the working count stay parked" was not exact. A thread already waiting for work when a turn of LEONIDA_AB lowers the count stays in that wait until a wake-up reaches it; it then passes the wake-up on and parks. The comment on Pool and the findings line say so now. Right after such a turn the starved time can read a little low for that reason.

Corrections to the description

  • The first by-turns runs (6 against 12 and 6 against 16) were standing in the world at 7,000-8,000 draws, as the findings section says, not walking. The later runs on the change alone (470 s) were walking.
  • "Unchanged" where all cores are alike holds for the number of threads. The ready-queue meter runs in every build, not only with diagnostics: one Instant::now() under the queue's lock when a recording is scheduled, one when it is taken, and two more for each wait, plus two or three atomic adds when the queue is not empty. I have not measured that cost on its own. If you would rather have the meter behind diagnostics, say so and I will move it.
  • The red step of a_wake_up_a_parked_thread_took_goes_on_to_a_working_one depends on which thread Windows wakes, so "fails in 10 of 10" is what happened here, not a guarantee. The green step passes whichever thread is woken.

🤖 Generated with Claude Code

A second read-only review of this branch (Claude Opus 5.5), and what changed for it. The head is now 1b3c0635c, with `main` a9361504a merged in; the hashes in the description are older. The merge conflicted in `findings.md` only (both sides added a section at the end); both are kept. **What the review checked** - No lost wake-up, deadlock or livelock found. A working thread looks at the queue under the lock before it waits, the pass-on is sent under the lock, and each thread past the count takes at most one wake-up before it parks. - The count is as described (slow processors less 4, at most 12, never fewer than `LEONIDA_THIN_THREADS`); an i5-12600K stays at 6 and machines with no slow cores keep their count. - `cargo test -p leonida-gpu --lib --locked` on the merged head: 742 passed, 0 failed, 60 ignored. **Changed (b58a2a0e4, wording only)** "Threads past the working count stay parked" was not exact. A thread already waiting for work when a turn of `LEONIDA_AB` lowers the count stays in that wait until a wake-up reaches it; it then passes the wake-up on and parks. The comment on `Pool` and the findings line say so now. Right after such a turn the starved time can read a little low for that reason. **Corrections to the description** - The first by-turns runs (6 against 12 and 6 against 16) were standing in the world at 7,000-8,000 draws, as the findings section says, not walking. The later runs on the change alone (470 s) were walking. - "Unchanged" where all cores are alike holds for the number of threads. The ready-queue meter runs in every build, not only with diagnostics: one `Instant::now()` under the queue's lock when a recording is scheduled, one when it is taken, and two more for each wait, plus two or three atomic adds when the queue is not empty. I have not measured that cost on its own. If you would rather have the meter behind `diagnostics`, say so and I will move it. - The red step of `a_wake_up_a_parked_thread_took_goes_on_to_a_working_one` depends on which thread Windows wakes, so "fails in 10 of 10" is what happened here, not a guarantee. The green step passes whichever thread is woken. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Contributor

A synthetic scheduler check could feed the same bursty command-list arrival trace to the default and wider worker pools. Hold list sizes and cache state fixed. Compare median and P99 completion time, the count above a fixed stall threshold, and the list_ready_starved_ns delta. This would test whether the wider pool reduces readiness starvation when arrivals are uneven.

AI-assisted with OpenAI Codex.

A synthetic scheduler check could feed the same bursty command-list arrival trace to the default and wider worker pools. Hold list sizes and cache state fixed. Compare median and P99 completion time, the count above a fixed stall threshold, and the `list_ready_starved_ns` delta. This would test whether the wider pool reduces readiness starvation when arrivals are uneven. AI-assisted with OpenAI Codex.
Contributor

I checked the offline ready-queue reader with two fully generated archives. In the first, the complete intervals covered one and three Presents. The time with ready work and no free worker was 4.0 and 0.0 ms per Present, respectively. Weighting by the four covered Presents returned 1.0 ms per Present.

In the second archive, one ready-queue report said LEONIDA_THIN_WIDE=0 while the capture declared 1. The reader rejected it. The two checks validate the metric and arm identification for the planned worker-pool comparison. Earlier proposed check

AI-assisted.

I checked the offline ready-queue reader with two fully generated archives. In the first, the complete intervals covered one and three Presents. The time with ready work and no free worker was 4.0 and 0.0 ms per Present, respectively. Weighting by the four covered Presents returned 1.0 ms per Present. In the second archive, one ready-queue report said `LEONIDA_THIN_WIDE=0` while the capture declared `1`. The reader rejected it. The two checks validate the metric and arm identification for the planned worker-pool comparison. [Earlier proposed check](https://git.leonida.now/leonida/mandy/pulls/3411#issuecomment-26260) AI-assisted.
Sign in to join this conversation.
No description provided.