Reject non-label state ID attributes in the script probe and replay #174
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!174
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/174/head"
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?
@Vonsek on GitHub · 2026-11-21 17:57 UTC · original
Vonsek:script-path-integer-state-id→main· +32 −14 · 5 files · 1 commits · merged 2026-11-22 03:00 UTCChange
resolve_script_pathintools/script_path_host.cppreports a state child whoseidattribute is not label-kind (kind 5) as malformed (-3).script_dispatch_pairs(test_malformed_non_hash_id_returns_error_and_preserves_active) asserts that behavior. The Python side disagreed:script_path_replay.state_indexandscript_state_probe.inspect_treesilently ignored such an attribute and treated the node as an unnamed state. On a tree with an integeridbeside a sibling of the selected state, the replay's parent-index reference expected node 5 while the native walker returned-3.This change aligns the Python side with the native walker and
script_dispatch_pairs. A sharedstate_idshelper inscript_state_probe.pyreturns a state'siddigests and raisesValueError("Non-label state ID attribute")for anyidof another kind, in the same style as the existing duplicate-ID error.state_indexandinspect_treeboth use it. The native host is unchanged.Tests:
tests/script_path_check.py:test_non_label_id_is_malformedadds an integer-kindidspelledpanelto a sibling of the selected state, to the selected state beside its label, and to a state on an unrelated branch, and expects the replay to reject the tree.tests/script_state_check.py:test_state_id_must_be_a_labelasserted that an integeridwhose hash equals the label is ignored and selects nothing. That expectation contradicts the rule now on main (the native host andscript_dispatch_pairstreat a non-labelidas malformed), so it is replaced bytest_non_label_state_id_is_malformed, which expects the error for integer (3) and boolean (4) kinds. The intent of the old test, that a non-labelidnever selects a state, still holds.docs/experiments.mddescribes the rule in the probe and path replay paragraphs.Verification
tools/script_path_host.cppas a shared object with clang++ and rantests/script_path_check.py <host>,tests/script_dispatch_check.py <host>andtests/script_state_check.py. All pass with the change. With the two tool files reverted, the new path test fails in all three subtests and the new probe test fails for both kinds;script_dispatch_check.pypasses either way.ctest --preset dev --no-tests=error -R '^script_(state_literals|path_links|dispatch_pairs)$' -Vatb679760on Windows 11 build 26200.9974, VS Build Tools 2022 17.14 (MSVC 14.44.35207), Windows SDK 10.0.26100, Python 3.12: 3/3 passed (script_path_links: Ran 5 tests, OK, with the MSVC-built host;script_state_literals: Ran 13 tests, OK;script_dispatch_pairs: Ran 5 tests, OK). The fullctest --preset dev --no-tests=errorpassed 107/107, withbvh_wave64_hardware,bvh_wave64_warpandwave_shuffle_warpskipped.Evidence and follow-up
All inputs are source-built rows. The probe scans every record in an archive, so a record with a non-label
idon a state node now stops the probe with an error instead of being counted. If such nodes turn up, the probe would need to report the record rather than raise.@MarlomMedeiros on GitHub · 2026-11-21 18:07 UTC · original
Heads-up on a test interaction with main. #133 added
script_dispatch_pairs, whosetest_malformed_non_hash_id_returns_error_and_preserves_activebuilds asibling list where one state carries a kind=4 (bool)
idattribute andexpects (-3, active preserved). With this change that attribute is
skipped instead, so the walk proceeds to the remaining label-kind
trigger_asibling. Verified locally on this branch merged withccfa703: the test now returns(6, 6)where it expects(-3, 2), soit fails once this lands.
The semantic change itself matches the probe behavior, but the fixture
needs to land in the same PR or CI breaks. The same case still
exercises something useful under the new semantics: the non-label
idis skipped, it no longer counts toward the duplicate check, and the
labeled sibling still resolves, i.e. asserting
(6, 6). If-3coverage should be kept, two label-kind
idattributes on a singlestate still produce it.
One data point for the semantics decision, whichever way it lands: the
kind=4
idcase is not synthetic-only. In #19 we found real stateswith
true/falseboolidattributes under one sibling list in thelocal corpus (record index 872). Skipping them makes the walker
treat those states as unnamed rather than reporting malformed data,
which changes what the tool surfaces about the real file.
@R0Y00 on GitHub · 2026-11-21 18:12 UTC · original · edited 2026-11-21 18:18 UTC
The Windows run at
713eea63failsscript_dispatch_pairs: expected(-3, 2)and got(6, 6). The path replay and dispatch now disagree about a non-label ID. Please preserve the existing dispatch contract while fixing path replay, or document the proposed dispatch change for a lead decision before changing its expected value. Windows test logThe dispatch contract decision is tracked in #197.
@Vonsek on GitHub · 2026-11-21 18:29 UTC · original
Reworked (
b679760, on current main). The first version made the native walker skip non-labelidattributes, which contradictsscript_dispatch_pairson main (test_malformed_non_hash_id_returns_error_and_preserves_activefailed in CI). This version follows main's rule instead: the native host is unchanged, and the Python probe and replay now reject a non-label stateidas malformed, so all three agree. Title and description are updated;script_state_literals,script_path_linksandscript_dispatch_pairspass on Windows 11 26200.9974, and the full suite passes 107/107.@chatgpt-codex-connector[bot] on GitHub · 2026-11-21 18:31 UTC · original · edited 2026-11-21 18:34 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
b679760ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.