mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 01:00:53 +01:00
[PR #1530] sampler_source_census: fix V#/pointer/SMEM/v_mov dataflow and harden JSON I/O (SAMPLER-SOURCE-CENSUS-DATAFLOW-AND-IO) #1559
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#1559
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/1530
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/sampler-source-census-dataflow-io📝 Commits (1)
a9413cesampler_source_census: fix V#/pointer/SMEM/v_mov dataflow and harden JSON I/O📊 Changes
2 files changed (+340 additions, -16 deletions)
View changed files
📝
tests/test_sampler_source_census.py(+184 -0)📝
tools/sampler_source_census.py(+156 -16)📄 Description
What changed
tools/sampler_source_census.py:one_load_source): collect[source(t, seen) for t in base]and check agreement on the source origin ({g[0] for g in got}) while combiningany(g[1])andmax(g[2]), instead of requiring all four dwords to have identical(where, dyn, k)tuples. Previously, adding a static or dynamic offset to word 0 of a user V# dropped it toundetermined(V# from different sources).tools/sampler_source_census.py:one_load_source): recognize 3-tuple unary-folded zero constants (("const", 0, op)froms_not_b32/s_brev_b32) as a zero high word, and propagatedyn/kfrom a user high word instead of ignoring them.offset:IMMmodifier tracking (tools/sampler_source_census.py:analyse,one_load_source,one_load): parseoffset:Nfromins["mods"]so combinedsOFF offset:IMMloads countIMMinmax_pointer_constant(dynamic) andmax_static_offset(constant SGPR +offset:IMM).tools/sampler_source_census.py:step): do not treatv_mov_b32_sdwa,v_mov_b32_dpp, instructions with modifiers (clamp, etc.), or register operands withneg/abs/sextas lossless spill copies.tools/sampler_source_census.py:anchored,blocks_of,analyse,census): convert invalid hex inanchored()intohic.Skipinstead of crashing withValueError, handle empty instruction lists cleanly inblocks_of([])/analyse([], ...), and validate positive non-bool integers forlimitandjobsincensus().--jsonguards, atomic write, andOSErrorhandling (tools/sampler_source_census.py:main): refuse--jsontargeting a folder,index.json, anything insidedisasm, or any.dxbc/fssm/*.fssm/.sinput (viareport_paths.same_report_pathandos.path.samestatfor hardlinks); catchOSErrorfromcensus()with exit code 2; write--jsonatomically through a sibling temp file withfile_mode.published_mode,replace_retry.replace,allow_nan=False, and explicitnewline="\n".tests/test_sampler_source_census.py): added 7 synthetic unit/CLI regression tests covering every fix above.Claimed in the coordination issue as:
SAMPLER-SOURCE-CENSUS-DATAFLOW-AND-IO(https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7152027644)How it was tested
python3 -I -W error tests/test_sampler_source_census.py: 37/37 passed (0 warnings).python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/sampler_source_census.py tests/test_sampler_source_census.py: passed.python3 -m compileall -q tools/sampler_source_census.py tests/test_sampler_source_census.py: passed.main:tools/sampler_source_census.py: all 7 new tests fail (FAILED (failures=6, errors=1)), all 30 baseline tests pass.Metadata
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.