Skip to content

feat(pgn): add mainline import and export with diagnostics - #16

Merged
denyrt merged 1 commit into
mainfrom
feature/pgn
Oct 21, 2026
Merged

denyrt merged 1 commit into
mainfrom
feature/pgn

Conversation

@denyrt

@denyrt denyrt commented Oct 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Add an immutable PgnGame model with tags, initial FEN, coordinate moves and a declared result.
  • Support mainline PGN import/export using canonical SAN, with result validation and structured diagnostics.
  • Explicitly reject comments, NAGs, variations and unsupported variants.
  • Add integration tests, package-consumer coverage, performance benchmarks and API documentation.

Validation

dotnet restore ChessRealms.Engine.slnx --locked-mode
dotnet build ChessRealms.Engine.slnx -c Release --no-restore
dotnet test ChessRealms.Engine.slnx -c Release --no-build --filter "TestCategory!=Deep"
pwsh -NoProfile -File scripts/Verify-SolutionStructure.ps1
git diff --check

All checks passed: 1,528 tests, no build warnings or errors.

Additional validation:

  • Built .nupkg and .snupkg artifacts and validated them with Verify-Package.ps1.
  • Passed Test-PackageConsumer.ps1 against the local package.
  • Completed 60 benchmark scenarios across core operations, game API, SAN and PGN, plus the allocation probe.
  • Checked local documentation links and new-file whitespace.

Deep tests were not run. Benchmarks used short in-process runs and do not establish production latency guarantees. The package-consumer check required execution outside the sandbox after a NuGet access-denied failure.

Compatibility and risks

  • PGN import supports one game's tags and mainline with canonical SAN; annotated PGN files are explicitly rejected.
  • The declared PGN result is separate from ChessGame.Outcome. Restoration does not infer resignation, timeout or draw-claim details.
  • PGN processing allocates model and replay data. Import followed by ToGame() performs two replays; further optimization remains possible.
  • The package version remains 1.1.0; the planned 1.2.0 bump is a separate step.

Checklist

  • The change is focused on one logical purpose.
  • Tests were added or updated when behavior changed.
  • Documentation was updated when required.
  • Relevant local validation passed, or limitations are explained above.
  • No credentials, personal data, or unintended generated files are included.

@denyrt
denyrt merged commit c707047 into main Oct 21, 2026
5 checks passed
@denyrt
denyrt deleted the feature/pgn branch October 21, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant