Agent skill

testing

Testing Nethercore games for determinism and correctness. Covers sync testing, replay recording and playback, debug actions, and desync diagnosis. Use when running sync tests, setting up replay-based regression tests, or diagnosing determinism failures.

Stars 1
Forks 1

Install this agent skill to your Project

npx add-skill https://github.com/nethercore-systems/nethercore-ai-plugins/tree/main/nethercore/skills/testing

Metadata

Additional technical details for this skill

author
nethercore-systems
version
1.0.0

SKILL.md

Nethercore Testing

Sync Testing

Runs two identical instances, compares checksums each frame.

bash
nether run --sync-test
nether run --sync-test --frames 3000  # Specific duration

Pass criteria: Identical checksums for 1000+ frames.

Replay Testing

Record and replay for regression testing:

bash
nether run --record replay.bin  # Record
nether run --replay replay.bin  # Playback

Workflow:

  1. Record on known-good build
  2. Replay on new build
  3. Compare outcomes

Determinism Rules

Do Don't
random() FFI rand::thread_rng()
BTreeMap, BTreeSet HashMap, HashSet
Frame counter Instant::now()
Fixed-point math Floating-point accumulation

Test Organization

Type Tool Purpose
Unit cargo test Pure logic
Sync nether run --sync-test Runtime determinism
Replay --record/--replay Cross-build validation

Common Desync Causes

  1. Non-deterministic RNG - Using rand crate instead of FFI
  2. HashMap iteration - Order varies between runs
  3. System time - Reading wall clock
  4. Uninitialized memory - Undefined values
  5. State in render() - Skipped during rollback

Debugging Desyncs

  1. Run sync test to confirm failure
  2. Add log() calls around suspicious code
  3. Check for forbidden patterns
  4. Verify all state is in static variables

Debug Actions (Efficient Testing)

Instead of recording long input sequences, use debug actions to skip directly to test scenarios:

toml
# Skip to level 3 boss
[[frames]]
f = 0
action = "Load Level"
action_params = { level = 3 }

[[frames]]
f = 1
snap = true
assert = "$boss_health > 0"

Games register actions in init():

rust
debug_action_begin(b"Load Level".as_ptr(), 10, b"debug_load_level".as_ptr(), 16);
debug_action_param_i32(b"level".as_ptr(), 5, 1);
debug_action_end();

When to use:

  • Testing specific levels without playing through earlier ones
  • Setting up edge-case scenarios (low health, specific enemy spawns)
  • Regression tests that need consistent starting state

Expand your agent's capabilities with these related and highly-rated skills.

nethercore-systems/nethercore-ai-plugins

ffi-reference

ZX fantasy console FFI bindings reference. Documents 250+ functions for rendering, input, audio, camera, transforms, textures, materials, and debug. Includes init-only vs render-only call rules and the coordinate system. Use when writing or debugging ZX FFI calls in game code.

1 1
Explore
nethercore-systems/nethercore-ai-plugins

console-specs

ZX fantasy console hardware specifications and resource budgets. Covers resolution (960x540), memory limits (4 MB RAM/VRAM, 16 MB ROM), render modes, audio system (22 kHz, 16 channels), and input layout. Use when planning resource budgets or checking console capabilities.

1 1
Explore
nethercore-systems/nethercore-ai-plugins

rendering

ZX rendering techniques and patterns. Covers camera systems (follow, orbit), stencil buffer effects (portals, masks), billboard particles, custom fonts, and render pass management. Use when implementing cameras, visual effects, particle systems, or choosing between 2D and 3D rendering approaches.

1 1
Explore
nethercore-systems/nethercore-ai-plugins

debugging

Runtime debugging tools for Nethercore games on all consoles. Covers the F4 Debug Inspector, live value editing, watch variables, frame stepping, and time-scale controls. Use when tuning game parameters at runtime, tracking state over time, or stepping through frames to find bugs.

1 1
Explore
nethercore-systems/nethercore-ai-plugins

optimization

Optimization techniques for Nethercore WASM games. Covers WASM binary size reduction (LTO, wasm-opt), texture and mesh compression, audio optimization, and state size minimization. Use when a ROM exceeds size limits or when reducing build output size.

1 1
Explore
nethercore-systems/nethercore-ai-plugins

publishing

Publishing Nethercore games to nethercore.systems. Covers ROM packaging with nether pack, release builds, platform upload requirements, versioning, and CI/CD pipeline setup with GitHub Actions. Use when preparing a game for release or setting up automated builds.

1 1
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results