Accept only label-kind state IDs in the script state probe and cover more synthetic trees #101
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/102"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T15:59:39Z.
Change
tools/script_state_probe.pyaccepted a stateidattribute of any kind, while the replay'sstate_indexrequires kind 5. An integeridwhose hash equals a label could therefore return a camera example for--state <label>. The probe now treats only a kind-5idas a state ID. The Script states item in "Choose an experiment" gains Linux-runnable synthetic cases covering a non-state parent, a missing camera attribute, a root with a parent, a label that selects nothing, and the integer-idregression. The paragraph in docs/experiments.md ("State-linked settings in a script archive") is updated to match.Verification
python -B tests/script_state_check.py: all 8 tests pass. On Windows,ctest --preset dev --no-tests=error -R '^script_state_literals$' -Vat195042eon Windows 11 build 26200.9974, VS Build Tools 2022 17.14 (MSVC 14.44.35207), Windows SDK 10.0.26100, Python 3.12, RTX 5080 (driver 32.0.16.1692) passed (Ran 8 tests, OK). With thetools/change reverted,test_state_id_must_be_a_labelfails and the rest pass.Evidence and follow-up
The fixtures are generated in the test from synthetic bytes, so there is no game data and no license concern. The sibling-link and ambiguity cases remain in
tests/script_path_check.py, which needs the Windows-built host.inspect_treestill lets the last duplicateidwin silently, whilestate_indexraises; another contributor could align the two. No local-data result changes.