Scripts: require a cursor update when finding record writers #1720

Open
jeroenhaentjens wants to merge 1 commit from upstream-pr/1730 into main
jeroenhaentjens commented 2026-11-24 20:00:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jeroenhaentjens on 2026-11-24T20:00:03Z.


record_writers.py counted a matched bounds check as a record writer even when the cursor store appeared only after a return or at a forward fallback target. Stop the scan at those boundaries and count a site only if its fast path stores the updated cursor.

What is in it

  • Restrict the scan in scripts/re/record_writers.py. Add regressions for both boundaries and document the rule.

Tested

  • Windows 11 Pro 26200, Intel i7-9750H, 32 GB RAM, NVIDIA Quadro RTX 3000 (driver 32.0.15.9706), Rust/Cargo 1.100.0 MSVC, DXC 1.9.2609.5, debug builds without debug symbols or incremental compilation.
  • Local commit c5788f8b098e099ee45914d1b83396de23434e21 and GitHub head 3c891ac137177c9e76d4ce9c96ceb2016f9adcff have the same Git tree and parent. The runs used the local commit.
  • cargo build --workspace --locked passed. cargo test --workspace --locked --no-fail-fast -- --test-threads=4 reported 863 passed, 0 failed, 42 ignored. XCL_ADAPTER=nvidia and XCL_HEAP_WINDOWS=1. The bundled title tests passed.
  • Two wave64 skips counted as passes by Cargo: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • python -B -m unittest discover -s scripts -p 'test_*.py' passed all 17 tests. Before the fix both synthetic listings reported one false site. After it both report zero, and the existing positive cases still report one.

Regression run

  • Script, test and documentation change.

Not tested

  • Native wave64 hardware, the 42 explicitly ignored tests and real game/SDK data. No XCL_SAMPLE_* inputs were supplied.

AI use

  • Codex (gpt-6.2-sol) investigated, wrote the change and regression test, ran the tests and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5479371848 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1730). Originally posted by [jeroenhaentjens](https://github.com/jeroenhaentjens) on 2026-11-24T20:00:03Z. --- `record_writers.py` counted a matched bounds check as a record writer even when the cursor store appeared only after a return or at a forward fallback target. Stop the scan at those boundaries and count a site only if its fast path stores the updated cursor. **What is in it** - Restrict the scan in `scripts/re/record_writers.py`. Add regressions for both boundaries and document the rule. **Tested** - Windows 11 Pro 26200, Intel i7-9750H, 32 GB RAM, NVIDIA Quadro RTX 3000 (driver 32.0.15.9706), Rust/Cargo 1.100.0 MSVC, DXC 1.9.2609.5, debug builds without debug symbols or incremental compilation. - Local commit `c5788f8b098e099ee45914d1b83396de23434e21` and GitHub head `3c891ac137177c9e76d4ce9c96ceb2016f9adcff` have the same Git tree and parent. The runs used the local commit. - `cargo build --workspace --locked` passed. `cargo test --workspace --locked --no-fail-fast -- --test-threads=4` reported 863 passed, 0 failed, 42 ignored. `XCL_ADAPTER=nvidia` and `XCL_HEAP_WINDOWS=1`. The bundled title tests passed. - Two wave64 skips counted as passes by Cargo: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. - `python -B -m unittest discover -s scripts -p 'test_*.py'` passed all 17 tests. Before the fix both synthetic listings reported one false site. After it both report zero, and the existing positive cases still report one. **Regression run** - Script, test and documentation change. **Not tested** - Native wave64 hardware, the 42 explicitly ignored tests and real game/SDK data. No `XCL_SAMPLE_*` inputs were supplied. **AI use** - Codex (`gpt-6.2-sol`) investigated, wrote the change and regression test, ran the tests and drafted this description.
DavidM1911 commented 2026-11-24 23:08:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:37:45Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7146457889 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1730#issuecomment-7146457889). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T22:37:45Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
github-actions[bot] commented 2026-11-28 08:00:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:00:50Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236304735 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1730#issuecomment-7236304735). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:00:50Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 06:36:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:36:36Z.


Triage (#1607) – head 3c891ac

No open or merged PR makes this change. The lines shared with #2049 and #2660 are test boilerplate in scripts/test_record_writers.py: #2049 refactors the CLI (argument handling, main()) and keeps the old body scan, #2660 changes how the fallback call slot is found. Main's record_writers.py still counts a site without a cursor store.
The new scan stops at the fallback target or a ret and drops sites without a mov %P,0x18(%L); the test covers both boundaries. It will conflict with #2049's restructuring of the same loop.
Nit: the README note lands between the GPU feature table and "Media and tools".
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7303068321 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1730#issuecomment-7303068321). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:36:36Z. --- **Triage (#1607)** – head 3c891ac No open or merged PR makes this change. The lines shared with #2049 and #2660 are test boilerplate in `scripts/test_record_writers.py`: #2049 refactors the CLI (argument handling, `main()`) and keeps the old body scan, #2660 changes how the fallback call slot is found. Main's `record_writers.py` still counts a site without a cursor store. The new scan stops at the fallback target or a `ret` and drops sites without a `mov %P,0x18(%L)`; the test covers both boundaries. It will conflict with #2049's restructuring of the same loop. Nit: the README note lands between the GPU feature table and "Media and tools". Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1730:upstream-pr/1730'
git switch 'upstream-pr/1730'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1730'
git switch 'upstream-pr/1730'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1730'
git switch 'upstream-pr/1730'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1730'
git switch 'main'
git merge --squash 'upstream-pr/1730'
git switch 'main'
git merge --ff-only 'upstream-pr/1730'
git switch 'main'
git merge 'upstream-pr/1730'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
xcl-dev/xcl!1720
No description provided.