Scripts: harden bcpack vector generator CLI handling and add unit test suite #2139
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2139
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2139"
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?
@heditrigui on GitHub · 2026-11-25 06:00 UTC · original
heditrigui:scripts/bcpack-vector-gen-cli-hardening→main· +168 −10 · 2 files · 1 commits · openSummary
Hardens CLI argument handling in
tests/data/bcpack/generate.pyand adds an automated unit test suite:main(argv=None)supporting-h/--helpdocstring,--out-dir/-o(defaulting totests/data/bcpack/), and--mode/-m(selective generation for modes 1, 3, 4, 5, 6, 7).generate()without_dirparameter and addsgenerate_all(), allowing generation into isolated directories without mutating repository fixtures.scripts/test_bcpack_generate.pywith 11 unit tests covering CLI flags, invalid mode exits, custom output directory generation, byte parity with committed fixtures, rANS encoding, delta prediction, and BC1 packaging.Tested
python -m pytest scripts/(36 passed in 1.05s).scripts/pr_check.py --local.Not tested
scripts/and test vector tooling are non-runtime code).AI use
@DavidM1911 on GitHub · 2026-11-25 06:49 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@raylitebull on GitHub · 2026-11-25 11:03 UTC · original
Code review on
f121cb7(tests/data/bcpack/generate.py,scripts/test_bcpack_generate.py):generate/generate_all/maincleanly adds--out-dirand--modeCLI filtering without changing output payloads (verified byte-identical against committed.bin/.lanesfixtures in the 11 new tests), and both CI checks are green.Remaining before merge: Independent Windows/Python verification of
scripts/test_bcpack_generate.pyonf121cb7(the prior--librun did not execute the Python test suite).@RavenCurseBurg on GitHub · 2026-11-25 11:43 UTC · original · edited 2026-11-25 11:50 UTC
Tested
f121cb7692513f6304867c6fceadc03ed9d1fa95on Windows 11 24H2 (26100.9711), i7-13700, Python 3.14.3.Tested
python -B -m unittest discover -s scripts -p test_bcpack_generate.pypassed all 11 tests (0 failures, 0 skips).6e1e2be) and the PR generator in separate temporary directories. Their full runs produced the same 31 filenames and 46,460 bytes of identical payloads. All 26 tracked.binand.lanesfiles matched their Git blobs. The five generated.bc1files matched the parent generator byte for byte as well.--out-dir <fresh-dir> --mode Nfor each supported mode. Modes 1, 3, 4, 5, 6 and 7 produced 16, 2, 2, 2, 2 and 7 files respectively. Each directory matched exactly the corresponding subset of the full run in both names and bytes.Not tested
Runtime decompression, Rust/GPU workspace tests or retail assets.
AI use
OpenAI Codex (GPT-6) ran the upstream tests, wrote the independent byte comparisons and prepared this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.