Identify the event or call site that activates a state in a script camera tree #19

Open
opened 2026-11-21 09:10:33 +00:00 by R0Y00 · 8 comments
R0Y00 commented 2026-11-21 09:10:33 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T09:10:33Z.


Follow-up to #18. The native path replay takes explicit requests and resolves them against the archive hierarchy. The outstanding question is how the game produces a request and whether it resolves missing or duplicate IDs using fallback or precedence.

A reproducible witness should connect an input event or caller condition to the selected context and target ID, establish its direction, and distinguish it from a camera parameter containing the same integer. Test both an activating input and a nearby input that takes a different branch. Preserve the local-only archive workflow and use synthetic fixtures when publishing tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6526928991 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T09:10:33Z. --- Follow-up to #18. The native path replay takes explicit requests and resolves them against the archive hierarchy. The outstanding question is how the game produces a request and whether it resolves missing or duplicate IDs using fallback or precedence. A reproducible witness should connect an input event or caller condition to the selected context and target ID, establish its direction, and distinguish it from a camera parameter containing the same integer. Test both an activating input and a nearby input that takes a different branch. Preserve the local-only archive workflow and use synthetic fixtures when publishing tests.
R0Y00 commented 2026-11-24 06:47:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T14:38:25Z.


For a first contribution, the existing state replay is a control. It can show what happens after a context and target ID have been supplied. The missing observation is the producer of that pair. A useful report would trace one candidate event or caller to its two output IDs, then vary one input and record whether it chooses a different state. Please identify which values came from the observed data and which the test supplied. A source-built fixture and expected results are enough for a public PR.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7064240265 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7064240265). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T14:38:25Z. --- For a first contribution, the existing [state replay](https://github.com/R0Y00/Xbox2Windows/blob/main/docs/experiments.md#state-linked-settings-in-a-script-archive) is a control. It can show what happens *after* a context and target ID have been supplied. The missing observation is the producer of that pair. A useful report would trace one candidate event or caller to its two output IDs, then vary one input and record whether it chooses a different state. Please identify which values came from the observed data and which the test supplied. A source-built fixture and expected results are enough for a public PR.
MarlomMedeiros commented 2026-11-24 06:47:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MarlomMedeiros on 2026-11-21T16:10:39Z.


Extending the script-state notes from #18 to the activation question,
using the repo's own resolve_script_path reference walker and the local
script.rpf corpus (1,012 PSIN records; single package, no second source;
everything stays local).

Corpus structure: 996 'shopcomponents' records (physical shop
interaction sites: promptposition, scenepositionheading, standflags,
locationname, weapon, kitmod), 8 'states' libraries at record indices
{10,200,232,292,773,798,872,1010}, and 8 records of other shapes. The
states libraries are hierarchical state(id=, type=) trees
whose leaves carry camera parameter nodes (0xc9fd9c54, all five probe
literals verify) or preview-offset nodes (0xd5b27926).

Call site (serialized side): 44 of the 996 shopcomponents records
declare context-key digests, 19 locationname and 25 weapon records,
disjoint. Matches land exclusively on level-1 state ids and nowhere
else in the corpus (expected chance ~1e-5 or lower; observed 5
locationname -> Rec 798 states, 28 weapon -> Rec 10 states; zero
other matches across every kind-5 digest in the file). The other six
libraries take keys from non-shopcomponents records, e.g. Rec 239 ->
Rec 1010 via 'medium'.

Activation, exercised through the repo's DLL:

  • Activating input: [0xa8638f41, 0xb7f05d20, 0xb443cc5b] -> state node
    44 -> camera leaf 54 in Rec 798 (0xa8638f41 is the locationname
    digest carried by Rec 787's shopcomponent data).
  • Divergent siblings: same location with vehiclesize ids
    {0xb7f05d20, medium, 0xc51a15b8, 0x9e5a1ad0} resolves to four
    distinct state nodes {44,46,48,50} -> camera leaves {54,53,52,51}
    with three distinct parameter sets (leaves 51 and 52 are
    byte-identical).
  • Missing input: real-but-unmatched locationname 0x53fb0816 and
    fabricated 0xdeadbeef both return -1 with the active pointer
    preserved. Each library carries exactly one id='default' state,
    always at level 1 (node 2): retrying [default] lands on node 2 ->
    camera leaf 3. No default exists at deeper levels in any library, so
    the fallback appears to be caller-side.
  • Duplicate input: 25 sibling (parent,id) duplicates exist and all
    return -2. In Rec 10 all 23 pairs split by differing 'type'
    (item/weaponitem, itemgroup/weapongroup, ...); in Rec 872 and
    Rec 1010 the two pairs have identical type, a true data ambiguity.
  • Malformed input: Rec 872 has two states whose id attr is kind=4
    ('true'/'false' bools) under node 344; any descent into that sibling
    list returns -3.

Pointer semantics of the reference resolver (12k randomized cases vs an
independent model, zero divergences): relative paths start at *active,
'up' climbs parents but cannot pass the container, and the active-
pointer update is atomic on success only; -1/-2/-3, including mid-path
misses, leave it untouched.

The (id,type) dispatch gap, worth flagging: all 30 shop 'weapon' attrs
sit on nodes literally named 'item', and every ambiguous weapon id
splits exactly as (type=item, type=weaponitem), so a type-aware lookup
appears to resolve all 28/28 real weapon inputs uniquely, while the
id-only reference walker reports -2 on 9 of them. The serialized data
looks built for keyed (id,type) descent; the reference resolver is a
conservative id-only approximation, and its -2 on those 9 inputs is
probably a model artifact rather than broken data.

Not yet established: the native runtime event that invokes this lookup
(lives in script/engine code, not in these tables); how a given
shopcomponents record selects which states library it uses (only
inferred via the shared id domains); and the encrypted LSNS string
pool, which keeps ~40 hash names unresolved.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7065442149 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7065442149). Originally posted by [MarlomMedeiros](https://github.com/MarlomMedeiros) on 2026-11-21T16:10:39Z. --- Extending the script-state notes from #18 to the activation question, using the repo's own resolve_script_path reference walker and the local script.rpf corpus (1,012 PSIN records; single package, no second source; everything stays local). Corpus structure: 996 'shopcomponents' records (physical shop interaction sites: promptposition, scenepositionheading, standflags, locationname, weapon, kitmod), 8 'states' libraries at record indices {10,200,232,292,773,798,872,1010}, and 8 records of other shapes. The states libraries are hierarchical state(id=<joaat>, type=<joaat>) trees whose leaves carry camera parameter nodes (0xc9fd9c54, all five probe literals verify) or preview-offset nodes (0xd5b27926). Call site (serialized side): 44 of the 996 shopcomponents records declare context-key digests, 19 locationname and 25 weapon records, disjoint. Matches land exclusively on level-1 state ids and nowhere else in the corpus (expected chance ~1e-5 or lower; observed 5 locationname -> Rec 798 states, 28 weapon -> Rec 10 states; zero other matches across every kind-5 digest in the file). The other six libraries take keys from non-shopcomponents records, e.g. Rec 239 -> Rec 1010 via 'medium'. Activation, exercised through the repo's DLL: - Activating input: [0xa8638f41, 0xb7f05d20, 0xb443cc5b] -> state node 44 -> camera leaf 54 in Rec 798 (0xa8638f41 is the locationname digest carried by Rec 787's shopcomponent data). - Divergent siblings: same location with vehiclesize ids {0xb7f05d20, medium, 0xc51a15b8, 0x9e5a1ad0} resolves to four distinct state nodes {44,46,48,50} -> camera leaves {54,53,52,51} with three distinct parameter sets (leaves 51 and 52 are byte-identical). - Missing input: real-but-unmatched locationname 0x53fb0816 and fabricated 0xdeadbeef both return -1 with the active pointer preserved. Each library carries exactly one id='default' state, always at level 1 (node 2): retrying [default] lands on node 2 -> camera leaf 3. No default exists at deeper levels in any library, so the fallback appears to be caller-side. - Duplicate input: 25 sibling (parent,id) duplicates exist and all return -2. In Rec 10 all 23 pairs split by differing 'type' (item/weaponitem, itemgroup/weapongroup, ...); in Rec 872 and Rec 1010 the two pairs have identical type, a true data ambiguity. - Malformed input: Rec 872 has two states whose id attr is kind=4 ('true'/'false' bools) under node 344; any descent into that sibling list returns -3. Pointer semantics of the reference resolver (12k randomized cases vs an independent model, zero divergences): relative paths start at *active, 'up' climbs parents but cannot pass the container, and the active- pointer update is atomic on success only; -1/-2/-3, including mid-path misses, leave it untouched. The (id,type) dispatch gap, worth flagging: all 30 shop 'weapon' attrs sit on nodes literally named 'item', and every ambiguous weapon id splits exactly as (type=item, type=weaponitem), so a type-aware lookup appears to resolve all 28/28 real weapon inputs uniquely, while the id-only reference walker reports -2 on 9 of them. The serialized data looks built for keyed (id,type) descent; the reference resolver is a conservative id-only approximation, and its -2 on those 9 inputs is probably a model artifact rather than broken data. Not yet established: the native runtime event that invokes this lookup (lives in script/engine code, not in these tables); how a given shopcomponents record selects which states library it uses (only inferred via the shared id domains); and the encrypted LSNS string pool, which keeps ~40 hash names unresolved.
R0Y00 commented 2026-11-24 06:47:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T16:22:50Z.


Thanks for narrowing the lookup to a candidate (id, type) pair. Please preserve that observation and its limits in the next fixture. The remaining question is which runtime event supplies that pair. A positive case and a nearby input selecting a different state would connect the two.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7065602942 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7065602942). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T16:22:50Z. --- Thanks for narrowing the lookup to a candidate (id, type) pair. Please preserve that observation and its limits in the next fixture. The remaining question is which runtime event supplies that pair. A positive case and a nearby input selecting a different state would connect the two.
MarlomMedeiros commented 2026-11-24 06:47:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MarlomMedeiros on 2026-11-21T16:48:28Z.


PR #133 adds the fixture: tests/script_dispatch_check.py builds a
synthetic states library plus a shopcomponents-style carrier and
exercises the pair supply and both selection cases through the
unmodified reference host.

On the remaining question, the serialized data suggests the carrier
node itself supplies the pair: the carrier's node name carries the
type while its kind-5 attribute carries the id. Real-data anchor:
Rec 1 node 40 is an item-named node under shopcomponent -> data -> 0xbf61523d holding weapon(0xe68a4a98)=0x9fcad864, i.e. the pair
(id=0x9fcad864, type=item), which resolves to Rec 10 node 290
(previewoffset leaf); the same id with type=weaponitem selects
sibling 332 instead. Which native caller performs that extraction is
still open.

Fixture coverage: id-only -> -2; (id, item) -> node 4 -> preview-offset
leaf; (id, weaponitem) -> node 6 -> deeper state -> camera leaf;
unmatched type -> -1; kind=4 bool id -> -3; 3-level
positive/divergent camera branches; relative branch switching; dropped
siblings asserted unreachable. All digests are synthetic joaat labels,
no game data.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7065939644 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7065939644). Originally posted by [MarlomMedeiros](https://github.com/MarlomMedeiros) on 2026-11-21T16:48:28Z. --- PR #133 adds the fixture: `tests/script_dispatch_check.py` builds a synthetic `states` library plus a `shopcomponents`-style carrier and exercises the pair supply and both selection cases through the unmodified reference host. On the remaining question, the serialized data suggests the carrier node itself supplies the pair: the carrier's node name carries the `type` while its kind-5 attribute carries the `id`. Real-data anchor: Rec 1 node 40 is an `item`-named node under `shopcomponent -> data -> 0xbf61523d` holding `weapon(0xe68a4a98)=0x9fcad864`, i.e. the pair `(id=0x9fcad864, type=item)`, which resolves to Rec 10 node 290 (previewoffset leaf); the same id with `type=weaponitem` selects sibling 332 instead. Which native caller performs that extraction is still open. Fixture coverage: id-only -> -2; (id, item) -> node 4 -> preview-offset leaf; (id, weaponitem) -> node 6 -> deeper state -> camera leaf; unmatched type -> -1; kind=4 bool id -> -3; 3-level positive/divergent camera branches; relative branch switching; dropped siblings asserted unreachable. All digests are synthetic joaat labels, no game data.
R0Y00 commented 2026-11-24 06:47:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:23:14Z.


Thanks for the synthetic dispatch fixture in #133. It now gives the proposed (id, type) lookup a reproducible test; the outstanding step on the PR is CTest registration. This issue remains open for evidence of the runtime event that supplies the pair.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066443301 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7066443301). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:23:14Z. --- Thanks for the synthetic dispatch fixture in #133. It now gives the proposed (id, type) lookup a reproducible test; the outstanding step on the PR is CTest registration. This issue remains open for evidence of the runtime event that supplies the pair.
Vonsek commented 2026-11-24 06:47:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:50:36Z.


I checked how much context the serialized medium association can supply. The archive contains a kind-5 field in PSIN record 239, node 3, whose textHash is joaat("medium"). A nearby node, 7, carries a different kind-5 value in the same field (0x6ad38ac4). I supplied the library, root container and invocation to the source-built reference walker in each replay.

  • With library 10 supplied, medium selects node 272 with two direct camera children whose five literal hashes verify. With library 798 supplied, it selects node 6, which has a different state type and one verified camera child.
  • At the root of library 1010, medium returns -1. The same digest occurs under two nested parents there. That makes the record 239 → 1010 association a shared label whose parent context still needs evidence.
  • The observed value from nearby node 7 returns -1 in all three libraries and preserves the active state. Supplying the original field's raw integer or a verified camera's raw priority as the lookup key also returns -1 and preserves the active state.

To reproduce, build script_path_host and run python -B tools/script_state_probe.py <local-script.rpf> --state medium. It lists the matches in libraries 10, 798 and 1010. For the native control, use records and tree_arrays from tools/script_state_probe.py to read the four records. Take the kind-5 textHash for field 0x6ad38ac4 at nodes 3 and 7 of record 239. Pass the hashes one at a time to resolve_path in tests/script_dispatch_check.py, starting with node 1 as both the container and active node for each library. Carry the active node from the first result into the negative controls. An independent byte decode confirmed the source field and selected nodes. The three script CTests passed at e8895ad.

The run establishes that the observed digest can select different camera states once a context is supplied. The runtime event that picks the library and parent path remains unobserved. That step still needs a trace of the caller or a captured input event with its actual lookup arguments.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067553366 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7067553366). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T18:50:36Z. --- I checked how much context the serialized `medium` association can supply. The archive contains a kind-5 field in PSIN record 239, node 3, whose `textHash` is `joaat("medium")`. A nearby node, 7, carries a different kind-5 value in the same field (`0x6ad38ac4`). I supplied the library, root container and invocation to the source-built reference walker in each replay. - With library 10 supplied, `medium` selects node 272 with two direct camera children whose five literal hashes verify. With library 798 supplied, it selects node 6, which has a different state type and one verified camera child. - At the root of library 1010, `medium` returns `-1`. The same digest occurs under two nested parents there. That makes the record 239 → 1010 association a shared label whose parent context still needs evidence. - The observed value from nearby node 7 returns `-1` in all three libraries and preserves the active state. Supplying the original field's raw integer or a verified camera's raw priority as the lookup key also returns `-1` and preserves the active state. To reproduce, build `script_path_host` and run `python -B tools/script_state_probe.py <local-script.rpf> --state medium`. It lists the matches in libraries 10, 798 and 1010. For the native control, use `records` and `tree_arrays` from `tools/script_state_probe.py` to read the four records. Take the kind-5 `textHash` for field `0x6ad38ac4` at nodes 3 and 7 of record 239. Pass the hashes one at a time to `resolve_path` in `tests/script_dispatch_check.py`, starting with node 1 as both the container and active node for each library. Carry the active node from the first result into the negative controls. An independent byte decode confirmed the source field and selected nodes. The three script CTests passed at `e8895ad`. The run establishes that the observed digest can select different camera states once a context is supplied. The runtime event that picks the library and parent path remains unobserved. That step still needs a trace of the caller or a captured input event with its actual lookup arguments.
SuperCraft3M commented 2026-11-24 13:00:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SuperCraft3M on 2026-11-24T12:45:32Z.


