Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
2abc453
add 3 storage-access profile scenarios to BatchInstrumentationTest
claude May 21, 2026
74dcd01
decouple per-turn submission from engine execution via SignedCommitMa…
claude May 21, 2026
0a9a29d
add equivalence, validation, edge, and gas-comparison tests for batch…
claude May 21, 2026
b2ec4a8
update OPT_PLAN with concrete todo + decision log; refresh gas snapshots
claude May 21, 2026
3aa1026
add transient shadow layer per OPT_PLAN §5 (does NOT save gas)
claude May 21, 2026
5c5a7ea
Revert "add transient shadow layer per OPT_PLAN §5 (does NOT save gas)"
claude May 22, 2026
79fea91
add SSTORE/SLOAD trace tally test for legacy vs batched flows
claude May 22, 2026
b9ea81b
re-key moveBuffer by engine storageKey + add realistic-game access trace
claude May 22, 2026
dd4aa6a
trim submission overhead: drop event, add getSubmitContext, repack Ba…
claude May 22, 2026
e2616dd
checkpoint: add shadow layer infrastructure (transient mirrors + help…
claude May 22, 2026
6be575c
shadow refactor: route slot-1 reads/writes through helpers (WIP, part…
claude May 22, 2026
55f2929
shadow refactor: complete BattleData slot-1 routing + executeBatchedT…
claude May 22, 2026
2ceaa1e
shadow refactor: MonState shadow + steady-state harness for BatchGasTest
claude May 22, 2026
1903a9f
diagnostic: slot-bucket breakdown for batched executeBuffered
claude May 22, 2026
0ff3fe3
shadow: skip MonState flush on game-over
claude May 22, 2026
3d3f785
shadow: narrow koBitmaps shadow for batched executeBatchedTurns
claude May 22, 2026
1052a42
opt_plan: document shadow follow-ups and stop point
claude May 22, 2026
7b362ef
test: add 14-turn realistic game gas measurement
claude May 22, 2026
d25874d
docs: flag the single-tx warmth bias in gas measurement
claude May 22, 2026
df02e3a
WIP: salt size reduction (104 -> 96) + epoch tag + counter elimination
claude May 22, 2026
02f48e9
Revert "WIP: salt size reduction (104 -> 96) + epoch tag + counter el…
claude May 22, 2026
eb95d2c
WIP: msg.sender + single-sig refactor for executeWithDualSignedMoves …
claude May 22, 2026
d16c425
single-sig: drop committer signature in dual-signed flows
claude May 23, 2026
89b440a
profile: per-region gas instrumentation in executeBatchedTurns
claude May 23, 2026
94cf55d
fuse: _handleEffectsTriple for RoundStart + RoundEnd lifecycle steps
claude May 23, 2026
30119df
cleanup: strip gas-profile instrumentation, update OPT_PLAN with trac…
claude May 23, 2026
d7689e3
opt: drop per-turn events + hoist constant config fields from _execut…
claude May 23, 2026
36c3c7d
docs: record effect-data shadow rejection in OPT_PLAN §12
claude May 23, 2026
2b92c21
opt: coalesce _getActiveMonIndex reads within function frames (H)
claude May 23, 2026
ac1c4b4
safety: revert _handleEffectsTriple cross-branch hoist (HardReset con…
claude May 23, 2026
65b92df
opt: coalesce BD-slot-1 reads in _executeInternal + _handleMove turnI…
claude May 23, 2026
8405526
opt: cache battleKeyForWrite per frame (post-H sweep #2)
claude May 23, 2026
0bfea95
opt: tiered EffectInstance storage — inline data in slot 0 when it fits
claude May 23, 2026
6ba4a9a
opt: Yul switch for tiered effect dispatch + opcode tally analysis
claude May 23, 2026
2ad9ce2
Revert "opt: Yul switch for tiered effect dispatch + opcode tally ana…
claude May 23, 2026
3d3f1c1
Revert "opt: tiered EffectInstance storage — inline data in slot 0 wh…
claude May 23, 2026
599d48c
docs: record tiered EffectInstance storage explore-and-revert in OPT_…
claude May 23, 2026
5986f36
feat(cpu): ship batched mode with trusted-state hint (Phase 2.5)
claude May 23, 2026
8adaf61
test: CPU batched mode gas + access-tally comparison
claude May 23, 2026
2766c69
Revert "test: CPU batched mode gas + access-tally comparison"
claude May 23, 2026
f0a6315
Revert "feat(cpu): ship batched mode with trusted-state hint (Phase 2…
claude May 23, 2026
d383232
feat(cpu): ship off-chain CPU batched mode as BatchedCPUMoveManager
claude May 24, 2026
2d8a863
opt: pack per-turn move/salt transients into a single slot
claude May 24, 2026
65a2c3c
opt(cpu): cache p0 + gameOverFlag inside bufferState, drop per-submit…
claude May 24, 2026
84d6a3e
opt(pvp): direct engine entry for moveManager==0 dual-signed flow
claude May 24, 2026
bdc0505
opt(cpu): use cached p0 + skip defensive SLOAD on cache miss
claude May 24, 2026
6276d2c
feat(engine): coalesced move-facing APIs for cheaper external moves
claude May 24, 2026
0952574
opt(engine): drop two zero-caller external getters
claude May 24, 2026
a5bc51b
opt(engine): drop two more test-only getters
claude May 24, 2026
d1edf81
migrate(mons): swap loop-dedup ability/move pattern to addEffectIfNot…
claude May 24, 2026
8f5f552
opt(engine): drop getAndInitGlobalKV — only one migratable site found
claude May 24, 2026
88195e6
migrate(mons): swap SneakAttack damage-calc reads to getMoveContext
claude May 24, 2026
3fdc782
revert(engine): remove getMoveContext — fat-context regresses partial…
claude May 24, 2026
a6a5b35
docs: add CHANGELOG summarizing branch's engine API + optimization work
claude May 24, 2026
bb80557
cleanup: drop unused imports + silence shadow warning
claude May 24, 2026
97fb7b9
cleanup(engine): drop unused locals/params, DRY addEffectIfNotPresent…
claude May 24, 2026
fc069ce
cleanup(managers): tighten wordy doc comments in new managers
claude May 24, 2026
fc2c55f
docs: rewrite OPT_PLAN as a results retrospective
claude May 24, 2026
8816414
opt(engine): per-field MonState reads bypass full unpack on legacy path
claude May 24, 2026
a1cd1e6
opt(engine): per-field MonState writes for updateMonState numeric bra…
claude May 25, 2026
f09d821
Revert "opt(engine): per-field MonState writes for updateMonState num…
claude May 25, 2026
14dfd4e
opt(engine): thread isBatched through hot internals to skip TLOAD
claude May 25, 2026
f296997
test: add shadow-probe correctness tests for batched flow
claude May 25, 2026
1013dde
cleanup(engine): drop no-bool shadow-helper wrappers
claude May 25, 2026
1a07418
opt(engine): coalesce slot1 reads in _handleMove
claude May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 257 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

611 changes: 155 additions & 456 deletions OPT_PLAN.md

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions script/EngineAndPeriphery.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "../src/Constants.sol";
// Fundamental entities
import {SignedCommitManager} from "../src/commit-manager/SignedCommitManager.sol";
import {Engine} from "../src/Engine.sol";
import {DefaultValidator} from "../src/DefaultValidator.sol";
import {OkayCPU} from "../src/cpu/OkayCPU.sol";
import {BetterCPU} from "../src/cpu/BetterCPU.sol";
import {FairCPU} from "../src/cpu/FairCPU.sol";
Expand All @@ -16,7 +15,6 @@ import {IGachaRNG} from "../src/rng/IGachaRNG.sol";
import {GachaTeamRegistry} from "../src/game-layer/GachaTeamRegistry.sol";
import {TypeCalculator} from "../src/types/TypeCalculator.sol";
import {SignedMatchmaker} from "../src/matchmaker/SignedMatchmaker.sol";
import {SimplePM} from "../src/hooks/SimplePM.sol";
import {ReturnerGift} from "../src/game-layer/ReturnerGift.sol";

// Shared effects
Expand Down Expand Up @@ -95,9 +93,6 @@ contract EngineAndPeriphery is Script {
SignedMatchmaker signedMatchmaker = new SignedMatchmaker(engine);
deployedContracts.push(DeployData({name: "SIGNED MATCHMAKER", contractAddress: address(signedMatchmaker)}));

// SimplePM simplePM = new SimplePM(engine);
// deployedContracts.push(DeployData({name: "SIMPLE PM", contractAddress: address(simplePM)}));

ReturnerGift returnerGift = new ReturnerGift(address(gachaTeamRegistry));
deployedContracts.push(DeployData({name: "RETURNER GIFT", contractAddress: address(returnerGift)}));

Expand Down
12 changes: 6 additions & 6 deletions snapshots/BetterCPUInlineGasTest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Flag0_P0ForcedSwitch": "25377",
"Turn0_Lead": "107260",
"Turn1_BothAttack": "240701",
"Turn2_BothAttack": "214777",
"Turn3_BothAttack": "210801",
"Turn4_BothAttack": "210805"
"Flag0_P0ForcedSwitch": "20651",
"Turn0_Lead": "110075",
"Turn1_BothAttack": "251390",
"Turn2_BothAttack": "225466",
"Turn3_BothAttack": "221490",
"Turn4_BothAttack": "221494"
}
38 changes: 19 additions & 19 deletions snapshots/EngineGasTest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"B1_Execute": "912113",
"B1_Setup": "850985",
"B2_Execute": "659466",
"B2_Setup": "307623",
"Battle1_Execute": "443036",
"Battle1_Setup": "826189",
"Battle2_Execute": "364327",
"Battle2_Setup": "245514",
"External_Execute": "451382",
"External_Setup": "816904",
"FirstBattle": "2920585",
"Inline_Execute": "317825",
"Inline_Setup": "227355",
"Intermediary stuff": "45252",
"SecondBattle": "2957006",
"Setup 1": "1712677",
"Setup 2": "312571",
"Setup 3": "353891",
"ThirdBattle": "2293275"
"B1_Execute": "938347",
"B1_Setup": "851601",
"B2_Execute": "684878",
"B2_Setup": "308962",
"Battle1_Execute": "455276",
"Battle1_Setup": "826804",
"Battle2_Execute": "376485",
"Battle2_Setup": "246129",
"External_Execute": "463766",
"External_Setup": "817538",
"FirstBattle": "3046038",
"Inline_Execute": "323087",
"Inline_Setup": "228069",
"Intermediary stuff": "45490",
"SecondBattle": "3092714",
"Setup 1": "1713329",
"Setup 2": "313205",
"Setup 3": "354535",
"ThirdBattle": "2418090"
}
4 changes: 2 additions & 2 deletions snapshots/EngineOptimizationTest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ExternalStaminaRegen": "389950",
"InlineStaminaRegen": "1035668"
"ExternalStaminaRegen": "410708",
"InlineStaminaRegen": "1061124"
}
12 changes: 6 additions & 6 deletions snapshots/FullyOptimizedInlineGasTest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Fast_Battle1": "1895389",
"Fast_Battle2": "1792891",
"Fast_Battle3": "1314750",
"Fast_Setup_1": "1345979",
"Fast_Setup_2": "219252",
"Fast_Setup_3": "215455"
"Fast_Battle1": "2008292",
"Fast_Battle2": "1912317",
"Fast_Battle3": "1429283",
"Fast_Setup_1": "1346713",
"Fast_Setup_2": "219734",
"Fast_Setup_3": "216190"
}
28 changes: 14 additions & 14 deletions snapshots/InlineEngineGasTest.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"B1_Execute": "896745",
"B1_Setup": "782990",
"B2_Execute": "621601",
"B2_Setup": "286671",
"Battle1_Execute": "398480",
"Battle1_Setup": "758186",
"Battle2_Execute": "317777",
"Battle2_Setup": "226783",
"FirstBattle": "2606959",
"SecondBattle": "2604950",
"Setup 1": "1636824",
"Setup 2": "321759",
"Setup 3": "317965",
"ThirdBattle": "1979658"
"B1_Execute": "936501",
"B1_Setup": "783478",
"B2_Execute": "660261",
"B2_Setup": "288189",
"Battle1_Execute": "417315",
"Battle1_Setup": "758674",
"Battle2_Execute": "336574",
"Battle2_Setup": "227271",
"FirstBattle": "2770951",
"SecondBattle": "2781914",
"Setup 1": "1637310",
"Setup 2": "322245",
"Setup 3": "318451",
"ThirdBattle": "2143284"
}
6 changes: 3 additions & 3 deletions snapshots/MatchmakerTest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Accept1": "343446",
"Accept2": "34250",
"Propose1": "197406"
"Accept1": "343811",
"Accept2": "34363",
"Propose1": "197519"
}
10 changes: 5 additions & 5 deletions snapshots/StandardAttackPvPGasTest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Turn0_Lead": "71144",
"Turn1_BothAttack": "121432",
"Turn2_BothAttack": "81643",
"Turn3_BothAttack": "81682",
"Turn4_BothAttack": "81698"
"Turn0_Lead": "70132",
"Turn1_BothAttack": "123398",
"Turn2_BothAttack": "83618",
"Turn3_BothAttack": "83648",
"Turn4_BothAttack": "83676"
}
Loading