Repository navigation
feat(sim): model Number Of Players over the scenario roster - #132
Conversation
Number Of Players(team) counts the scenario players on the resolved team — All Teams counting every declared player — the same roster All Players enumerates and no action changes. This was the remaining Bastion-used value construct tracked here; every construct the issue lists was already modeled, and the wright/Bastion workload now moves past numberOfPlayers and stops at value mappedArray (tick 1, rule 20, action 3), which "Map-free forms only" excludes. Fixes #56
Divide, Modulo and Raise To Power could produce a NaN or infinity that
serialized as `{"type":"number","value":null}` in the trace: the scalar
arm of `vector::arithmetic`, the `binary` value calls and the `Modify`
operators returned `Val::Number` without the finite check the vector
arms already enforced. Route every scalar numeric result through
`produced_number` so the run stops `not_modeled` naming the construct,
as the documented rule requires.
|
Review findings addressed in 6dfaac0 ( Fixed: scalar arithmetic producing non-finite values that serialized as Gates: Ready for follow-up review. |
Round To Integer wrapped its ceil/floor/round result in `Val::Number`
raw, and the `.ow` number literal arm of `eval` returned `Val::Number`
unchecked — `f64::from_str` saturates an overflowing digit run — so a
non-finite `f64` reached store sinks and serialized
`{"type":"number","value":null}` in the trace. Route the
`roundToInteger` result through `produced_number` and finite-check the
literal at evaluation, sealing the `Set`/`Append`/`For`-start literal
sinks issue #56's constructs reach; both now stop `not_modeled` naming
the construct.
Non-finite producers outside issue #56's constructs — the `For` `End`
step write, `Set Max Health`, the `Damage`/`Heal` applied values,
`Speed Of`, the match clock's `elapsed` accumulation,
`Set Ability Cooldown`, `Set Ultimate Charge` and the `hero_settings`
percent multipliers — can still serialize `null`; recorded as a known
gap in docs/findings.md pending a structural guard.
|
Round-2 review findings addressed in 046393d ( Fixed (the sites inside issue #56's constructs):
Deliberately left (outside issue #56's constructs — recorded as a known gap in
Gates: Ready for follow-up review. |
Summary
Number Of Players(team)is modeled: it counts the scenario players on the resolved team —All Teamscounting every declared player — over the same scenario rosterAll Playersenumerates, which no action changes. Theteamargument resolves to a catalogTeammember id the wayAll Players' does; an evaluated non-member isnot_modeled.This was the last Bastion-used general value still returning
not_modeled. Every construct the issue lists was already modeled onmain(PRs #61 and #62); this PR completes the remaining gap and the issue's verification bookkeeping.Modeled / not modeled
Modeled by this PR:
Number Of Players—All Teamscounts every scenario player;Team 1/Team 2count the declaredteam; a player without a team counts only forAll Teams; the roster is read-only.Already modeled on
main(verified against the current source):If-Then-Else,Compare(all six operators, arrays/null included),Not,Or,Divide,Modulo,Min,Max,Raise To Power,Round To Integer,Sine From Radians,First Of,Last Of,Count Of,Empty Array,Array Contains,Index Of Array Value,Array Slice,Append To Array,Remove From Array,Value In Array,Sorted Array,Filtered Array,Is True For All,Is True For Any,Current Array Element,Current Array Index,Evaluate Once, plusSet/Modify * Variable At Indexand the fullModifyoperator set.Left
NotModeled(all out of scope):Mapped Array— explicitly excluded by "Map-free forms only".All Living Players,Players In Slot— roster reads outside the issue's list (tracked under athena#105 work).Bastion progression
value numberOfPlayers(was the tick-0 stop, rule 41). Next stop:value mappedArray, tick 1, rule 20[Hero/Ana] Display sleep HUD, action 3 — out of scope per "Map-free forms only".bastion.ow+ completed scenario: unchanged, stops ataction wait under a 90% simulation rate, tick 91, rule 218initialize effects, action 2 — unrelated slow-motion wait behavior, not a value construct.Verification
cargo fmt --check— clean.cargo clippy --all-targets -p athena-sim -- -D warnings— clean.cargo test -p athena-sim --test number_of_players— 5 tests pass: team counts, empty roster/team, player without a team (boundary), evaluated member-id argument, non-member argument.cargo test -p athena-sim— full suite passes.cargo check --locked --target wasm32-unknown-unknown -p athena-sim— clean.Docs:
docs/simulator-interface.md(modeled-values list),docs/scenario-format.md(modeled reads) anddocs/findings.mdupdated.Unverified
Number Of Playersor the other general/array values; all are recorded as modeled-not-measured indocs/findings.mdper the capture policy.All Teamscovering unteamed players is unmeasured; the model followsAll Players' roster treatment.