mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1534] image_bvh_census: fix v_cmpx/v_rcp/SDWA/CFG bugs and harden JSON I/O (IMAGE-BVH-CENSUS-DATAFLOW-CFG-AND-IO) #1563
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#1563
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/1534
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/image-bvh-census-dataflow-io📝 Commits (1)
c2d3224image_bvh_census: fix v_cmpx/v_rcp/SDWA/CFG bugs and harden JSON I/O📊 Changes
2 files changed (+279 additions, -21 deletions)
View changed files
📝
tests/test_image_bvh_census.py(+158 -0)📝
tools/image_bvh_census.py(+121 -21)📄 Description
What changed
v_cmpx_*operand handling (tools/image_bvh_census.py:sgpr_step,mask_writes,source_args):v_cmpx_*_e32takes 2 source operands with an implicitEXECdestination (a[0]is a source, not a destination). Previously,sgpr_step()andmask_writes()treateda[0]as an SGPR write, wiping literal descriptor words and saved EXEC masks whenever a 2-operandv_cmpx_*read an SGPR ina[0].v_cmpx_*_e64(len(a) > 2) puts its destination ina[0]and sources ina[1:];source_args()now excludesa[0], soproduct_reader()reportsv_cmpx_gt_i32 with 0instead ofwith 2 other operands.v_rcp_f32before taggingR1(tools/image_bvh_census.py:site_transfer): alignsite_transfer()withclassify()by checkingplain(a[1]),not ins.get("mods"), and no_sdwa/_dppsuffix sov_rcp_f32_e64 v20, |v5|/-v5/clampdoes not falsely classify downstreamv_mul_f32asratio.high_half_operand()and handle dual high-half operands (tools/image_bvh_census.py:high_half_operand,site_transfer): prevent SGPR operands (e.g.sext(s5)) from reading VGPRv5, prevent immediate operands (sext(1)) from raisingKeyError: 'r', and select the operand holding word 1 when both SDWA operands useWORD_1.tools/image_bvh_census.py:is_copy,imm32): check single-VGPR operands andplain(a[0])onv_swap_b32inis_copy(), and catchOverflowErrorinimm32()for out-of-range float32 literals.tools/image_bvh_census.py:blocks_of,analyse,load_program): start a new block on non-contiguous PCs and requirenext_pc(last) == starts[n + 1]before adding a fall-through edge (avoiding phantom fall-through across embedded data gaps), handle emptyinsnscleanly, and convert invalid hex encodings (parse_file/bytes.fromhexValueError) toSkip.--outoverwrite guards,OSErrorhandling, and atomic JSON output (tools/image_bvh_census.py:main): usereport_paths.same_report_path(plusos.path.samestatfor hardlinks) to refuse overwriting scanned listings,index.json, orfssm/*.fssm; catchOSErrorduring directory scanning with exit code 2; write--outatomically through a sibling temp file withfile_mode.published_mode,replace_retry.replace,allow_nan=False, and a trailing LF.tests/test_image_bvh_census.py): added 6 synthetic unit/CLI regression tests covering every fix above.Claimed in the coordination issue as:
IMAGE-BVH-CENSUS-DATAFLOW-CFG-AND-IO(https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7152125566)How it was tested
python3 -I -W error tests/test_image_bvh_census.py: 21/21 passed (0 warnings).python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/image_bvh_census.py tests/test_image_bvh_census.py: passed.python3 -m compileall -q tools/image_bvh_census.py tests/test_image_bvh_census.py: passed.main:tools/image_bvh_census.py: all 6 new tests fail (FAILED (failures=4, errors=2)), all 15 baseline tests pass.Metadata
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.