The replica knows each strike's window, and its blast ends by the same tick #140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3774-the-replica-knows-each-strike-s-window-a"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3774
Step 2 of plan #3560 (a launched nuke reveals where it lands to every player). The replica now knows each strike's reveal window on its local clock, and the blast's drawn effect ends on the tick that window does. Nothing new draws yet: step 3 feeds the replica's sight sources to the fog. The step changes no server code.
What it delivers
Replicakeeps the landed strikes that each Nukes carries. Each one's due tick is on the local clock: the frame's tick less itsticksSince.Replica.reveals()gives the shared rule's sight sources (addReveals, src/shared/nuke.ts) atlocalTick, from the strikes in flight and the landed ones. A strike's disc holds from the frame that lists it through local tickdue + BLAST_TICKS − 1, across the frame that moves it from flight to the landed list, and none atdue + BLAST_TICKS.landedtodetonated, sincelandednow holds the wire's landed strikes.Tests
due + BLAST_TICKS − 1(489), across the frame at 40 that lands it, and none after. It detonates once.nukes.root.children) hold the strike's effect alone at every tick from its listing throughdue + BLAST_TICKS − 1, and nothing fromdue + BLAST_TICKSon. Two cases: a detonation the replica steps through, and a strike it saw in flight whose landing it learns from a Snapshot 12 ticks after the due tick.Failing before: on the step's base (
425535f), the late-Snapshot nuke case fails with 24 wrong samples: the effect is still drawn at ticks 760–771 at both phases, 12 ticks (the Snapshot's lateness) past the reveal's end. The dating test fails on its tick (52 against 40), and the two reveal tests fail since the base replica has noreveals(). The step-through nuke case passes on the base, as expected.Mutation check (whole-tree copies of the head, one edit each, running replica.test.ts and nuke.test.ts):
reveals()reads only the strikes in flightreveals()reads only the landed strikestick + ticksSinceChecks
Fall,Strike), and render/nuke.ts imports onlysameStrikefrom it. The yard's dist (mock/map.html, vite build fromgit archivetrees) is byte-identical between base425535fand head92f7e19: 61 files, the same digest. So the yard draws as before, and the Map Yard bench was not run.full.world,playerId,units,credits,training,cities,layouts,siloClocks(),flights()andlocalTick(besides feeding it withapplyandadvance). It reads no detonation, no landed strike and no sight source. The host's shadow of each remote session reads onlyunits.npm run bench(src/bench/net.ts bundled per arm with esbuild, wan, seed 11), every scenario (idle, battle, assault, economy, cities, churn, siege) at 128 and 256: all 14 cases are identical to the base in hash, gameHash, commandHash, the command list and every client's row, raw and deflated bytes included. So the 14 AI matches were not rerun.92f7e19):fast, this run's gate #1 (tracker gate run 280): passed,npm test979/979.full, this run's gate #2 (tracker gate run 281): passed,npm test979/979 in 27.4 s andtest:phone180/180, nuke.phone.ts included.