Commit Graph

36 Commits

Author SHA1 Message Date
e9e9939bd8 refactor: 删除 data-state 中的 legacy 文件夹 2026-09-17 19:37:30 +08:00
a2a8e6ec35 refactor: ReplaySystem.route -> ReplaySystem.array,修复 disabled 标记在 setReplayArray 中清零可能导致意外记录的问题 2026-09-17 19:18:30 +08:00
e4d392330c fix(07-11): #06-17-4/5/6 add top-level same-reference integration assertions
- CoreState 三档往返中断言装备实例、flag 字段与 follower 实例跨读档为同一实例
- 同时断言其数值/位置仍等于存档点(同引用不改变恢复结果)
- 新增 registerIdentityEquipment 夹具,既有夹具与断言未改动
2026-09-17 13:57:46 +08:00
fe595b7983 refactor: 存档系统应处于渲染层 2026-09-16 21:54:12 +08:00
49aacb087a refactor: 调整录像命名 2026-09-16 21:51:19 +08:00
5317b2f1e3 test(06-18): add whole-map critical timing and total/avg summary table
Adds a third metric that calls the real calculateCritical for every monster on
the merged map and fully consumes the generator, plus a second console.table
with monsters / total ms (sampled median of one full-map sweep) / avg ms.
avg ms equals total ms divided by the monster count.
2026-09-16 20:39:45 +08:00
c193c4e9a9 test(06-18): add merged real-map scenario perf for buildup and map damage
Merges the first 1/5/13 real 13x13 maps into one grid-tiled map
(13x13, 39x26, 52x52 with 11/79/204 monsters), builds the scene from a real
CoreState (real converters/reducer/calculator/final effect), assigns 12 real
Enemy prefabs (3 CommonAura ranges + GuardAura) via a seeded mulberry32, and
records buildup + map damage build timings with performance.mark/measure.
Zero assertions.
2026-09-16 20:33:18 +08:00
6c4d3709d3 test(06-18): migrate 5 existing perf files to performance.mark/measure
- measureCase sampling loop now pairs mark(startTag)/mark(endTag) with
  measure(measureName, startTag, endTag) and clears marks/measures per sample
