runtime: preserve CPU fence signal rewinds (replacement for #3279) #3352

Open
opened 2026-11-28 11:27:39 +00:00 by github-bot · 1 comment
Owner

@⁠romn4rch on GitHub · 2026-11-28 11:26 UTC · original

Change

Replacement for #3281: serialize each fence's native CPU Signal, desktop completion observation, and cached-word publication with a per-fence SRW lock. The source-built fixture covers the 9 → 2 → 0 → 7 rewind sequence and 128 barrier-started two-caller signal pairs. The PR smoke-test filter includes startup_fence_values_warp. Current upstream main at 24fcd0b5742abb2fcaba8066093d70829df956a3 was merged with normal history (merge commit 95613c4f5); the original PR remains open and unchanged.

Verification

  • & .\tools\dev.ps1; cmake --preset dev; cmake --build --preset dev --target startup_fence_values startup_queue_wait --parallel 4; ctest --preset dev --no-tests=error -V -R '^startup_(fence_values|queue_wait)_warp$' — passed 2/2 on Microsoft Basic Render Driver (WARP), D3D12 debug layer enabled.
  • ctest --preset pr --no-tests=error -N -R '^startup_fence_values_warp$' — selected the fence WARP test (1 test).
  • python -B tests/docs_links_check.py — passed; checked 156 Markdown files and 674 links.

The full PR test suite and a post-merge hardware run were not run. CMake reported that Python-driven CTest registrations were disabled because out/pe-env/Scripts/python.exe is absent.

Evidence and follow-up

The fixture is source-built and compares the shim's completion method and address with its desktop fence. See the experiment note. It does not establish full-title startup. Queued rewinds and mixed CPU/queue producer ordering remain separate, unresolved behavior; no claim is made for those cases.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

Pull request details or commits were not available from GitHub; kept as an issue.

**@⁠romn4rch** on GitHub · 2026-11-28 11:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3350) ## Change Replacement for #3281: serialize each fence's native CPU `Signal`, desktop completion observation, and cached-word publication with a per-fence SRW lock. The source-built fixture covers the 9 → 2 → 0 → 7 rewind sequence and 128 barrier-started two-caller signal pairs. The PR smoke-test filter includes `startup_fence_values_warp`. Current upstream `main` at `24fcd0b5742abb2fcaba8066093d70829df956a3` was merged with normal history (merge commit `95613c4f5`); the original PR remains open and unchanged. ## Verification - `& .\tools\dev.ps1; cmake --preset dev; cmake --build --preset dev --target startup_fence_values startup_queue_wait --parallel 4; ctest --preset dev --no-tests=error -V -R '^startup_(fence_values|queue_wait)_warp$'` — passed 2/2 on Microsoft Basic Render Driver (WARP), D3D12 debug layer enabled. - `ctest --preset pr --no-tests=error -N -R '^startup_fence_values_warp$'` — selected the fence WARP test (1 test). - `python -B tests/docs_links_check.py` — passed; checked 156 Markdown files and 674 links. The full PR test suite and a post-merge hardware run were not run. CMake reported that Python-driven CTest registrations were disabled because `out/pe-env/Scripts/python.exe` is absent. ## Evidence and follow-up The fixture is source-built and compares the shim's completion method and address with its desktop fence. See [the experiment note](docs/experiments/fence-cpu-signal-values.md). It does not establish full-title startup. Queued rewinds and mixed CPU/queue producer ordering remain separate, unresolved behavior; no claim is made for those cases. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. _AI-assisted._ *Pull request details or commits were not available from GitHub; kept as an issue.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 11:27:39 +00:00
github-bot changed title from runtime: CPU fence rewind review follow-up to runtime: preserve CPU fence signal rewinds (replacement for #3279) 2026-11-28 11:38:11 +00:00
Author
Owner

@⁠JohnConnorNPC on GitHub · 2026-11-29 13:05 UTC · original

I reviewed ac685174 by reading the diff against main af1cab5c; I built and ran nothing. git merge-base --is-ancestor a5a92ea1 ac685174 is true, so this branch carries #3281 unchanged and supersedes it. CI at this head ran the new test: the Windows job shows startup_fence_values_warp ... Passed and 100% tests passed out of 74. On an export of the head, tests/docs_links_check.py (Checked 156 Markdown files and 674 links.) and tests/bidi_controls_check.py pass. Leyukaka's and lukaslw-lab's points still stand, and I don't repeat them here.

Please rebase. git merge-tree --write-tree origin/main ac685174 still conflicts in CMakePresets.json only, because main has added more entries to the pr targets and filter since.

MUST

  1. The two-caller loop still doesn't pin the lock, as Leyukaka worked through. A controlled two-caller test was the second half of R0Y00's change request on #3281, so I'd treat this as blocking until a pause-and-release test, or an equivalent, is in.

SHOULD
2. The change applies to every fence on every path, with no opt-in. A CPU Signal below the published word now lowers the word the title polls through slot 12; main kept the maximum. That matches the D3D12 contract, but nothing shows whether a loading run ever rewinds a fence. fence_signal logs nothing, so a run can't show how often its result now differs from main's. A count of successful CPU signals whose published value is below the previous word would answer that, either in the heartbeat or as a first-calls log line.
3. The "Measured result" section doesn't say whether its table was measured with the lock and the two-caller loop. The date, base 240e0fb9, compiler and both rows (WARP and RTX 4070 Ti SUPER) are unchanged from #3281. Yet the section now says "These results cover the CPU signal contract and a two-caller barrier regression". The body reports only a WARP run at this head and says no post-merge hardware run was done. Please name the commit each row was measured at, or re-measure the table at this head.

NIT
4. "A later or equal callback retains the existing value through the same publication path" is hard to follow. fence_reached keeps the larger of the word and the callback's value, under the same lock. Saying that directly would be clearer.

AI-assisted.

**@⁠JohnConnorNPC** on GitHub · 2026-11-29 13:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3350#issuecomment-7256277031) I reviewed `ac685174` by reading the diff against main `af1cab5c`; I built and ran nothing. `git merge-base --is-ancestor a5a92ea1 ac685174` is true, so this branch carries #3281 unchanged and supersedes it. CI at this head ran the new test: the Windows job shows `startup_fence_values_warp ... Passed` and `100% tests passed out of 74`. On an export of the head, `tests/docs_links_check.py` (`Checked 156 Markdown files and 674 links.`) and `tests/bidi_controls_check.py` pass. Leyukaka's and lukaslw-lab's points still stand, and I don't repeat them here. Please rebase. `git merge-tree --write-tree origin/main ac685174` still conflicts in `CMakePresets.json` only, because main has added more entries to the `pr` targets and filter since. **MUST** 1. The two-caller loop still doesn't pin the lock, as Leyukaka worked through. A controlled two-caller test was the second half of R0Y00's change request on #3281, so I'd treat this as blocking until a pause-and-release test, or an equivalent, is in. **SHOULD** 2. The change applies to every fence on every path, with no opt-in. A CPU Signal below the published word now lowers the word the title polls through slot 12; main kept the maximum. That matches the D3D12 contract, but nothing shows whether a loading run ever rewinds a fence. `fence_signal` logs nothing, so a run can't show how often its result now differs from main's. A count of successful CPU signals whose published value is below the previous word would answer that, either in the heartbeat or as a first-calls log line. 3. The "Measured result" section doesn't say whether its table was measured with the lock and the two-caller loop. The date, base `240e0fb9`, compiler and both rows (WARP and RTX 4070 Ti SUPER) are unchanged from #3281. Yet the section now says "These results cover the CPU signal contract and a two-caller barrier regression". The body reports only a WARP run at this head and says no post-merge hardware run was done. Please name the commit each row was measured at, or re-measure the table at this head. **NIT** 4. "A later or equal callback retains the existing value through the same publication path" is hard to follow. `fence_reached` keeps the larger of the word and the callback's value, under the same lock. Saying that directly would be clearer. AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No milestone
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/R0Y00--Xbox2Windows#3352
No description provided.