Scripts: report headers from the record-base store #1684

Open
broccolize wants to merge 1 commit from upstream-pr/1694 into main
broccolize commented 2026-11-24 19:21:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by broccolize on 2026-11-24T19:21:41Z.


record_writers.py can mistake an unrelated list-field load for a record header or miss a store written as 0x0(%cursor).

What is in it

  • scripts/re/record_writers.py reads the first mov or movl to the record base with either spelling of offset zero. It reports a list-field source when the preceding load writes the register used by the store. Other register sources are reported as unknown.
  • scripts/test_record_writers.py adds four synthetic cases covering immediate stores, explicit zero displacements, direct list-field copies, and unknown register sources.

Tested

  • Windows 11 build 26300.9974, Intel i5-10300H, NVIDIA GTX 1650 (driver 617.14), Rust 1.100.0 MSVC, debug profile, Python 3.14.7.
  • python -B -m unittest discover -s scripts -p 'test_*.py': 17 passed. The four new subcases failed on c160d86 before the fix.
  • cargo build --workspace passed. cargo test --workspace -- --test-threads=4: 858 passed, 0 failed, 42 ignored. Three GPU skips were reported: two for no wave64 and one for no heap windows.

Not tested

  • Retail DLL disassembly and AMD hardware.

AI use

  • OpenAI Codex (GPT-6) implemented the fix and ran the tests.
<!-- greyfinch-sync:ivall/xcl:issue:5478787915 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1694). Originally posted by [broccolize](https://github.com/broccolize) on 2026-11-24T19:21:41Z. --- `record_writers.py` can mistake an unrelated list-field load for a record header or miss a store written as `0x0(%cursor)`. **What is in it** - `scripts/re/record_writers.py` reads the first `mov` or `movl` to the record base with either spelling of offset zero. It reports a list-field source when the preceding load writes the register used by the store. Other register sources are reported as unknown. - `scripts/test_record_writers.py` adds four synthetic cases covering immediate stores, explicit zero displacements, direct list-field copies, and unknown register sources. **Tested** - Windows 11 build 26300.9974, Intel i5-10300H, NVIDIA GTX 1650 (driver 617.14), Rust 1.100.0 MSVC, debug profile, Python 3.14.7. - `python -B -m unittest discover -s scripts -p 'test_*.py'`: 17 passed. The four new subcases failed on `c160d86` before the fix. - `cargo build --workspace` passed. `cargo test --workspace -- --test-threads=4`: 858 passed, 0 failed, 42 ignored. Three GPU skips were reported: two for `no wave64` and one for `no heap windows`. **Not tested** - Retail DLL disassembly and AMD hardware. **AI use** - OpenAI Codex (GPT-6) implemented the fix and ran the tests.
DavidM1911 commented 2026-11-24 22:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:02: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:7145728329 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1694#issuecomment-7145728329). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T22:02: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!
RavenCurseBurg commented 2026-11-26 02:08:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T01:06:13Z.


I combined 69b5a84c2f6011f2da02f4433ef5b05488561788 with #1730 at 3c891ac137177c9e76d4ce9c96ceb2016f9adcff. There was one content conflict in scripts/re/record_writers.py. The tested merge checks that the cursor was stored on the fast path before classifying the first store to the record header.

I ran 18 synthetic objdump-style listings per version (54 CLI runs across both parents and the merge). The fixtures covered immediate headers, adjacent list-field copies and overwritten source registers, both zero-offset spellings, and paths ending at a cursor update, a return or the fallback block. The merged script counted only completed writers and reported the expected header in each one.

A new two-site regression failed on each parent alone: #1694 counted the uncompleted site, while #1730 attributed the complete site's header to an unrelated load. On the combined tree python -B -m unittest discover -s scripts -p "test_*.py" passed 19/19. Windows 11, Core i7-13700, Python 3.14.3. Saved synthetic text only; no title DLL or GPU run. OpenAI Codex (GPT-6) resolved the conflict, added the regression and ran the checks.

<!-- greyfinch-sync:ivall/xcl:comment:7179434699 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1694#issuecomment-7179434699). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T01:06:13Z. --- I combined `69b5a84c2f6011f2da02f4433ef5b05488561788` with #1730 at `3c891ac137177c9e76d4ce9c96ceb2016f9adcff`. There was one content conflict in `scripts/re/record_writers.py`. The [tested merge](https://github.com/RavenCurseBurg/xcl/compare/3c891ac137177c9e76d4ce9c96ceb2016f9adcff...631821ff33ea1d9d15347817bcf72e5ad5d7f340) checks that the cursor was stored on the fast path before classifying the first store to the record header. I ran 18 synthetic objdump-style listings per version (54 CLI runs across both parents and the merge). The fixtures covered immediate headers, adjacent list-field copies and overwritten source registers, both zero-offset spellings, and paths ending at a cursor update, a return or the fallback block. The merged script counted only completed writers and reported the expected header in each one. A new two-site regression failed on each parent alone: #1694 counted the uncompleted site, while #1730 attributed the complete site's header to an unrelated load. On the combined tree `python -B -m unittest discover -s scripts -p "test_*.py"` passed 19/19. Windows 11, Core i7-13700, Python 3.14.3. Saved synthetic text only; no title DLL or GPU run. OpenAI Codex (GPT-6) resolved the conflict, added the regression and ran the checks.
github-actions[bot] commented 2026-11-30 08:40:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:49Z.


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:7273208391 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1694#issuecomment-7273208391). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:40:49Z. --- 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.
broccolize commented 2026-11-30 11:22:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by broccolize on 2026-11-30T11:22:20Z.


This reports command record headers from the record-base store. The tested patch is awaiting maintainer review and coordination with #1730.

<!-- greyfinch-sync:ivall/xcl:comment:7276932399 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1694#issuecomment-7276932399). Originally posted by [broccolize](https://github.com/broccolize) on 2026-11-30T11:22:20Z. --- This reports command record headers from the record-base store. The tested patch is awaiting maintainer review and coordination with #1730.
Foniass commented 2026-12-01 06:30:42 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 69b5a84

No open or merged PR makes the same change; #1492, #2049 and #3022 edit scripts/re/record_writers.py but not the header detection.
On main the header loop takes the first mov 0x..(%L),%reg in the body as list+.. even when it is not stored to the record (e.g. mov 0x10(%rcx),%edx before movl $0x37,(%rax)). This PR reads only the first store at (%P) / 0x0(%P) and counts a list field only when the load into that register comes right before the store. The test covers both spellings and the register case. No problems found in the diff.
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:7302957622 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1694#issuecomment-7302957622). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:30:42Z. --- **Triage (#1607)** – head 69b5a84 No open or merged PR makes the same change; #1492, #2049 and #3022 edit `scripts/re/record_writers.py` but not the header detection. On main the header loop takes the first `mov 0x..(%L),%reg` in the body as `list+..` even when it is not stored to the record (e.g. `mov 0x10(%rcx),%edx` before `movl $0x37,(%rax)`). This PR reads only the first store at `(%P)` / `0x0(%P)` and counts a list field only when the load into that register comes right before the store. The test covers both spellings and the register case. No problems found in the diff. 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/1694:upstream-pr/1694'
git switch 'upstream-pr/1694'

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/1694'
git switch 'upstream-pr/1694'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1694'
git switch 'upstream-pr/1694'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1694'
git switch 'main'
git merge --squash 'upstream-pr/1694'
git switch 'main'
git merge --ff-only 'upstream-pr/1694'
git switch 'main'
git merge 'upstream-pr/1694'
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!1684
No description provided.