OLD-7279: script_qtable: sort _BinFolderSource hex offsets numerically, skip .bin subdirs, and sort type_query histograms numerically #876

Manually merged
github merged 1 commit from gh-pr/876/head into gh-pr/876/base 2026-11-26 09:25:50 +00:00
Owner

@⁠narekshaghoyandev on GitHub · 2026-11-24 14:53 UTC · original
narekshaghoyandev:ubiq-script-qtable-bin-folder-order → main · +68 −9 · 2 files · 1 commits · merged 2026-11-24 21:04 UTC

Reopening my original upstream PR #7279 (previously verified on Windows 11 Py3.12/3.15 and Linux by @AsgerCode, @memorypressure, and @airp1ane), cleanly rebased onto main:

  1. Sort _BinFolderSource hex offsets numerically & skip .bin subdirectories: Avoids lexicographic reversal of mixed-width/mixed-case hex .bin names when joining split 64 KiB streams, and skips subdirectories whose names end with .bin instead of crashing on open (IsADirectoryError / PermissionError).
  2. Sort type_query histograms numerically: Orders numeric histogram keys (size, count, etc.) numerically instead of lexicographically ("112" before "32").

Verification

  • python3 -I tests/test_script_qtable.py -v: 10/10 pass (both new tests fail/error against main).
  • python3 -I scripts/check_no_game_data.py tools/script_qtable.py tests/test_script_qtable.py: clean.
  • python3 -m compileall -q tools/script_qtable.py tests/test_script_qtable.py: clean.

Claimed in the coordination issue as: OLD-7279 (#14)
AI-assisted: yes (Gemini)

**@⁠narekshaghoyandev** on GitHub · 2026-11-24 14:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/876) `narekshaghoyandev:ubiq-script-qtable-bin-folder-order` → `main` · +68 −9 · 2 files · 1 commits · merged 2026-11-24 21:04 UTC Reopening my original upstream PR #7279 (previously verified on Windows 11 Py3.12/3.15 and Linux by `@AsgerCode`, `@memorypressure`, and `@airp1ane`), cleanly rebased onto `main`: 1. **Sort `_BinFolderSource` hex offsets numerically & skip `.bin` subdirectories**: Avoids lexicographic reversal of mixed-width/mixed-case hex `.bin` names when joining split 64 KiB streams, and skips subdirectories whose names end with `.bin` instead of crashing on open (`IsADirectoryError` / `PermissionError`). 2. **Sort `type_query` histograms numerically**: Orders numeric histogram keys (`size`, `count`, etc.) numerically instead of lexicographically (`"112"` before `"32"`). ### Verification - `python3 -I tests/test_script_qtable.py -v`: 10/10 pass (both new tests fail/error against `main`). - `python3 -I scripts/check_no_game_data.py tools/script_qtable.py tests/test_script_qtable.py`: clean. - `python3 -m compileall -q tools/script_qtable.py tests/test_script_qtable.py`: clean. Claimed in the coordination issue as: OLD-7279 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) AI-assisted: yes (Gemini)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:25:50 +00:00
github manually merged commit 1ebe352f11 into gh-pr/876/base 2026-11-26 09:25:50 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-24 14:55 UTC · original · approved these changes

Reviewed exact head 1ebe352f11d96bdd86a3dbd68baeeb8dcd70b002 against base 8f05e09e224656740e8a53f5047e1338d7a52588. The folder source now orders hex-named chunks by numeric offset, ignores .bin directories, and guards report-path checks against directory entries; histogram counts retain numeric sort order before JSON keys are rendered as strings. python3 -I tests/test_script_qtable.py -v passes 10/10; Python compilation and git diff --check pass. Synthetic inputs only, CPU-only. Hosted checks were pending at review time.

**@⁠KernelSmoker** on GitHub · 2026-11-24 14:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/876#pullrequestreview-6041581747) · **approved these changes** Reviewed exact head `1ebe352f11d96bdd86a3dbd68baeeb8dcd70b002` against base `8f05e09e224656740e8a53f5047e1338d7a52588`. The folder source now orders hex-named chunks by numeric offset, ignores `.bin` directories, and guards report-path checks against directory entries; histogram counts retain numeric sort order before JSON keys are rendered as strings. `python3 -I tests/test_script_qtable.py -v` passes 10/10; Python compilation and `git diff --check` pass. Synthetic inputs only, CPU-only. Hosted checks were pending at review time.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 14:56 UTC · original · approved these changes

Audited and verified. In ools/script_qtable.py, sorts _BinFolderSource hexadecimal chunk offsets numerically to prevent out-of-order chunk assembly across 64 KiB boundaries, skips directories matching *.bin, and ensures ype_query histogram keys are sorted numerically. Unit tests in ests/test_script_qtable.py pass cleanly. Approved.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/876#pullrequestreview-6041610021) · **approved these changes** Audited and verified. In ools/script_qtable.py, sorts _BinFolderSource hexadecimal chunk offsets numerically to prevent out-of-order chunk assembly across 64 KiB boundaries, skips directories matching *.bin, and ensures ype_query histogram keys are sorted numerically. Unit tests in ests/test_script_qtable.py pass cleanly. Approved.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 21:04 UTC · original

Merging.

Why merged: OLD-7279: script_qtable sorts .bin chunk names by their numeric hex offset (not as strings), skips .bin directories, and sorts the type_query histograms numerically. KernelSmoker approved this exact head.

Why it's good: Pure Python with added isfile guards. Own tests: 10 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 66d4f5aa3. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 0b45fdc21: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 21:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/876#issuecomment-7144435658) Merging. **Why merged:** OLD-7279: script_qtable sorts .bin chunk names by their numeric hex offset (not as strings), skips .bin directories, and sorts the type_query histograms numerically. KernelSmoker approved this exact head. **Why it's good:** Pure Python with added isfile guards. Own tests: 10 passed. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 66d4f5aa3. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 0b45fdc21: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.