Skip to content

spec(queen): simulation.t27 - the actor runtime under a seeded deterministic simulation, as a CI gate (Closes #8279) - #8292

Merged
gHashTag merged 1 commit into
masterfrom
spec/queen-simulation
Oct 9, 2026
Merged

gHashTag merged 1 commit into
masterfrom
spec/queen-simulation

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Closes #8279. Part of gHashTag/trios#1712 (item 5); the harness and the CI job are gHashTag/trios#1721 (its PR).

What

specs/queen/simulation.t27 holds the decisions of a seeded deterministic simulation gate for the Queen's actor runtime. The harness in gHashTag/trios drives the real runtime (createActorSystem, the supervisor, remoteChild, createMemoryNet, the reviewer actors) on the virtual clock and asks this card, compiled to wasm, for every one of these decisions:

Decision Card
seeds per CI run, steps per run, runs per seed (logs compared) SEEDS_PER_RUN 16, STEPS_PER_RUN 10 000, RUNS_PER_SEED 2, GATE_BASE_SEED 1712
the only source of randomness sim_roll(seed, stream, index) (counter-based, lowbias32), run_seed, pick_between
each step's event and the fault mix step_event, step_ms, weights W_*: node loss, hung turn, mailbox overflow, unreadable row, provider 429, stale lease, review crash
the store's own fault (PgLink model) answer_lost, W_ANSWER_LOST
what each fault does NODE_RESTART_*, STALL_SECONDS, PROVIDER_429_*, STALE_LEASE_*, UNREADABLE_*, mailbox_burst
which invariants fail the gate fails_gate (all nine), hot_row_bound/hot_loop, over_cap, intensity_kept
rare states every run must reach must_reach over RARE_* (mailbox full, intensity spent, turn killed, mail lost to a lost node, wait backoff, slice yield, child moved node)

Tests

t27c test-report specs/queen/simulation.t27: 10 tests, 10 pass, 0 FAIL, 7 invariants proved, 0 vacuous passes. The C build of the card (gen-c + -DT27_TEST_MAIN) also passes all 10. The seal is saved (.trinity/seals/queen_QueenSimulation.json).

Negative controls

Each rule broken once in a copy of the spec, test-report run on it, the spec restored. 21 of 21 killed:

Rule broken test-report
mix32 multiplier FAIL 1 (the_roll_is_fixed_by_seed_stream_and_index_only)
sim_roll ignores the stream FAIL 1 (the_roll_is_fixed_by_seed_stream_and_index_only)
run_seed on the wrong stream FAIL 1 (the_roll_is_fixed_by_seed_stream_and_index_only)
pick_between off by one FAIL 1 (a_range_pick_stays_inside_its_range)
step_event: hung turn and node loss swapped FAIL 1 (the_fault_mix_gives_each_event_its_band)
step_event: crash band dropped FAIL 1 (the_fault_mix_gives_each_event_its_band)
is_fault excludes node loss FAIL 1 (the_six_named_faults_and_the_crash_are_faults_and_work_is_not)
step_ms never reaches its max FAIL 1 (a_range_pick_stays_inside_its_range)
a burst that only fills the mailbox FAIL 1 (a_burst_always_overflows_the_mailbox)
answer_lost one band too wide FAIL 1 (a_store_answer_is_lost_in_its_band_only)
fails_gate lets runs differ FAIL 1 (every_invariant_fails_the_gate_and_none_is_a_log_line)
hot_row_bound without the visit at the start FAIL 1 (the_hot_loop_bound_admits_the_backoff_and_refuses_the_go_live_loop)
hot_loop at the bound FAIL 1 (the_hot_loop_bound_admits_the_backoff_and_refuses_the_go_live_loop)
hot loop slack raised FAIL 1 (the_hot_loop_bound_admits_the_backoff_and_refuses_the_go_live_loop)
over_cap at the cap FAIL 1 (concurrency_and_intensity_are_upper_bounds)
intensity_kept below the max only FAIL 1 (concurrency_and_intensity_are_upper_bounds)
must_reach admits one too many FAIL 1 (every_rare_state_is_required)
a node restart inside the lease TTL BLOCKED (an invariant or test no longer compiles)
a stall that ends inside its turn BLOCKED (an invariant or test no longer compiles)
steps per run off Resonate BLOCKED (an invariant or test no longer compiles)
a fault weight of zero BLOCKED (an invariant or test no longer compiles)

21 of 21 killed. A BLOCKED mutant is one an invariant refuses at compile time.

Found while writing it

  • t27c gen hoisted the repeated x ^ (x >> 16) of a reassigned var x above its first assignment (common-subexpression elimination across a reassignment), so the first form of mix32 did not compile. The spec now names each stage (let x0 .. x4); the defect in the compiler is not fixed here.

Results of the gate

See gHashTag/trios#1721 (its PR): the gate found a runtime defect on its first runs, re-creates the go-live hot loop from a seed, and reproduces both PgLink defects of trios#1712 item 6 from a seed.

🤖 Generated with Claude Code

…inistic simulation, as a CI gate (Closes #8279)

The card holds the gate's decisions for gHashTag/trios#1712 item 5: 16 seeds
a run, 10 000 steps a seed, every seed twice with the logs compared; one
counter-based sim_roll(seed, stream, index); each step's event and the fault
mix (node loss, hung turn, mailbox overflow, unreadable row, provider 429,
stale lease, review crash) and the store's lost-answer fault; which
invariants fail the gate; the rare states every run must reach.

test-report: 10 tests, 0 FAIL, 0 vacuous; 21 of 21 negative controls killed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) October 9, 2026 18:38
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-09 18:39:07 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 1
FAILING 48
PENDING 0
NO CHECKS YET 0

These columns do not partition: 1 + 48 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=557cd271f4e3 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit b9d22d0 into master Oct 9, 2026
28 of 29 checks passed
gHashTag added a commit to gHashTag/trinity that referenced this pull request Oct 9, 2026
…ages (Refs #1582)

Lane 5 of gHashTag/trios#1712 landed (gHashTag/trios#1726 into actors-next, spec
gHashTag/t27#8292 and #8306; numbers on gHashTag/t27#7851). The post's pending section now
gives them: 18 cases of 10,000 steps, each run twice, in 33.5 s on CI with 0 divergences;
four defects put back into the source and caught from a seed; and the real runtime bug the
gate found first (a turn run for a process that had already exited, fixed with a
regression test). The gate's limits (no keyed actors or adaptive pool in its world, no
nightly run) replace "numbers not posted yet" in the open questions and the limits list.
The production merge, gHashTag/trios#1730, is named as open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag added a commit to gHashTag/trinity that referenced this pull request Oct 10, 2026
…rywhere, seven measured changes to the Queen runtime (Closes #1582) (#1583)

* blog: actors beat the loop on recovery, not everywhere -- seven measured changes to the Queen runtime (Closes #1582)

A post on the Queen actor runtime work of 2026-10-09: the competitor study, the seven
improvements of gHashTag/trios#1712 with the numbers posted on gHashTag/t27#7851, and what
the actor decision card would cost on the bench FPGA (yosys synthesis only). English and
Russian bodies; simulated and measured numbers are labelled as their sources label them.

- bodies/actors-beat-the-loop-on-recovery-not-everywhere.ts, its index.ts entry and the
  posts.ts import and map line.
- public/term/t27c-queen-netlink-fence/: a new recording, made with the exported functions
  of scripts/t27c-mutation-casts.mjs. t27c test-report passes netlink.t27 9 of 9; moving
  the self-fence from 15 s to the 20 s lease fails exactly
  a_node_stops_before_any_peer_can_see_it_down; git restores the spec. Listed first in
  public/term/index.html.
- The post carries the recording as a terminal block in body and ruBody
  (specs/policy/post_widget.t27).

No og-art triptych: every image provider refused (Kie "Credits insufficient", FAL and
Replicate locked), so none is drawn and none is faked; see gHashTag/ghashtag.github.io#45.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: three Russian phrasings in the actors post read naturally (Refs #1582)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: the simulation gate's numbers in the actors post, in both languages (Refs #1582)

Lane 5 of gHashTag/trios#1712 landed (gHashTag/trios#1726 into actors-next, spec
gHashTag/t27#8292 and #8306; numbers on gHashTag/t27#7851). The post's pending section now
gives them: 18 cases of 10,000 steps, each run twice, in 33.5 s on CI with 0 divergences;
four defects put back into the source and caught from a seed; and the real runtime bug the
gate found first (a turn run for a process that had already exited, fixed with a
regression test). The gate's limits (no keyed actors or adaptive pool in its world, no
nightly run) replace "numbers not posted yet" in the open questions and the limits list.
The production merge, gHashTag/trios#1730, is named as open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: say plainly that the gate found the last defect in its table (Refs #1582)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: the actors post says the batch merged into production behind off flags, and gives the quiet-host telemetry cost (Refs #1582)

trios#1730 merged actors-next into the production branch on 2026-10-10 at
13:38Z, so "nothing runs in production; #1730 is open" was no longer true.
The telemetry paragraph now carries the quiet-host A/B from t27#7851
(+3.3% CPU per message, median of 21 rounds) and the base-cost rise from
3.7 to 4.5 us that the same run found, tracked in trios#1743.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: the actors post gives the cost profile's answer - 1.55 us a message on the next batch, and telemetry at the edge of its target (Refs #1582)

trios#1746 found the 4.5 us predates the seven lanes: a card looked up again
on every call by a long key (44% of the time) and slot_of asked three times
a message. The post said lanes 2, 6 and 7 were the likely cause; the profile
says they were not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: resolve the index.ts conflict the main merge left committed, and fix an unescaped quote in the actors post (Refs #1582)

The merge of main in 3de6fae committed index.ts with its conflict markers:
the merge output was cut short and the file was never checked for markers.
This keeps both new posts, ours first, then two-keys-one-verdict from main.
The actors entry's receipts mark trios#1730 MERGED and add #1754 and #1746.
Its open questions now say what is true today: everything is in production
behind off flags, and the telemetry figures are measured, no longer estimated.

The body had "telemetry's" inside a single-quoted string, which broke the
string. Both files and posts.ts now pass `bun build --no-bundle`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to gHashTag/trinity that referenced this pull request Oct 10, 2026
feat(website): blog post -- actors beat the loop on recovery, not everywhere, seven measured changes to the Queen runtime (Closes #1582) (#1583)

* blog: actors beat the loop on recovery, not everywhere -- seven measured changes to the Queen runtime (Closes #1582)

A post on the Queen actor runtime work of 2026-10-09: the competitor study, the seven
improvements of gHashTag/trios#1712 with the numbers posted on gHashTag/t27#7851, and what
the actor decision card would cost on the bench FPGA (yosys synthesis only). English and
Russian bodies; simulated and measured numbers are labelled as their sources label them.

- bodies/actors-beat-the-loop-on-recovery-not-everywhere.ts, its index.ts entry and the
  posts.ts import and map line.
- public/term/t27c-queen-netlink-fence/: a new recording, made with the exported functions
  of scripts/t27c-mutation-casts.mjs. t27c test-report passes netlink.t27 9 of 9; moving
  the self-fence from 15 s to the 20 s lease fails exactly
  a_node_stops_before_any_peer_can_see_it_down; git restores the spec. Listed first in
  public/term/index.html.
- The post carries the recording as a terminal block in body and ruBody
  (specs/policy/post_widget.t27).

No og-art triptych: every image provider refused (Kie "Credits insufficient", FAL and
Replicate locked), so none is drawn and none is faked; see gHashTag/ghashtag.github.io#45.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: three Russian phrasings in the actors post read naturally (Refs #1582)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: the simulation gate's numbers in the actors post, in both languages (Refs #1582)

Lane 5 of gHashTag/trios#1712 landed (gHashTag/trios#1726 into actors-next, spec
gHashTag/t27#8292 and #8306; numbers on gHashTag/t27#7851). The post's pending section now
gives them: 18 cases of 10,000 steps, each run twice, in 33.5 s on CI with 0 divergences;
four defects put back into the source and caught from a seed; and the real runtime bug the
gate found first (a turn run for a process that had already exited, fixed with a
regression test). The gate's limits (no keyed actors or adaptive pool in its world, no
nightly run) replace "numbers not posted yet" in the open questions and the limits list.
The production merge, gHashTag/trios#1730, is named as open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: say plainly that the gate found the last defect in its table (Refs #1582)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: the actors post says the batch merged into production behind off flags, and gives the quiet-host telemetry cost (Refs #1582)

trios#1730 merged actors-next into the production branch on 2026-10-10 at
13:38Z, so "nothing runs in production; #1730 is open" was no longer true.
The telemetry paragraph now carries the quiet-host A/B from t27#7851
(+3.3% CPU per message, median of 21 rounds) and the base-cost rise from
3.7 to 4.5 us that the same run found, tracked in trios#1743.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: the actors post gives the cost profile's answer - 1.55 us a message on the next batch, and telemetry at the edge of its target (Refs #1582)

trios#1746 found the 4.5 us predates the seven lanes: a card looked up again
on every call by a long key (44% of the time) and slot_of asked three times
a message. The post said lanes 2, 6 and 7 were the likely cause; the profile
says they were not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* blog: resolve the index.ts conflict the main merge left committed, and fix an unescaped quote in the actors post (Refs #1582)

The merge of main in 3de6fae committed index.ts with its conflict markers:
the merge output was cut short and the file was never checked for markers.
This keeps both new posts, ours first, then two-keys-one-verdict from main.
The actors entry's receipts mark trios#1730 MERGED and add #1754 and #1746.
Its open questions now say what is true today: everything is in production
behind off flags, and the telemetry figures are measured, no longer estimated.

The body had "telemetry's" inside a single-quoted string, which broke the
string. Both files and posts.ts now pass `bun build --no-bundle`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

queen: simulation.t27 - the actor runtime under a seeded deterministic simulation, as a CI gate

2 participants