Skip to content

feat(sim): model Mapped Array with element context - #135

Merged
e54-bot merged 1 commit into
mainfrom
feat/mapped-array
Oct 28, 2026
Merged

e54-bot merged 1 commit into
mainfrom
feat/mapped-array

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Mapped Array is 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 — 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 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 stops not_modeled through the produced_number check, the same stop every produced number gets.

Bastion progression

  • wright fixture (tests/fixtures/workshop/real-world/bastion.ow + docs/scenario-examples/valid/bastion.json): moved past value 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 228 initialize 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, Null operand, non-array operand boundary, constant mapping (the Bastion form), nested element context rebind/restore, non-finite mapped result via produced_number, and Evaluate Once inside a Mapped Array operand stays not_modeled.
  • cargo test -p athena-sim — full suite passes (includes probe_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.
  • Bastion workload re-run above confirms the moved stop.

Docs: docs/simulator-interface.md, docs/findings.md and docs/architecture.md updated; Mapped Array is recorded as modeled-not-measured (no client capture covers it).

Unverified

  • No client capture exists for Mapped Array; it is modeled-not-measured per the capture policy. The same is true of the other element-context values.

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
@e54-bot
e54-bot merged commit 7c9d431 into main Oct 28, 2026
3 checks passed
@e54-bot
e54-bot deleted the feat/mapped-array branch October 28, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants