OLD-7279: script_qtable: sort _BinFolderSource hex offsets numerically, skip .bin subdirs, and sort type_query histograms numerically #876
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/876"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by narekshaghoyandev on 2026-11-24T14:53:40Z.
Reopening my original upstream PR #7279 (previously verified on Windows 11 Py3.12/3.15 and Linux by
@AsgerCode,@memorypressure, and@airp1ane), cleanly rebased ontomain:_BinFolderSourcehex offsets numerically & skip.binsubdirectories: Avoids lexicographic reversal of mixed-width/mixed-case hex.binnames when joining split 64 KiB streams, and skips subdirectories whose names end with.bininstead of crashing on open (IsADirectoryError/PermissionError).type_queryhistograms 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 againstmain).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://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135100661)
AI-assisted: yes (Gemini)
Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T14:55:09Z.
Review: APPROVED
Reviewed exact head
1ebe352f11d96bdd86a3dbd68baeeb8dcd70b002against base8f05e09e224656740e8a53f5047e1338d7a52588. The folder source now orders hex-named chunks by numeric offset, ignores.bindirectories, 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 -vpasses 10/10; Python compilation andgit diff --checkpass. Synthetic inputs only, CPU-only. Hosted checks were pending at review time.Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:56:40Z.
Review: APPROVED
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.
Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T21:04:16Z.
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 main0b45fdc21: 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).