Add BenchmarkDotNet harness and benchmarks project#32
Merged
Conversation
…dex/implement-benchmarkdotnet-harness
Provide a focused baseline so converter regressions can be measured independently of game-loop work. Co-Authored-By: GPT-5 <noreply@openai.com>
The prior GlobalStrategy.Benchmarks project predated Docs/Specs/26_07_18_18_benchmarkdotnet-perf-harness/plan.md and satisfied almost none of its acceptance criteria: wrong project identity, a hand-built 2-country fixture instead of the real 163-country world, no snapshot/compare/update-baseline CLI, and no skills, Ralph integration, or Constitution carve-out. Renamed to Game.Benchmarks and rebuilt the fixture on Game.ConsoleRunner.Program.BuildContext so benchmarks run against the real committed Assets/Configs data. Replaced the stale benchmark set (which also predated the resource-collector pipeline migration - CountryScoreSystem/OrgScoreSystem no longer exist) with coverage of the full tick, the two unchanged per-tick systems, the ordered ResourceSystem pipeline, and each individual resource collector - kept the pre-existing ECS micro-benchmarks and rebuilt VisualStateConverterBenchmarks against the real fixture per request. Added the snapshot/gate/CLI layer (--compare/--update-baseline), seeded a real initial Docs/Benchmarks/ baseline from an actual run, and added the /benchmark-report and /optimize-performance skills, the Ralph driver's perf mode, the /complete-prd perf: form, and the Constitution's performance-optimization carve-out. Fixed two correctness bugs surfaced while building this: BenchmarkDotNet's out-of-process toolchain runs from a build-output subfolder (config paths need a repo-root env var handoff, not process isolation given up), and TimeSystemBenchmarks was mutating shared GameTime across millions of unrolled invocations, eventually overflowing DateTime. Also promoted dotnet-build/dotnet-test from user-level to project-level skills and added a matching dotnet-benchmark skill, since they're used as project conventions, not personal ones. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Re-collected all 22 benchmarks after the harness rebuild landed, so the committed baseline reflects the harness in its final committed state rather than the numbers gathered mid-implementation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
GlobalStrategy.Benchmarksproject withProgramentry andGlobalStrategy.Benchmarks.csprojreferencingBenchmarkDotNetand core projects.BenchmarkGameFactorywhich constructs an in-memoryGameLogicusing static config sources for lightweight game-loop benchmarking.EcsWorldBenchmarks,GameSystemsBenchmarks, andGameLoopBenchmarksto measure entity creation, component addition, queries and mutation, monthly system updates, and repeatedGameLogic.Updateticks.README.mddocumenting how to run the benchmarks and updateGlobalStrategy.Core.slnto include the new project.Testing
Codex Task