The project hasn't been a WormKit DLL for a long time — it requires a
custom launcher. Rename the crate to openwa-dll with output openwa.dll
to match the rest of the naming convention (openwa-core, openwa-launcher).
Updates all references across Cargo.toml, Rust sources, PowerShell scripts,
CLAUDE.md, skill files, and docs. Replaces stale "wormkit hook/shim"
comments with accurate descriptions. Three remaining "WormKit" references
are legitimate (refer to the actual WA modding framework).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add headful replay testing to Rust test runner
Merge replay-test.ps1's headful mode into openwa-test as a new
`headful` subcommand. Runs with graphics+sound, checks for crashes,
panics, and [GAMEPLAY PASS/FAIL] markers. Supports filter by name
or direct .WAgame path, with configurable --timeout (default 150s).
replay-test.ps1 is now a thin wrapper like run-tests.ps1.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: split CLAUDE.md into focused per-crate files and skills
Update crate descriptions and Key Files to reflect game logic now
living in openwa-core (weapon_fire, weapon_release, sound_ops,
team_ops) with wormkit as thin hook shims. Update SoundId description
to document packed format (slot + flags).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
refactor: replace validation module with registry-driven startup checks
Delete the 2100-line validation/ module (stale checks, wrong vtable slot,
no-op hooks, sleep-based dumps) and replace with ~120-line startup_checks.rs
that auto-generates all checks from define_addresses! and #[vtable(...)]
metadata. Checks run unconditionally at DLL load — no OPENWA_VALIDATE env
var needed. Test runner scans OpenWA.log for [CHECK FAIL] and reports once.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: update CLAUDE.md with trace-desync, module split, env vars
Add trace-desync section, three new env vars, updated test isolation
to reflect file_isolation handling playback.thm, new key file entries
for frame_hook/replay_test/trace_desync modules, and trace-desync as
step 0 in desync debugging methodology.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The offline harness (LoadLibraryExA-based WA.exe loading) was an early
experiment superseded by DLL injection + replay testing. It hasn't been
used since initial development and adds maintenance overhead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: update CLAUDE.md with test isolation details and ERRORLOG env var
Document all concurrency isolation layers (file redirection, semaphore
renaming, batched hooks, crash detection) and add OPENWA_ERRORLOG_PATH
to the environment variables section.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: update CLAUDE.md for _raw methods, noalias rule, typed messages
Document new patterns from this session:
- Generic CTask<V: Vtable> and CGameTask<V> for typed vtable pointers
- Task trait with ddgame(), as_task_ptr(), broadcast_message()
- read_volatile requirement in broadcast_message (LLVM caching bug)
- Vtable method hooking via vtable_replace! and replacements/task/
- bind macro dotted field path support (base.vtable)
- Decompiler calling convention warning
- CTaskMissile constructor exception (thiscall, not stdcall)
- New key files: task/base.rs, team_arena.rs, ddgame_constructor.rs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: update CLAUDE.md and debug-cli skill for new debug tools
Document inspect/objects commands, symbolic address expressions,
ValueKind enum, FieldFormatter trait, #[field(kind)] attribute,
and field_format.rs in both CLAUDE.md and the debug-cli skill.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: update CLAUDE.md for #[vtable(...)] macro and vtable_replace!
Add documentation for the vtable attribute macro, bind_! companion
macros, name-based vtable_replace!, and updated design conventions.
Remove outdated vtable guidance that predates the macro system.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: update CLAUDE.md for address registry, openwa-derive, and key files
Add Address Registry & Pointer Identification section documenting
define_addresses!, #[derive(FieldRegistry)], and the query API.
Update crate architecture to include openwa-derive. Update key files
list with registry.rs, macros.rs, and mem.rs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: update replay testing docs for new test runner
- CLAUDE.md: rewrite Replay Testing section with test runner as primary,
add openwa-test-runner to crate architecture, document env vars and
instructions for adding new replay tests
- run-tests.ps1: use cargo run to ensure binary is up-to-date
- SKILL.md: rewrite with test runner quick start, updated paths and options
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Constructor correctness (match original WA behavior):
- Load debris.spr and back.spr unconditionally, not gfx_mode-gated
- Initialize PaletteContext for masks.img (word=1, word=0xFE, Init)
- Document PCLandscape param_5 as game_info+0xDAAC
Debug tooling improvements:
- Hardware watchpoints: EBP-based stack trace on every hit
- Watchpoint base selection: OPENWA_WATCH_WRAPPER, OPENWA_WATCH_DISPLAY
- Display watchpoint arming during constructor for field tracing
- Snapshot: walk parent chain to CTaskTurnGame (true entity root)
Add docs/re-notes/desync-investigation.md — writeup of the longbow
desync investigation methodology and findings.
NOTE: Longbow desync (4 checksum mismatches) is NOT yet resolved.
These changes are correctness fixes and tooling for continued work.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documents the debug server, CLI commands, frame breakpoints,
snapshot system, and key env vars (OPENWA_DEBUG_SERVER,
OPENWA_BREAK_FRAME, OPENWA_USE_ORIG_CTOR, OPENWA_WATCH_FRAME).
Also adds openwa-debug-cli and openwa-debug-proto to crate list.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add debug_watchpoint.rs — a self-contained x86 debug register
instrumentation module that sets DR0–DR3 write watchpoints on DDGame
offsets via an INT3→VEH trick (no external debugger needed). Logs the
exact Ghidra VA of every write to watched offsets.
Used the watchpoint debugger to investigate 5 DDGame constructor field
differences. Found:
- +0x041C/+0x0420: written by DDGame__InitPaletteGradientSprites
(0x5706D0) which our Rust constructor was missing. Fixed by adding
a stdcall bridge call after LoadHudAndWeaponSprites.
- +0x7820/+0x7824/+0x7828: stale observations — both constructors
now produce identical speech slot table values.
Also removes Shadow comparison code and the original DDGame constructor
bridge (ddgame_constructor_call) since the Rust constructor is fully
matched.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: integrate ERRORLOG.TXT into replay testing flow
Clear ERRORLOG.TXT before each test run, copy to testdata/logs/ when
present after a run, and report crash with first 5 lines before any
other summary output. Exit code 1 on crash detection.
Crash check runs before the log diff/validation summary to ensure it
is always visible even when the diff would also fail.
Update CLAUDE.md and replay-test skill docs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add vcall! macro and typed vtable structs for Palette and InputCtrl
The split between openwa-types (pure types/addresses) and openwa-lib
(rebase/wa_call/typed wrappers) was arbitrary and added friction when
deciding where new code belongs. Merged both into openwa-core.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hook TurnManager_ProcessFrame to set DDGame.fast_forward_active=1 each
frame, enabling 50x speed processing (same mechanism as spacebar).
Add fast_forward_active field to DDGame struct. Auto-restore minimized
window via FindWindowA+ShowWindow at 2s.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: replay fast-forward via PostMessage + WndProc subclass
Automatically fast-forward through entire replays during testing by
posting WM_KEYDOWN/WM_KEYUP spacebar messages with 50ms gaps. Subclasses
the game's WndProc to intercept WM_ACTIVATE/WM_ACTIVATEAPP, making WA
think it always has focus so input works even when the window is in the
background.
- Add input.rs with PostMessage loop + WndProc subclass
- Update validation auto-capture: dump at 8s, 120s safety timeout
- Update replay-test.ps1 with 150s timeout
- Add DDKeyboard::PollKeyboardState address
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: port remaining 5 team/weapon accessor hooks (32 total)
Add SubtractAmmo, CountAliveWorms, CheckTeamWormState0x64,
CheckAnyWormState0x8b, and SetActiveWorm_Maybe replacements.
Extend TeamWeaponState with active_worm_count, last_active_team,
and last_active_alliance fields. Rename SetTeamAliveFlag to
SetActiveWorm_Maybe based on runtime behavior analysis.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: unify validator into wormkit DLL, triggered via OPENWA_VALIDATE env var
Merge validation logic from openwa-validator into openwa-wormkit as a
conditional module. Set OPENWA_VALIDATE=1 to enable validation checks,
OPENWA_REPLAY_TEST=1 for auto-capture mode. Eliminates the need for a
separate wkOpenWAValidator.dll.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>