Meet or beat the C# v2-scale simulation baseline #51

Closed
opened 2026-08-06 03:56:48 +00:00 by coilyco-ops · 1 comment
Member

Problem

At the current 100x100 implementation point, the Rust simulation is reported to run slower than the historical C# implementation. Longer radar, deployment, and sustained-power proofs would amplify that regression and make their validation loop impractical.

This issue is the performance gate for the v2-scale expansion tracked by #49.

Scope

  • Recover and run an apples-to-apples C# reference at the matching v2 development point.
  • Add a reproducible Rust benchmark for the same seed, population, tick horizon, build mode, and output work.
  • Separate simulation cost from compilation, viewer rendering, and snapshot serialization.
  • Measure the major tick phases, including dispatch, pathfinding and movement, power balancing, production, mutation, and snapshot projection.
  • Optimize the measured bottlenecks without weakening deterministic ordering or gameplay behavior.
  • Add a stable regression budget derived from the measured C# baseline.

Acceptance

  • A Ward command runs the paired benchmark and records enough configuration to reproduce it.
  • The before and after report includes raw timings, ticks per second, scenario seed, population, tick count, build profile, and host context.
  • Rust median tick throughput meets or exceeds the C# reference under the same measured workload.
  • The deterministic v2-world state and existing gameplay assertions remain unchanged.
  • The regression check avoids flaky single-sample wall-clock assertions.
  • The full Ward gate and release Wasm build pass.

Blocks

  • #52 radar-equivalent targeting.
  • #53 remote coal-plant deployment.
  • #54 deployed-generator and power-network integration.
  • #55 sustained post-battery operation.
## Problem At the current 100x100 implementation point, the Rust simulation is reported to run slower than the historical C# implementation. Longer radar, deployment, and sustained-power proofs would amplify that regression and make their validation loop impractical. This issue is the performance gate for the v2-scale expansion tracked by #49. ## Scope * Recover and run an apples-to-apples C# reference at the matching v2 development point. * Add a reproducible Rust benchmark for the same seed, population, tick horizon, build mode, and output work. * Separate simulation cost from compilation, viewer rendering, and snapshot serialization. * Measure the major tick phases, including dispatch, pathfinding and movement, power balancing, production, mutation, and snapshot projection. * Optimize the measured bottlenecks without weakening deterministic ordering or gameplay behavior. * Add a stable regression budget derived from the measured C# baseline. ## Acceptance * A Ward command runs the paired benchmark and records enough configuration to reproduce it. * The before and after report includes raw timings, ticks per second, scenario seed, population, tick count, build profile, and host context. * Rust median tick throughput meets or exceeds the C# reference under the same measured workload. * The deterministic v2-world state and existing gameplay assertions remain unchanged. * The regression check avoids flaky single-sample wall-clock assertions. * The full Ward gate and release Wasm build pass. ## Blocks * #52 radar-equivalent targeting. * #53 remote coal-plant deployment. * #54 deployed-generator and power-network integration. * #55 sustained post-battery operation.
Owner

This spec is overkill. We don't need to do apples to apples. I will just look at it.

This spec is overkill. We don't need to do apples to apples. I will just look at it.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/factory-game-v3#51
No description provided.