Repository navigation
fix(ironsmith): stop Commander games freezing, start seats together, stop the guest hand blinking - #1300
Merged
khaliostr merged 3 commits intoNov 26, 2026
Conversation
…t hand blinking The host now sends the match's decks to the other seats before it starts its own engine, so each seat compiles the cards while the host does instead of after it. A seat keeps that engine for the sync that follows. A seat also puts its own view back right after the room's public view is drawn, before the browser paints, so its hand no longer disappears for a moment on every input.
1.0.2 fixes Commander games freezing: checking whether a commander or any other spell could be paid for searched every activation order once a Signet was in play, and each manual land tap re-searched the payment.
1.0.3 holds a pass-until target the way hosted Forge does: across turn boundaries, and without another seat's stop ending it. With default phase stops a three-player turn went from 15 priority prompts to 5.
khaliostr
approved these changes
Nov 26, 2026
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
ironsmith-wasmto 1.0.3, which fixes Commander games slowing down and then freezing, and makes the engine hold a pass-until target the way hosted Forge does.Why
A three-player Commander table on play.manabrew.app got slower every turn (about 5 s per land tap) and then stopped responding. Two other things showed up in the same game: a long "waiting for players" at the start, and the guests' hands flickering.
The freeze (engine, fixed in 1.0.2). The engine has a cheap test for "this cost certainly cannot be paid". It stood down whenever it met an ability it did not recognise, and ordinary spell markers counted: cascade, "can't be countered if X is 5 or more", "damage can't be prevented". With one of those on a commander or in hand and a Signet in play, every unaffordable check simulated every activation order. Each seat replays every input, so every engine paid for it. Measured on the published 1.0.0 package with three seats and an 8-mana commander: one input took 21–28 s with four mana sources and 177 s a turn later; the same game without commanders stayed under 250 ms. 1.0.2 also bounds the commander check like the rest of the menu, counts what a mana ability costs to activate (a Signet nets one mana), and budgets the re-plan after a manual tap, which had been taking 16–19 s per tap on a six-source board.
Phase stops (engine, fixed in 1.0.3). During the game a player noted that turns were slow compared to Forge because the phase stops did not seem to be honoured. A pass carries an
untiltarget, and hosted Forge holds it per seat until that player's step arrives (PriorityFastForward). Ironsmith mapped it to an engine yield that ended with the current turn and whenever any other seat stopped, so every seat was asked again at upkeep and at each of the active player's stops. With the client's default stops, three seats that only pass got 15 priority prompts a turn where Forge's rule gives 5. The adapter now keeps the target per seat across turns, still asks when something is on the stack or creatures are attacking, and drops the hold on an extra phase, the holder's own extra turn, or a target player leaving. Verified matches keep the engine's signed yield and are unchanged.Startup. A seat only began compiling cards when the host's first sync arrived, which the host sends after its own engine has started. Compiling three Commander decks takes about 20 s, so seats were ready one compile after the host. Now the host sends a
preparepayload with the decks first; a seat compiles them in an engine it then keeps for the sync. This usesregisterManabrewDeckSources, which 1.0.0 already has.Flicker. The store draws the room's public view (no hidden cards) on every seat. A seat then asked its engine for its own view again, which is a worker round trip, so the public view was painted in between. A seat now re-emits the view it last drew, in a microtask, so it lands after every listener of the event and before the browser paints.
Test plan
IronsmithTrustedGameApiin Chrome pages joined by an in-process relay, three preset Commander decks:main, 30.3 s here (all three engines shared one machine; on separate machines a seat should be ready about when the host is);main, 0 of ~7,900 here;getNextStoptargets: 12 pass-only turns went from 15 priority prompts a turn to 5 (the active seat's main 1, attackers and main 2, and each opponent's end step); a 29-turn game with real actions finished without errors, and every prompt during a hold was in a combat step with attackers.vitest run src/game: 55 pass.eslintandprettier --checkon the changed files are clean;tscreports nothing in them (my checkout has stub wasm bindings, so it still reports the existingWasmBot/WasmManaboterrors elsewhere).yarn lint, thetests/e2e-ironsmithsuite, a run against the real relay with players on separate machines, and a browser run on 1.0.3 (the three-seat browser runs above were on 1.0.2; 1.0.3 was measured through the adapter in Node, andtests/e2e-ui/forge-wasm-autopass.mjswas not run against it).Still slow, though no longer growing without limit: on a 19-permanent board, cancelling a payment took about 1 s per seat.
prepareis a new private payload type. Older clients ignore payload types they do not know, so this needs no transcript version bump; a seat that does not get one starts as before.🤖 Generated with Claude Code