- tag names derive from caseName+scale so they never collide across cases
- WARMUP_RUNS/SAMPLE_RUNS/median/min/p95/toFixed(3)/columns unchanged
2026-09-16 20:26:42 +08:00
940e31f293 test(07-09): #06-17-2 combat-side same-reference hero attribute regression
- migrate the top-level snapshot assertion to heroSave.attribute.values.hp
- add CoreState enemyContext.getBindedHero() regressions: same live attribute before/after load, no rebinding, across all compressions
2026-09-16 18:47:39 +08:00
a44c5d8918 test(06-17): stage 3 complete Low/High compression and reach 27 rows
- expand COMPRESSIONS to NoCompression / LowCompression / HighCompression so the matrix is 3 map counts x 3 compressions x 3 timing items = 27 rows
- keep measureCase, fixture build order, side load and 06-16 files untouched; still zero assertions
- one full run: 5 perf files / 45 tests passed, 0 WARNING/ERROR codes, saveablesReal.perf.ts (27 tests) in 379ms -- no case approaches the 30000ms testTimeout
2026-09-16 16:21:26 +08:00
4476e19805 test(06-17): stage 2 add fixed real side load and map scales 1/5/13
- seed 50 flags, 20 item kinds (3 equipment + 17 consumables), 4 equipped instances on slots 0..3, 20 modifiers (4 from equipped items + 16 manual), 1000 mixed replay steps and an unmodified enemy baseline
- keep addTile -> itemStore.addItem -> equipment.add ordering and a single one-shot compareWith after all maps exist
- 9 rows (1/5/13 x NoCompression x save|load|round trip), zero assertions, zero warn/error codes
2026-09-16 16:10:10 +08:00
63485e93ca test(06-17): stage 1 real 13x13 map fixture and map-only save/load perf rows
- move root floors.json into packages-user/data-state/test/fixtures/ (byte-identical) and delete the root copy
- add saveablesReal.perf.ts: toFlat/clearCodes/registerTiles/createRealMapFixture with a one-shot compareWith baseline
- seed the minimum 1 equipment instance so HeroEquipsStore.loadState does not raise error 58
- 3 rows: save / load / round trip for 1 map x NoCompression, zero assertions
2026-09-16 16:02:58 +08:00
374274a4bb test(06-16): add CoreState save/load perf suite across item scales and compressions
- saveables.perf.ts: 9 cases = 10/100/1000 items x No/Low/High compression
- each sample round-trips all 5 registered saveables through saveState/loadState
- synthetic item definitions via addTile -> itemStore.addItem -> equipment.add/addItem
- warmup 3 + 20 samples, median/min/p95 via console.table, no assertions
2026-09-16 15:06:58 +08:00
2f148c900c test(07-08): #06-07-1 bind the event layer in the teleport playback test
- createSmallMapScene returns map (additive; existing callers ignore it)
- target case binds state.pathfinding.finder.useMapLayer(map.eventLayer) after floor activation
- teleport target changed to (2,0) to avoid self-target empty-path early return; asserts x=2/y=0
- un-skip and rename to reflect test-side event layer binding; neutral leading comment
2026-09-16 13:02:46 +08:00
95ea6609c6 fix(07-07): #06-09-5 warn code 178 for unloaded save keys
- core.ts loadState: 差集方向改为 loaded.difference(total),178 = 存档出现但未加载的 key
- saveablesRoundTrip.test.ts:322-334 改写为「缺 key 不触发 178、仍触发 177」负向见证并更名
- saveablesRoundTrip.test.ts:337-349 取消 it.skip,承担「多出 key 触发 178」正向见证
2026-09-15 21:10:33 +08:00
992ca9d585 test(06-13): assert all CoreState key states and varied 10-step replay (G-06-09-A/B)
- seedState/mutateState/assertRestored now cover every key state: hero base attrs + modifier final atk + location, flags score/coins/stage, map two blocks + active status, enemy hp/atk, replay steps
- Replay seeded with 10 @system/replay steps mixing Up/Right/Down/Left/Teleport/UseItem/Equip/Unequip and varied param types, asserted per step
- New container test loops flags and replay through CoreState across the three compression tiers
- Append 06-13 create-or-append section to 06-COVERAGE-MAP.md; existing #06-09-1..5 skips unchanged
2026-09-15 11:27:57 +08:00
f01c23eba0 test(06-10): cover maximum-pipeline single-monster final damage (G-06-07-A)
- drive real MainDamageCalculator over a monster with 10 top-level specials,
  real aura 25, real support 26, common/special query and final effects
- assert one exact {damage,turn} with full per-branch derivation in comments
- add a control asserting the result differs without the support pipeline
- append the 06-10 coverage-map section (create-or-append, no new codes)
2026-09-15 10:10:44 +08:00
9f9dd11223 test(06-07): add small-map replay playback and second-recording comparison
- play a recorded small-map route with bounded waiting and recording disabled
- assert a second recording equals the first step-by-step (code and param type/value)
- trigger warn 176 and errors 2001-2008 through the real replay commands
- append 06-07 code coverage map rows and record finding #06-07-1
2026-09-14 21:06:39 +08:00
edd4de34dc test(06-07): add enemy combination stage 2 multi-special and aura pipelines
- combine multiple top-level specials through the real damage calculator
- cover real support recursion, aura base/query combination and stage order
- cover final-effect priority order and damage cache markDirty/deleteEnemy/with
2026-09-14 21:06:29 +08:00
bdeafd5cd2 test(06-07): add enemy damage combination stage 1 baselines
- add real-API single-special damage baselines via EnemyManager prefab
- add real EnemyContext single common aura and single guard aura baselines
- inline synthetic fixtures with no production changes
2026-09-14 20:42:00 +08:00
2ff422a682 test(06): restore suite green after replaySystem wiring change 2026-09-14 19:16:32 +08:00
502d87ba26 test(06-09): cover CoreState top-level saveables round trips
- add data-state/test/saveablesRoundTrip.test.ts: public CoreState.saveState/loadState over 5 saveables x 3 compressions, codes 112/113/177/178
- append 06-09 section to 06-COVERAGE-MAP.md (11 codes, create-or-append)
- register #06-09-1..5 suspected defects and the pre-existing test:ci blocker in 06-TEST-FINDINGS.md
2026-09-14 18:58:01 +08:00
cee843981f feat: 录像记录 & CoreState 存储接口 2026-09-14 18:09:45 +08:00
f0fd2f54a1 refactor(event): class-based built-ins, shared utils, single registration
- rewrite every built-in as EventXxx implements BuiltInFunction<P, E>
  (setBlock/moveBlock/deleteBlock/moveHero/moveHeroStep/touchFront/
  insertEvents/insertEvent), matching the EventSetBlock reference style
