mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1646] f16_trans_sweep: harden CLI tokens, atomic JSON writes, and oracle result count guards #1661
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1661
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1646
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/f16-trans-sweep-json-and-guards📝 Commits (1)
e719266f16_trans_sweep: harden CLI tokens, atomic JSON writes, and oracle result count guards📊 Changes
2 files changed (+152 additions, -14 deletions)
View changed files
📝
tests/test_f16_trans_sweep.py(+72 -0)📝
tools/f16_trans_sweep.py(+80 -14)📄 Description
Item ID:
F16-TRANS-SWEEP-JSON-AND-GUARDSClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155318176
Summary
Harden CLI parsing, JSON report writing, and oracle result validation in
tools/f16_trans_sweep.py:--ops/--modes/--waves/--hw-archguards: reject empty/trailing comma tokens (v_exp_f16,,keep16,,flush16,32,), deduplicate repeated ops/modes/waves in first-seen order so 65,536-input sweeps aren't run redundantly, and reject empty/whitespace--hw-arch.validate_json_path()& atomicwrite_json_report():O_WRONLY), serialize withallow_nan=Falseand a trailing LF, write non-regular targets like/dev/nulldirectly, and publish regular files atomically viatempfile.mkstemp+file_mode.published_mode+replace_retry.replace.RuntimeErrorincheck_modes()whenlen(got) != len(kernels)or a probe returns an empty word list (instead of crashing withIndexError).RuntimeErrorinsweep()whenlen(got) != len(kernels)(instead of returning a truncated array that crashes inclassify()).tests/test_f16_trans_sweep.py): added 3 test methods covering malformed/duplicate selections, empty--hw-arch, atomic/trailing-LF/NaN/symlink//dev/nullwrites, and short/empty oracle result handling.Verification
python3 -W error -I tests/test_f16_trans_sweep.py -v: 17 passed, 2 skipped (AMD clang / hardware absent)main:ran=19 failures=2 errors=9 (skipped=2)python3 -I tests/test_text_write_line_endings.py: 3/3 passedpython3 -I scripts/check_no_game_data.py tools/f16_trans_sweep.py tests/test_f16_trans_sweep.py: passedpython3 -m compileall -q tools/f16_trans_sweep.py tests/test_f16_trans_sweep.py: passed🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.