Scripts: read BOM-marked record-writer listings #2649

Open
luckyteagirl wants to merge 1 commit from upstream-pr/2659 into main
luckyteagirl commented 2026-11-26 05:15:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:15:59Z.


The record-writer inspector reads objdump listings as plain UTF-8. A listing saved by Windows PowerShell 5.1 redirection has a UTF-16 BOM; the inspector then silently finds zero record-write sites. Recognize BOM-marked listings while preserving plain UTF-8 input.

What is in it

  • Detect UTF-16 byte-order marks and use UTF-8 with BOM handling otherwise.
  • Extend the synthetic objdump CLI fixture to cover UTF-8, UTF-8 with BOM, and UTF-16 listings.

Tested

  • On current main b49be183, BOM-marked UTF-8 and UTF-16 fixtures found no sites; on this branch, full Python script discovery passed 25/25 on Windows and Ubuntu under WSL.
  • An actual Windows PowerShell 5.1 > redirect produced a UTF-16 LE BOM listing; the patched inspector found one site and fallback slot 8.
  • git diff --check and independent source review passed. PR #2049 refactors the same reader and may need a mechanical rebase.

Regression run

  • Not applicable. Only the Python inspector and its synthetic fixture changed.

Not tested

  • A retail binary objdump listing, Rust workspace tests, GPU tests, or title smoke.

AI use

  • Codex (GPT-6.2 Sol) implemented and tested the change; another Codex Sol agent independently reviewed it.
<!-- greyfinch-sync:ivall/xcl:issue:5504441740 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2659). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T05:15:59Z. --- The record-writer inspector reads objdump listings as plain UTF-8. A listing saved by Windows PowerShell 5.1 redirection has a UTF-16 BOM; the inspector then silently finds zero record-write sites. Recognize BOM-marked listings while preserving plain UTF-8 input. **What is in it** - Detect UTF-16 byte-order marks and use UTF-8 with BOM handling otherwise. - Extend the synthetic objdump CLI fixture to cover UTF-8, UTF-8 with BOM, and UTF-16 listings. **Tested** - On current main `b49be183`, BOM-marked UTF-8 and UTF-16 fixtures found no sites; on this branch, full Python script discovery passed 25/25 on Windows and Ubuntu under WSL. - An actual Windows PowerShell 5.1 `>` redirect produced a UTF-16 LE BOM listing; the patched inspector found one site and fallback slot 8. - `git diff --check` and independent source review passed. PR #2049 refactors the same reader and may need a mechanical rebase. **Regression run** - Not applicable. Only the Python inspector and its synthetic fixture changed. **Not tested** - A retail binary objdump listing, Rust workspace tests, GPU tests, or title smoke. **AI use** - Codex (GPT-6.2 Sol) implemented and tested the change; another Codex Sol agent independently reviewed it.
github-actions[bot] commented 2026-12-01 02:32:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:32:26Z.


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:7298725894 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2659#issuecomment-7298725894). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:32:26Z. --- 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 08:36:30 +00:00 (Migrated from github.com)

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


Triage (#1607) – head c3bf8a7

No open PR changes how record_writers.py decodes its input. #1492, #1694, #1730, #2049, #2660 and #3022 change site matching, the fallback scan, headers or the CLI, and keep the UTF-8 open.
A UTF-16 BOM selects utf-16, and anything else is read as utf-8-sig, which also handles UTF-8 with or without a BOM. The test runs UTF-8, UTF-8-BOM and UTF-16 listings. 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:7305543687 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2659#issuecomment-7305543687). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:36:30Z. --- **Triage (#1607)** – head c3bf8a7 No open PR changes how record_writers.py decodes its input. #1492, #1694, #1730, #2049, #2660 and #3022 change site matching, the fallback scan, headers or the CLI, and keep the UTF-8 `open`. A UTF-16 BOM selects `utf-16`, and anything else is read as `utf-8-sig`, which also handles UTF-8 with or without a BOM. The test runs UTF-8, UTF-8-BOM and UTF-16 listings. 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.
Decodere commented 2026-12-02 09:05:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:05:22Z.


merge-check
base: 1c8b551475
head: c3bf8a7fd2
merge: clean (git merge --no-edit onto 1c8b5514, git diff --check clean; scripts/re/record_writers.py and scripts/test_record_writers.py, +17/-5)
build: not run (Tier 0 Python script diff; no Rust code changed)
tests: python -m unittest discover -s scripts -p "test_record_writers.py" -v -> 1 passed, 0 failed (4 subtests covering utf-8 with/without 0x, utf-16, and utf-8-sig; base 1c8b5514: 1 passed with 2 subtests); python -m unittest discover -s scripts -p "test_*.py" -> 65 passed, 1 error (test_discord_mirror.py on Windows, same failure on base 1c8b5514). Rust workspace tests not run (Tier 0).
review: Read the full diff (+17/-5). Sniffs the leading two bytes for BOM_UTF16_LE/BOM_UTF16_BE to select utf-16 and otherwise uses utf-8-sig (handling both plain UTF-8 and UTF-8 with BOM) via TextIOWrapper (scripts/re/record_writers.py:13-16), fixing listings redirected from Windows PowerShell. All four subtests pass cleanly. No problems found.
performance: none (offline analysis script in scripts/re/; zero runtime impact)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7340358457 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2659#issuecomment-7340358457). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T09:05:22Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: c3bf8a7fd23a66424037018c535f73ea79f40bc5 merge: clean (`git merge --no-edit` onto `1c8b5514`, `git diff --check` clean; `scripts/re/record_writers.py` and `scripts/test_record_writers.py`, +17/-5) build: not run (Tier 0 Python script diff; no Rust code changed) tests: `python -m unittest discover -s scripts -p "test_record_writers.py" -v` -> 1 passed, 0 failed (4 subtests covering `utf-8` with/without `0x`, `utf-16`, and `utf-8-sig`; base `1c8b5514`: 1 passed with 2 subtests); `python -m unittest discover -s scripts -p "test_*.py"` -> 65 passed, 1 error (`test_discord_mirror.py` on Windows, same failure on base `1c8b5514`). Rust workspace tests not run (Tier 0). review: Read the full diff (+17/-5). Sniffs the leading two bytes for `BOM_UTF16_LE`/`BOM_UTF16_BE` to select `utf-16` and otherwise uses `utf-8-sig` (handling both plain UTF-8 and UTF-8 with BOM) via `TextIOWrapper` (`scripts/re/record_writers.py:13-16`), fixing listings redirected from Windows PowerShell. All four subtests pass cleanly. No problems found. performance: none (offline analysis script in `scripts/re/`; zero runtime impact) verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
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/2659:upstream-pr/2659'
git switch 'upstream-pr/2659'

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