d3d12: the contended-lock test waits for the holder, not for a thread to start (GPU-TIMELINE-REPORT-WAIT-HANDSHAKE) #3050
Open
github-bot
wants to merge 1 commit from
github-bot/gh-3050 into main
AGit
pull from: github-bot/gh-3050
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!3050
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3050"
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?
@Neutron-0 on GitHub · 2026-12-02 05:38 UTC · original
Neutron-0:fix/timeline-report-wait-handshake→main· +88 −19 · 1 files · 1 commits · openClaimed in the coordination issue as: GPU-TIMELINE-REPORT-WAIT-HANDSHAKE
What and why
real_waits_are_recorded_with_who_ended_them(d3d12/crates/leonida-gpu/src/timeline/report.rs, tests) holds a mutex, spawns a thread that is to block on it, sleeps a fixed 20 ms so that the thread has reachedlock.lock()by then, lets go, and asserts that the trace recorded a wait of 10 ms or more naming this thread as the waker.The 20 ms is a bet on the scheduler. On a loaded machine the new thread has not been started inside it, so it acquires the lock at once, no wait of 10 ms or more exists, and the assert fails with
left: Noneagainstright: Some(this thread). Measured onmain60f7dcd: 3 failures in 40 whole-suite runs ofcargo test -p leonida-gpu --lib --features diagnostics. The failing line is the assert, not the recorder: the recorder had nothing to name because there was no wait.The test is under the diagnostics feature, so the default
--librun does not compile it; it is the run the layer's own diagnostics build uses.What changed
standing()counter for that lock says that the wait has been reached (the wrapper takes the counter before it waits), and only then does this thread start its hold of 30 ms. The wait is therefore the holder's hold and not the time the waiter took to arrive: however late the waiter is woken up, the wait is 30 ms.lastis still taken before the contention, so none of this enters the chain.Verification (CPU-only, no game files, no GPU)
On this head, based on
main0ae5a2664(the branch's base; it merges cleanly into the currentmainba9e65cec):left: None,right: Some(27892)- the flake, every time.Trace::wakermade to returnNone, this test fails, since the chain is built from the wakes.cargo test -p leonida-gpu --lib --locked --features diagnostics): 3 runs on this head - two clean, 749 passed and 0 failed, 59 ignored each, and one withwatch.rs's known parallel race (watch::many_askers_tests::no_mapping_is_lost_between_askers, claimed underD3D12-GPU-TEST-PARALLEL-FLAKES), 748 passed and 1 failed. This test failed in none of them. The stock test failed in this suite 3 times in 40 runs onmain60f7dcd.descriptor.rs'srecords_copied_as_bytes_are_made_at_the_next_sync, the parallel raceD3D12-GPU-TEST-PARALLEL-FLAKEScovers (claimed by lixonik); one run with the same item'swatch.rsrace; one run withtexture.rs'salias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers, the parallel race #2854 fixes. Fifteen parallel runs in all, and this test failed in none of them.cargo test -p leonida-gpu --features diagnostics --lib timeline::report -- --test-threads=1: 6 passed, 0 failed, 59 ignored.cargo test -p leonida-gpu --lib --locked): 667 passed, 1 failed, 59 ignored. The failure wastexture.rs'salias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers, the parallel race #2854 fixes; it passes alone (6 passed, 1 ignored) and is not this test.cargo clippy -p leonida-gpu --lib --features diagnostics --tests: nothing in this file.What this does not do
It does not serialise the suite and does not touch the other parallel races in this crate (
watch.rs,descriptor.rs,texture.rs,pool.rs), which are claimed elsewhere. It changes only this test, so it would also stand if the suite were serialised later: this test's wait is no longer a thing to hide.Notes
The repository's own workflows ran on this head in the contributor's fork, where no maintainer's approval is needed, and they are green:
check,linux-python-and-viewerandsemantic-testssuccess,d3d12 (windows-latest)success (CI 47158599080; No Game Data 47158606629; D3D12 runtime 47158614758).change-scopeis the one job that cannot be produced that way: it only runs on apull_requestevent, so it needs the base repository's run.Checklist
main0ae5a2664(the branch's base); the branch merges cleanly into the currentmainba9e65cec.python -I scripts/check_no_game_data.pyclean.GPUs tested: n/a (a CPU-only test of the diagnostics recorder; it needs no GPU and no game files)
AI-assisted: yes - MiniMax M3.1 Flash (NVIDIA, via OpenCode) wrote the change, with independent read-only review agents (GLM-5.3 Flash via NVIDIA, Kimi K3.1 Pro via NVIDIA, and DeepSeek V4.1 Flash Free via OpenCode) and human reviews on this pull request.
@ecox982745 on GitHub · 2026-12-02 05:42 UTC · original
CPU-only review at
82e4a68b9. The handshake fixes a holder that starts late. It still permits the waiter to be descheduled after the holder signals and before the waiter attemptslock.lock()(timeline/report.rs:1463). If the holder runs its 30 ms sleep and releases the lock during that interval, the waiter acquires immediately and the new 10 ms assertion fails. The 30 ms holder-start perturbation exercises a different schedule.I checked the schedule in a small CPU-only model of the mutex and condvar handoff. Six ordinary attempts waited about 31 ms. Six with the waiter held until the release acquired in at most 0.001 ms. This models the synchronization sequence. The Rust trace test itself was not executed. A contrived delay immediately before the wait timer would exercise the remaining window in the Rust test.
The trace lookup also runs after
second.join(). If the holder is descheduled between dropping the lock and returning from the thread,max_by_key(|w| w.t1)can select the join wait. Consider timestamping the lock call with the trace clock and restricting the lookup to that interval. For the minimum-duration assertion, a bounded retry of an attempt where there was no measured lock contention would distinguish an unlucky schedule from attribution failure.AI-assisted review. No GPU or game files used.
82e4a68b93to3f6545b0be@Neutron-0 on GitHub · 2026-12-02 06:06 UTC · original
One review round found a second way for this test to fail, and it is fixed in this head (
3f6545b0b).The join below is a wait of its own: the wrappers record it like any other wait of this thread. If the worker is slow to exit, that wait is later than the wait for the lock and is at least 10 ms long, so the assertion could pick it - and a join names no waker, so it failed with
left: None, the same shape as the flake this pull request removes. The ticks are now taken before the join and the waits are bounded by them, so the wait for the lock is the one that is measured.Measured here: with 30 ms between the holder's release and its exit, this head passes, and the head without the bound fails with
left: None.The wait for the holder's word is bounded as well (two seconds), so a holder that never takes the lock fails the test instead of hanging it.
On this head: whole diagnostics suite 2 runs, 749 passed and 0 failed each; the test itself 20 of 20 runs; default suite 668 passed, 0 failed.
@Neutron-0 on GitHub · 2026-12-02 06:19 UTC · original
One practical note on #3050: its three workflow runs (
D3D12 runtime,CI,No Game Data) are ataction_requiredon the head3f6545b0b. A fork run of a first-time contributor needs a maintainer to approve it before the jobs run; approving them would let the checks run. The same was asked for #2864's runs.@MoonEyes on GitHub · 2026-12-02 12:39 UTC · original
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
@Kal0s-design on GitHub · 2026-12-02 14:47 UTC · original
Ran natively on Windows 11, head
3f6545b0bmerged into currentmain(2fc7383b9, clean merge), debug build,--locked.cargo test -p leonida-gpu --lib --features diagnostics, 3 runs (LEONIDA_D3D12_WARP=1, so the suite's few GPU tests ran on WARP only)cargo test -p leonida-gpu --libcargo clippy -p leonida-gpu --all-targets --features diagnosticstimeline/report.rs(the findings it reports are elsewhere and already onmain)Repeat counts. I built two diagnostics test binaries from the same merged tree. One has
main's version of the test and one has this head's. Each run launches the test binary as its own process with onlyreal_waits_are_recorded_with_who_ended_themselected.maintestAll 200 failures on
mainunder load wereno entry found for keyattrace.waits[&second]. The spawned thread recorded no waits at all: it was not scheduled within the 20 ms, so it never blocked on the lock. That is the same root cause as theleft: Nonefailure in the description, just one line earlier. Without the added load neither version failed on this machine, so the flake here needs load.Can it hang? No. With a throwaway variant where the holder never sets the flag or notifies, the test fails after 2.05 s with
the holder did not take the lock within two seconds.The window from the earlier review is real, but the load did not hit it. With a throwaway variant that sleeps 40 ms between the holder's notification and
let blocked = Instant::now(), the test failed (one run) withthis thread was to wait on the lock, and waited 11.3µs. So a waiter that is descheduled after the holder's word can still fail, as the earlier review described. It now fails at the new duration assertion with a clear message, not at the attribution. Under the 48-process load above that never happened in 200 runs. Reading the code (I only ran the 40 ms delay), the waiter blocks for about 30 ms minus its own delay, and the assertion needs 10 ms. So a delay of about 20 ms betweenwait_timeoutreturning andlock()is enough to fail. That margin is about the same size asmain's 20 ms bet. The difference is which delay it is: a woken thread that already exists has to lose 20 ms, wheremainneeded a new thread to start within 20 ms. Under this load the second happened every time and the first never did. A longer holder sleep (e.g. 100 ms) would widen the margin for slower CI machines, at the cost of test time.Not checked: CI runners, a heavier or real-time-priority load, loads other than CPU spinning (I/O, memory), the whole diagnostics suite under load.
GPUs tested: WARP only for the suite (the test this PR changes is CPU-only).
AI-assisted: yes (Claude Code).
@merzleckeier on GitHub · 2026-12-02 14:55 UTC · original · reviewed
I reproduced the late-waiter case on
3f6545b0merged ontoacc350745under Wine 11.22. A 70 ms delay after the holder signalled and before the waiter calledlock()let the 30 ms hold expire. The duration assertion then measured 400 ns, consistent with the earlier native Windows result. Previous verificationA local test-only variant removed that dependency. It armed a flag for the specific waiter thread immediately before the contended
lock(). The existing recorderstanding()hook signalled that the thread reached the instrumented wait. Only then did the holder start the measured 30 ms hold, with a two-second bound for a missing wait. The same 70 ms perturbation passed 3/3, including the assertion that the holder was the waker. This keeps the Rust mutex and tests the actual wait rather than increasing the scheduler allowance.The binaries in this probe had no debug symbols, so the local variant checked that the stack sites existed and left symbol-name resolution outside the measurement. No production code was changed. AI-assisted with OpenAI Codex.
3f6545b0beto6a674a118d@Neutron-0 on GitHub · 2026-12-02 15:28 UTC · original
Second review round, two findings, both fixed in
6a674a118.The wait that was measured could have been the wrong one. The condvar's wait is ended by the same holder that holds the lock, so it names the same waker, and the earlier shape took the latest wait of 10 ms or more - which could be that one. With a holder that waits 10 ms before it signals and keeps the lock for 1 ms, the lock's own wait is 1 ms and the condvar's is 10 ms: the earlier shape picked the condvar's wait, saw the holder as its waker and passed, while the lock's wait was never checked. The wait is now pinned by the ticks around the lock call - the one inside a try's own ticks - and it has to be 10 ms or more. With that same holder the test now fails and says so: "no try of the five waited on the lock for 10 ms or more".
The timing bet was moved, not removed. If the machine does not wake the test thread up inside the holder's 30 ms, the lock is free before the test thread asks for it and there is no wait at all - the same class of failure as the one this pull request removes. The holder is now started again and the try repeated, five tries at most, and the test fails only when none of them waited. Measured: with the first try asking for the lock 40 ms after the holder let it go, this head passes and the same head with one try fails.
Also: the first half's gate wait is bounded by two seconds now, like the new one, so a worker that dies fails the test instead of hanging it.
On this head: the test 20 of 20 runs; whole diagnostics suite 2 runs, 749 passed and 0 failed each; default suite 667 passed, 1 failed -
texture.rs's known race (#2854), which passes alone and is not this test.@Neutron-0 on GitHub · 2026-12-02 17:29 UTC · original
Third round, and the late-waiter window that @merzleckeier reproduced and @Kal0s-design measured is now closed by the recorder itself. New head
1c1f92f80.What changed. The holder takes the lock first and keeps it. The waiter waits for the word that says so, asks for the lock and blocks inside it. The recorder's own
standing()counter for that lock then says that the wait has been reached - the wrapper takes that counter before it waits (hooks.rs:52-58) - and only then does the holder start its hold of 30 ms. So the wait is the holder's hold and not the scheduler's: however late the machine wakes the waiter up, the wait is 30 ms.The counter is a hash of the address into 4096 slots (
record.rs:1422-1428), so another object can share the slot and the holder may see the wait before it is really there. The try is then made again, three tries at most, and the test fails only when none of them waited.The perturbations both of you used, on this head. The waiter asks for the lock 70 ms late (merzleckeier's delay) - and I put that delay on every try, not only the first: the test passes. The wait cannot be shortened by a late waiter any more, because the hold does not start before the recorder says the wait has begun.
The other hole the second review found is closed too. The wait that is measured is the one inside a try's own ticks (the ticks around the lock call), so the join - a wait of its own - and the first half's condvar wait cannot be mistaken for it. With a holder that keeps the lock for 1 ms, so the wait it measures is too short, the test now fails and says what the trace holds:
no try of the 3 waited on the lock for 10 ms or more: [Some(1.2785), Some(1.1458), Some(1.1336)] ms. Those are the recorded waits, not the wall clock around the lock call - the earlier message mixed the two up, which made it read as a contradiction.The 10 ms floor is a liveness floor, not a filter, and the comment says so: a wait of a few microseconds is the lock being free, and is not recorded at all.
@MoonEyes, on the in-game run. This pull request changes one test function inside
#[cfg(test)]ind3d12/crates/leonida-gpu/src/timeline/report.rs, and the whole diff is that one file. There is no product code in it: the recorder, the wrappers and the report are untouched, so nothing here can change what the title renders, and there is nothing in it for an in-game run to catch. The test itself only compiles with--features diagnostics(timeline.rs:42-47), so the default CI job does not build it either. If a maintainer still wants a run on this head, that is their call - I have no game files here.On this head: the test 20 of 20 runs; whole diagnostics suite 2 runs, 748 passed and 1 failed then 749 passed and 0 failed - the failure was
texture.rs's known parallel race (#2854), which passes alone and is not this test; default suite 668 passed, 0 failed; clippy says nothing in this file.@MoonEyes on GitHub · 2026-12-02 18:00 UTC · original
Code review of the new head
1c1f92f80(third round, pushed 17:29 UTC today; merge base0ae5a2664, merges cleanly into currentmain45dc41f95). Not built:leonida-gpu's timeline hooks are Windows-only. No CI run exists on this head yet; the Windows runs in this thread are on3f6545b0band6a674a118, not on this head.What changed in this round: the holder takes the lock, sets
taken, then spins onrecord::stood_at(object)(the recorder's per-objectSTOOD_ATcounter,record.rs:1426-1449, incremented byhooks::waitbefore the real wait,hooks.rs:52-58) before it starts its 30 ms hold. Three tries, the first one with a wait of 10 ms or more inside its own[at, locked]ticks must name the holder as waker. That removes the scheduler bet that @ecox982745 and @merzleckeier showed for the earlier heads: the hold only starts once the waiter is provably inside the wait.Points to check on Windows before merge
objectassumes the stdMutex's futex word sits at theMutex's own address.let object = &*lock as *const Mutex<()> as u64;is compared with the addresshooks::waitreceives, which for a contendedstd::sync::Mutexis the address of its internal futex passed toWaitOnAddress.std::sync::Mutex<T>is{ inner: sys::Mutex, poison: Flag, data }withoutrepr(C), so the field order (and thus whether the futex is at offset 0) is the compiler's choice, andplace()is a Fibonacci hash of the exact address, so a 1-byte offset lands in another slot. If it does not match, every try returnsNoneafter 2 s and the test fails with "the waiter did not reach the lock's wait". It passes for the author on 1.98.1, so it probably holds today, but it rests on std internals. A one-line note in the test, or derivingobjectfrom a recorded wait rather than from theMutexpointer, would make that explicit.TEST_GLOBAL_LOCK, the only other standing waits during the try are this test's own threads, so the retry is enough.Relation to #2933: both PRs fix the same flaky test (
real_waits_are_recorded_with_who_ended_them) under different claim IDs. #2933 still sleeps 50 ms after areadyflag that is set beforelock(), so its waiter can be descheduled between the flag and the lock: the same window this PR closes. Only one should land; this one is the stronger fix.Not run here. Before merge: one Windows run of
cargo test -p leonida-gpu --features diagnostics --lib timeline::report -- --test-threads=1and the full-parallel run on1c1f92f80merged ontomain, ideally repeated (it is a flake fix), plus the CI approval.Verdict: ready pending a Windows run on the current head (no defect found in the code; the open point is the std-layout assumption in 1).
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@Neutron-0 on GitHub · 2026-12-02 18:07 UTC · original
Fourth round: the roles are the stock ones again, and the wording now says only what the code does. New head
6934967a0.What changed since the last round. The test thread is the holder again, as in the original test: it takes the lock, spawns the waiter, and the waiter asks for the lock and blocks inside it. The recorder's
standing()counter for that lock says when the waiter has reached that wait, and only then does the holder start its hold of 30 ms. So:The key the test uses is the mutex's own address. A temporary probe showed that the recorded wait's
objectfield equals it exactly, and the selection now filters on that object, so a wait on something else cannot be measured by mistake.The waits are still three samples, not three retries: the counter is a hash of the address into 4096 slots and the recorder is process-wide, so another waiter or a timer can share the slot and the hold can begin before the waiter is really there. The test fails only when none of the three waited, and the failure message says how many samples the recorder reported at the lock's object:
Those are the recorded waits, not the wall clock around the lock call - the earlier message mixed the two up, which made it read as a contradiction.
The perturbations both of you used, on this head. The waiter thread starts 70 ms late (merzleckeier's delay) - I put that delay on every sample, not only the first: the test passes. The wait cannot be shortened by a late waiter any more, because the hold does not start before the recorder says the wait has begun.
On this head: the test 20 of 20 runs; whole diagnostics suite 2 runs, 749 passed and 0 failed both times; default suite 667 passed, 1 failed - the known
texture.rsparallel race (#2854), which passes alone and is not this test; clippy says nothing in this file.6a674a118dto6934967a01@MoonEyes on GitHub · 2026-12-02 22:01 UTC · original
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
@fiestorra on GitHub · 2026-12-02 22:30 UTC · original
VERIFY-3050 — Windows nativo: 15 pruebas del informe pasan, y la trampa de
diagnosticsotra vez(this PR)0ae5a2664(behindmainb41763227)main—merge-treeclean,git merge --no-ffcleanRan
The trap, recorded because it bit me twice tonight (#3005 was the other):
mod reportis#[cfg(all(windows, feature = "diagnostics"))](timeline.rs:46). Without--features diagnosticsthe module is not compiled, andcargo test -p leonida-gpu --lib reportanswers0 passed; 762 filtered outwith exit 0 — a verifier would record "no tests" for fifteen.What the change is: the stall-report test's worker wait is now a bounded one —
— so a worker that never signals fails the test in two seconds instead of hanging the suite, which is what the old blocking
waitdid. The contended-lock part of the test is reworked with it.Negative control (synthetic): I set the timeout to
Duration::ZEROso the wait expires at once:The assertion is live and its message is accurate — the worker does not finish within a zero-length wait. What I did not build is the honest other half: the unbounded wait with a worker that never signals, because that control hangs the runner (which is precisely the failure this PR removes) and needs a harness timeout to observe.
What I could not test
diagnosticssuite: 828 filtered out — only the report module was run under the feature.Written with an AI assistant.
@MoonEyes on GitHub · 2026-12-03 00:38 UTC · original
RUN (in game, batch of three pull requests), each head merged with
git merge --no-ffonto maind5b30be1c, in one build: #29119a2e9f607, #2995a2cd1dda5, #30506934967a0. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. #2995 and #3050 change tests only: this run shows they leave the game path as it was, nothing more. #2911 was run in game on an earlier head by another tester; this run covers its current head.AI-assisted (Claude Code).
@merzleckeier on GitHub · 2026-12-03 00:59 UTC · original · reviewed
I rebuilt
6934967amerged ontod5b30be1with Rust 1.98.1 and Windows MSVC, then ran it under Wine 11.22 with the original adjacent PDB. All sixtimeline::report::tests::tests passed on the unmodified source, including the symbol-name and waker assertions. In a disposable copy, delaying every waiter by 70 ms beforelock()also passed 3/3. The subsequent #3230 merge to1a163523changes the launcher, docs and launcher tests. The #3050 merge remains clean and its Rust sources and Cargo inputs are identical across those two bases.One remaining case is reproducible. I used the same delay and held a
record::standing()guard for a different synthetic object in the same bucket for all three samples. It failed 3/3 with recorded lengths["-", "-", "-"], while the diagnostic reported the waiter at the object in all three samples. Each sample uses the same mutex address and therefore the same bucket. A single long-lived collision can make all three holds start before their waiter reaches the lock.This is a test-only false negative under the forced collision. A test-only per-waiter signal from the actual
standing()call would make the handshake independent of the shared bucket and preserve the existing trace assertions. All probes were synthetic. AI-assisted with OpenAI Codex.6934967a01tof95dc32243@Neutron-0 on GitHub · 2026-12-03 05:42 UTC · original
Windows run report on the current head (
f95dc3224), as asked.f95dc3224. It merges cleanly into the currentmain45dc41f95(git merge-treewrites a tree with no conflict; the branch's base is0ae5a2664).d3d12/rust-toolchain.tomlpins). No GPU and no game files are used by this test: it is the diagnostics recorder's own test, on the CPU.cargo test -p leonida-gpu --features diagnostics --lib timeline::report -- --test-threads=1: 6 passed, 0 failed, 59 ignored, 1.20 s.cargo test -p leonida-gpu --lib --locked --features diagnostics):descriptor::tests::records_copied_as_bytes_are_made_at_the_next_sync, the known parallel race indescriptor.rsthatD3D12-GPU-TEST-PARALLEL-FLAKEScovers (claimed by lixonik); it is not this test6934967a0, the same test with only the note below added since): four runs clean, one with the knownwatch.rsrace (watch::tests::a_write_opens_the_view_it_goes_through, the same item). Ten parallel runs in all, and this test failed in none of them.On your point 1 (the std-layout assumption). The head now filters the measured wait on the recorder's own object, so a different layout cannot be measured by mistake, and the failure message says how many samples the recorder reported at the lock's object - none of them if the key is wrong. The assumption is written down in the test as well:
About the in-game run in your first comment: this pull request changes one test function inside
#[cfg(test)]ind3d12/crates/leonida-gpu/src/timeline/report.rs, and the whole diff is that one file. There is no product code in it - the recorder, the wrappers and the report are untouched - so it cannot change what the title renders, and there is nothing in it for an in-game run to catch. The test only compiles with--features diagnostics, so the default CI job does not build it either. I have no game files here, so I cannot post a run in the world; if you want one on this head anyway, that is your call.f95dc32243to8563205280@Neutron-0 on GitHub · 2026-12-03 06:09 UTC · original
Head moved to
856320528- the only changes since the head MoonEyes ran in game (6934967a0) are three comments and the wording of one assertion message; no code path changed.report.rs:1457-1460: the note on the recorder's key for the lock (the one MoonEyes asked for).report.rs:1473-1475: the comment on the two-second bound now says what is true - a waiter that never arrives is reported as not reached instead of hanging the spin, and the join below still waits for the waiter to finish, which it does once the lock is released.report.rs:1521-1522: the failure message now says "the recorder's counter saw the waiter's key in N of them" instead of "the recorder reported the waiter at the lock's object in N of them" - in the case where the standard library's layout moves the wait primitive, the recorder did record the wait, just under another key, so the old wording was not exact.Those are the two optional findings of the fifth review round (GLM-5.3 Flash via NVIDIA, verdict PASS-with-nits, no must-fixes). The third optional finding (a named struct instead of a 4-tuple) and the fourth (the 4096-slot table can make
released()record a phantom wake) are test-local and deliberately left alone; the second is inrecord.rs, which this pull request does not touch.Windows run report on
856320528856320528. It merges cleanly into the currentmaind9b618f10(git merge-treewrites a tree with no conflict; the branch's base is0ae5a2664).d3d12/rust-toolchain.tomlpins). No GPU and no game files are used by this test: it is the diagnostics recorder's own test, on the CPU.cargo test -p leonida-gpu --features diagnostics --lib timeline::report -- --test-threads=1: 6 passed, 0 failed, 59 ignored, 1.19 s.cargo test -p leonida-gpu --lib --locked --features diagnostics):texture::alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers, the parallel race #2854 fixes; it is not this testWith the five runs on the previous head and the five before that, fifteen parallel runs of the suite over three heads of this branch, and this test failed in none of them. The three failures were each a different known parallel race in this crate (
descriptor.rs,watch.rs,texture.rs), all claimed elsewhere -D3D12-GPU-TEST-PARALLEL-FLAKEScovers the first two and #2854 the third.8563205280to47d95f543c@Neutron-0 on GitHub · 2026-12-03 12:57 UTC · original
@merzleckeier - the case you forced is fixed in the new head, and your probe is what shows it.
What you forced. A
record::standing()guard for a different object in the same bucket of the recorder's table, held for the whole test, and a waiter 70 ms late. Every sample used the same mutex, so every sample shared one bucket: the holder's hold began before the waiter was really inside the wait, and the test failed 3 of 3.What changed. Each sample has a lock of its own now:
The recorder's key is computed per sample, and the trace filter uses that sample's key (
w.object == *object). The three locks are alive at the same time, so their addresses differ and their buckets differ. A collision of your kind now reaches one sample and not all of them, and the test fails only when none of the samples waited.Your probe on both heads. The probe is a test-only change: a standing guard for a different object in the same bucket as the first lock, held for the whole test, plus the 70 ms delay on the waiter.
856320528: FAILED,no sample of the 3 waited on the lock for 10 ms or more: ["-", "-", "-"] ms; the recorder's counter saw the waiter's key in 3 of them- the same shape you reported.47d95f543: ok, 5 of 5 runs.On the per-waiter signal you propose. A signal from the actual
standing()call is the clean fix, but it has to come from the recorder:record::standing()counts per hash bucket, and only the recorder knows which thread stood there. Making it per waiter is a change inrecord.rs, which is not test code, and this pull request is test-only on purpose - that is what keeps @MoonEyes's in-game gate on solid ground ("nothing in it can change what the title renders"). I did not want to widen this pull request's scope for it, so I made the samples independent of each other instead.If you want the recorder-level signal, say so and I will do it as a separate pull request: a
d3d12:one, with the recorder change and a test of its own.On the head.
47d95f543is the new head. Since the head @MoonEyes ran in game (6934967a0) the changes are three comments, the wording of one assertion message, and this per-sample-lock change - still only test code, and the whole diff is still the one file.Evidence on the new head (Windows 11, AMD 780M iGPU, Rust 1.98.1; no game files and no GPU are used by this test):
cargo test -p leonida-gpu --lib --locked --features diagnostics timeline::report::tests::real_waits: 20 of 20 runs ok.cargo test -p leonida-gpu --lib --locked --features diagnostics): 3 runs - two clean, 749 passed and 0 failed, 59 ignored each, and one withwatch.rs's known parallel race (watch::many_askers_tests::no_mapping_is_lost_between_askers, claimed underD3D12-GPU-TEST-PARALLEL-FLAKES), 748 passed and 1 failed. This test failed in none of them.cargo clippy -p leonida-gpu --lib --features diagnostics --tests: nothing in this file (the crate's 10 warnings are in other files, on this old base).AI-assisted: yes (MiniMax M3.1 Flash via OpenCode wrote the change; separate read-only review agents audited it).
@merzleckeier on GitHub · 2026-12-03 12:58 UTC · original
Thanks, the test-only change resolves my review point. I rechecked
47d95f54onmainb053a181with Rust 1.98.1 targeting Windows MSVC under Wine 11.22. The unmodified build passed all 17 timeline tests, including the symbol-name and waker assertions.For the collision, I built a separate test copy of each head on the same base. One synthetic object occupied the first lock’s recorder bucket. In any sample where that bucket was already occupied, I held the waiter until after the holder released its lock. This makes the false signal deterministic without relying on a fixed startup delay.
6934967a: all three samples saw the occupied bucket and the original assertion failed in 3/3 runs.47d95f54: only the first sample saw the occupied bucket. The existing assertion found a wait of at least 10 ms and attributed it to the correct waker in 5/5 runs.These runs exercised the CPU diagnostics on the current head. AI-assisted (Codex).
@Neutron-0 on GitHub · 2026-12-03 17:25 UTC · original
The three workflow runs on this head are waiting for a maintainer's approval. They are
action_required- a fork run of a first-time contributor waits for one: 47109751347 (CI), 47109751317 (No Game Data) and 47109751091 (D3D12 runtime), all on head47d95f54.The same workflows ran on this exact head in the contributor's fork, where no approval is needed, and they are green:
checksuccess,linux-python-and-viewersuccess,semantic-testssuccessno-game-datasuccessd3d12 (windows-latest)successchange-scopeis the one job that cannot be produced that way: it only runs on apull_requestevent (ci.yml:34), so it needs the approval itself.@merzleckeier has re-verified this head independently: the unmodified build passes all 17 timeline tests on
mainb053a181with Rust 1.98.1 targeting Windows MSVC under Wine 11.22, and the probe that forces the recorder's bucket collision fails 3/3 on the old head and passes 5/5 on this one.Approving the runs (or merging) would let this account open its next pull request: GitHub allows it one open pull request while it is a first-time contributor, and this one holds the slot.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.