mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1642] pk_int16_clamp_probe: harden --ops/--waves, upfront atomic JSON writes, and result count guard #1656
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#1656
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/1642
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/pk-int16-clamp-probe-json-and-cli📝 Commits (1)
a15c1d7pk_int16_clamp_probe: harden --ops/--waves, upfront atomic JSON writes, and result count guard📊 Changes
2 files changed (+229 additions, -14 deletions)
View changed files
📝
tests/test_pk_int16_clamp_probe.py(+97 -1)📝
tools/pk_int16_clamp_probe.py(+132 -13)📄 Description
Item ID:
PK-INT16-CLAMP-PROBE-JSON-AND-CLIClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155187060
Summary
Harden CLI argument parsing, JSON report writing, and harness error handling in
tools/pk_int16_clamp_probe.py:--ops/--waves/--hw-archguards: reject empty/trailing comma tokens (32,,,v_pk_mul_lo_u16,32,,64), deduplicate repeated ops/waves so kernels andtotal_casesare not double-counted, and reject empty/whitespace--hw-arch.--jsonvalidation: reject empty/whitespace paths, trailing separators, directories, non-directory parent blockers, and unwritable existing targets before openinghw_oracle.write_report(): serialize upfront withallow_nan=Falseand LF endings, handle non-regular targets like/dev/nulldirectly, resolve symlinks before staging to preserve symlink targets, applyfile_mode.published_mode, and publish viareplace_retry.replace.harness_errorsentry whenlen(raw_results) != len(meta)inevaluate_results()(preventingKeyErrorafterzip()truncation), and catchValueErrorfromasm.family(oracle.arch)cleanly (exit77).tests/test_pk_int16_clamp_probe.py): added 3 test methods covering malformed/duplicate--ops/--waves, empty--hw-arch/--json, upfront blocker/trailing-sep rejection, atomic/symlink/NaN//dev/nullwrites, result count mismatch, and unknown arch family.Verification
python3 -W error -I tests/test_pk_int16_clamp_probe.py -v: 9 passed, 1 skipped (AMD clang absent)main:ran=10 failures=1 errors=11 (skipped=1)python3 -I tests/test_text_write_line_endings.py: 3/3 passedpython3 -I scripts/check_no_game_data.py tools/pk_int16_clamp_probe.py tests/test_pk_int16_clamp_probe.py: passedpython3 -m compileall -q tools/pk_int16_clamp_probe.py tests/test_pk_int16_clamp_probe.py: passed🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.