- move shared helpers to event/utils.ts (getPossibleMap, getPossibleLayer,
  getEventExecutor, enter/exitEventInsert); utils is not exported via index
- move per-class helpers into private methods (EventTouchFront and
  EventInsertEvents collectInvocations)
- use IObjectMover.push for move sequences instead of manual step calls
- registrations.ts: one createEventRegistrations() writing the eight entries
  in order, categories separated by single-line comments
- remove EventBuiltinName; classes own short string names
- update event tests; core.ts uses createEventRegistrations
2026-09-13 19:17:32 +08:00
46a38fa0c6 refactor: 录像系统指令 2026-09-13 16:38:19 +08:00
5a206748b2 test(03-11): align Node save regressions
- Assert CoreState instances use the existing SaveSystem
- Preserve independent construction and replay coverage
2026-09-11 14:10:41 +08:00
45e3b1f05d fix(03-10): restore direct replay fixture path
- Register the fixture event and maps through existing data APIs
- Await the synchronous mutation marker before the final snapshot
2026-09-11 14:00:02 +08:00
4b91a0b84f style(03-07): normalize serialized event files
- Apply repository CRLF and Prettier formatting to changed files
2026-09-10 20:17:23 +08:00
1b93deb8c8 test(03-07): prove serialized event replay path
- Load the fixed replay event through the internal serialized boundary
- Assert trigger, raw statements, coordinate binding, one execution, and final state
2026-09-10 20:13:51 +08:00
232df083f7 fix(03-05): complete data closure coverage and Node combat gate 2026-09-10 17:52:28 +08:00
704e23fa2d fix(03-04): share verifier harness with Node replay tests
- Keep Vitest imports inside the data-state test package
- Leave the dedicated script as the direct Node process entry
2026-09-10 17:17:40 +08:00
1218504b5c test(03-04): cover Node replay divergence and factory isolation
- Exercise success, false, throw, unknown, hero, and map mismatch paths
- Verify isolated Node CoreState instances and diagnostic parameter fidelity
- Repair replay route parameter encoding required by verifier diagnostics
2026-09-10 17:11:09 +08:00
c06093839a feat(03-04): add fixed Node replay verifier
- Extend the closed-loop fixture across hero and all map matrices
- Throw deterministic local diagnostics at the first replay divergence
- Add the dedicated test:data-node process gate
2026-09-10 17:05:15 +08:00
f911ac5989 style(03-06): normalize tile migration formatting
- Apply repository CRLF and Prettier formatting
- Record remaining out-of-scope type diagnostics
2026-09-10 15:57:59 +08:00
a12b2d2db8 feat(03-06): migrate legacy tiles to events maps
- Convert optional legacy events with safe empty defaults
- Cover TileStore consumption without trigger scalar output
2026-09-10 15:55:32 +08:00
4eec08638e feat(03-01): add awaited replay movement tracer
- exercise source-aware event mutation on a fixed map
- verify Node replay reaches its normal end state
2026-09-10 15:43:26 +08:00