Repository navigation
feat(sim): model Mapped Array with element context - #135
Merged
Merged
Conversation
Mapped Array joins the element-context array values: the array reads once — Null as the empty array, a non-array operand not_modeled — and the operand evaluates once per element with Current Array Element and Current Array Index bound, a nested element-context value rebinding the pair for its own operand. The per-element results collect into the produced array; a non-finite number among them stops not_modeled through the produced_number check. The wright Bastion fixture moves past value mappedArray to the known stop: action wait under a 90% simulation rate at tick 91, rule 228 "initialize effects", action 2. Modeled, not measured — no client capture covers the construct. Fixes #134
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mapped Arrayis modeled with the element-context rules the other array values already use (athena#134, excluded by athena#56's "Map-free forms only"). The array reads once —Nullas the empty array, a non-array operandnot_modeled— and the operand evaluates once per element withCurrent Array ElementandCurrent Array Indexbound to the element and its place; a nested element-context value rebinds the pair for its own operand and the outer binding applies again outside it. The per-element results collect into the produced array; a non-finite number among them stopsnot_modeledthrough theproduced_numbercheck, the same stop every produced number gets.Bastion progression
tests/fixtures/workshop/real-world/bastion.ow+docs/scenario-examples/valid/bastion.json): moved pastvalue mappedArray(was tick 1, rule 20[Hero/Ana] Display sleep HUD, action 3). Next stop:action wait under a 90% simulation rate, tick 91, rule 228initialize effects, action 2 — the documented non-goal of this issue.Verification
cargo test -p athena-sim --test element_context— 12 tests pass: per-element collect with element/index binding, empty array,Nulloperand, non-array operand boundary, constant mapping (the Bastion form), nested element context rebind/restore, non-finite mapped result viaproduced_number, andEvaluate Onceinside aMapped Arrayoperand staysnot_modeled.cargo test -p athena-sim— full suite passes (includesprobe_hashes).cargo fmt --check— clean.cargo clippy --all-targets -p athena-sim -- -D warnings— clean.cargo check --locked --target wasm32-unknown-unknown -p athena-sim— clean.Docs:
docs/simulator-interface.md,docs/findings.mdanddocs/architecture.mdupdated;Mapped Arrayis recorded as modeled-not-measured (no client capture covers it).Unverified
Mapped Array; it is modeled-not-measured per the capture policy. The same is true of the other element-context values.