Repository navigation
runtime: preserve CPU fence signal rewinds - #3279
wish131400 wants to merge 7 commits into
Conversation
R0Y00
left a comment
There was a problem hiding this comment.
Independent Release check on a5a92ea1: ctest --preset release --no-tests=error -V -R '^startup_(fence_values_(warp|hardware)|queue_wait_warp)$' passed 3/3. The 9 → 2 → 0 → 7 sequence matched the desktop fence, method and completion address on inbox WARP and RTX 4060 Laptop with the debug layer enabled.
The new publication breaks ordering with two CPU callers, even with no queue and with increasing values. If A's Signal(1) succeeds and A reads 1, A can pause before InterlockedExchange64. B's Signal(2) can then complete and publish 2, after which A publishes its stale 1. The native value stays 2, while the method and completion word can stay at 1 indefinitely. The previous atomic max avoided this regression for increasing CPU signals. This is a source-derived interleaving, separate from the queued rewind tracked in #3280.
Please serialize the native CPU signal and publication on each fence, or otherwise prevent stale CPU observations from overwriting newer ones. Add a controlled two-caller regression alongside the existing sequential rewind fixture. The queue follow-up can remain separate.
|
Thanks for the clear write-up and the sequential fixture. Could you address R0Y00's requested change before this merges? The head
The trial merge into current main is clean ( This comment was AI-assisted. |
Serialize native CPU Signal calls and cached completion publication per fence, and add a barrier-controlled two-caller regression. Register the WARP fixture in PR smoke tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…w-58fd6315 # Conflicts: # CMakePresets.json
|
I compared this head with #3350. This head still merges cleanly into main MUST SHOULD / NIT AI-assisted. |
|
Addressed the CPU publication ordering request at The test pauses A after capturing desktop value 1 and before its exchange, starts B at value 2, acknowledges B before its lock attempt, gives B a bounded interval, then releases A without waiting for B first. With the lock: B waits, final desktop/method/address = Debug and Release each passed 7/7 checks, zero skips, serially on WARP and RTX 4070 Ti SUPER, with the debug layer enabled. This includes the controlled and negative-control cases on both adapters, the existing sequential/stress checks, and The PR description contains the commands and environment. Please re-review this revision for the requested CPU ordering fix and controlled regression. CI for
I reproduced the identical triage failure from the unmodified main base |
CPU
ID3D12Fence::Signalcan rewind a fence. The previous atomic maximum left both the shim method and completion address at 9 after a CPU sequence9 -> 2 -> 0 -> 7. Publishing the observed value without serialization then allowed two CPU callers to publish out of order: A captures 1, B publishes 2, A publishes its stale 1.Serialize desktop Signal, GetCompletedValue and publication with a lock on each fence. Keep slot 8 and the slot 12 completion-address reads lock-free.
fence_reacheduses the same writer lock but retains its existing atomic-maximum queue semantics.This branch incorporates the serialization commits from #3350, preserving their author history, and resolves the CMake preset conflict against main
44a3ad5aa9c679cc039b8cb8275738dd6e4405d2. The controlled regression goes beyond the 128-pair barrier stress check: a test-only hook pauses A after the desktop observation and before publication, acknowledges B immediately before the writer lock, allows B 250 ms, then releases A without requiring B to complete first. Fixed behavior must finish at desktop/method/address2/2/2. The isolated test DLL can bypass the writer lock as a negative control, which succeeds only when the exact stale2/1/1outcome and all scheduling handshakes are observed. Each wait is bounded. The production DLL has no scheduling export or unlocked mode.Both fence executables and all three WARP cases are included in the PR build/test preset. Historical sequential results in the experiment notes are now distinguished from the new concurrent measurements.
Validation on Windows 10 Pro build 19045, MSVC 19.43.34810, D3D12 debug layer enabled, tests run serially:
ed554820bed30737fba887ee991611b8fd761e92; final documentation revision77b41d55. Debug was also rebuilt/rechecked at that final head.startup_queue_wait_warp.2/2/2. Negative control on both: B completed during the pause; desktop/method/address2/1/1.9, 2, 0, 7and 128-pair stress checks passed in both production and controlled fixtures.dumpbin /exportsconfirmed the scheduling hook is absent from the production DLL and present only in the isolated test DLL.ctest --preset pr --show-only=json-v1without an extra filter confirmed all three WARP cases are selected.python -B tests/docs_links_check.py,python -B tests/bidi_controls_check.pyandgit diff --checkpassed.Reproduction:
Refs #3280. Queue rewinds and delayed higher-target callbacks still need their own completion-order mechanism. The optional
--queue-rewinddiagnostic was repeated on WARP Release: desktop 3, method/address 7, expected diagnostic failure (exit 1), excluded from the passing count. A failed native Signal was not induced; the HRESULT guard remains code-reviewed. These fixtures do not establish full startup or frame rate. All inputs are source-built; no game or SDK assets are included.CI for
77b41d55completed: run 46369026117.startup_triage_run_check.py, reporting the missingan output UAV interval exceeds the D3D12 buffer view element limitallowlist entry.I reproduced the identical triage failure from the unmodified main base
44a3ad5a, using the test, tool and source inputs extracted directly from that commit. None of those files differ in this PR. Existing #3546 and #3559 already fix that exact upstream failure; #3542 also includes it. This PR does not duplicate those unrelated fixes. The Windows /O2 CI job is not selected for ordinary PR runs; Release coverage above was run locally.