Claiming the remaining native-producer slice of #19: identify how a real runtime event or script caller supplies the (id, type) pair to the state resolver, rather than repeating the serialized-tree analysis already covered by #133.

Plan: inspect the local executable and script package offline, retain binaries, disassembly, offsets and paths locally, and look for one positive event/call path plus a nearby input that selects a different branch. Cross-check any proposed pair through the existing source-built resolver fixture; add a synthetic regression only if the observation supports a stable public contract. Report only a sanitized, evidence-limited summary.

Environment: Windows 11 build 26300.9711, x64, RTX 4070 (driver 32.0.16.2114); GPU is not required. I will work from current upstream main cec885b2; planned validation is python -B tests/script_dispatch_check.py and the registered script CTest(s). This depends on the merged #18/#133 resolver baseline. I found no open PR or assignee covering the native caller. No executable, archive or extracted game data will be published.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7131879001 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7131879001). Originally posted by [SuperCraft3M](https://github.com/SuperCraft3M) on 2026-11-24T12:45:32Z. --- Claiming the remaining native-producer slice of #19: identify how a real runtime event or script caller supplies the `(id, type)` pair to the state resolver, rather than repeating the serialized-tree analysis already covered by #133. Plan: inspect the local executable and script package offline, retain binaries, disassembly, offsets and paths locally, and look for one positive event/call path plus a nearby input that selects a different branch. Cross-check any proposed pair through the existing source-built resolver fixture; add a synthetic regression only if the observation supports a stable public contract. Report only a sanitized, evidence-limited summary. Environment: Windows 11 build 26300.9711, x64, RTX 4070 (driver 32.0.16.2114); GPU is not required. I will work from current upstream main `cec885b2`; planned validation is `python -B tests/script_dispatch_check.py` and the registered script CTest(s). This depends on the merged #18/#133 resolver baseline. I found no open PR or assignee covering the native caller. No executable, archive or extracted game data will be published.
SuperCraft3M commented 2026-11-24 13:00:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SuperCraft3M on 2026-11-24T12:49:35Z.


Local-data check (2026-11-24): the existing aligned-page probe recognizes 1,012 PSIN records / supported trees in the local script archive. Its existing validation then stops on a state node whose id attribute is not label-kind (2 occurrences); this is consistent with the source-built resolver treating such IDs as malformed, so I did not weaken that check. This archive-only result does not identify the native runtime event/call site that supplies (id, type). No game data, paths, values, or binary artifacts are attached. I am leaving the source unchanged rather than infer a caller from serialized structure.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7131970573 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/19#issuecomment-7131970573). Originally posted by [SuperCraft3M](https://github.com/SuperCraft3M) on 2026-11-24T12:49:35Z. --- Local-data check (2026-11-24): the existing aligned-page probe recognizes 1,012 PSIN records / supported trees in the local script archive. Its existing validation then stops on a state node whose `id` attribute is not label-kind (2 occurrences); this is consistent with the source-built resolver treating such IDs as malformed, so I did not weaken that check. This archive-only result does not identify the native runtime event/call site that supplies `(id, type)`. No game data, paths, values, or binary artifacts are attached. I am leaving the source unchanged rather than infer a caller from serialized structure.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#19
No description provided.