Skip to content

#422 Runtime-gated correctness checks - strict mode for the Release NuGet - #447

Merged
nockawa merged 11 commits into
mainfrom
feature/422-strict-mode-checks
Jul 3, 2026
Merged

nockawa merged 11 commits into
mainfrom
feature/422-strict-mode-checks

Conversation

@nockawa

@nockawa nockawa commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #422.

Converts the user-valuable DEBUG-only checks stripped from the Release NuGet into runtime-gated "strict mode" checks, plus always-on Tier-0 corruption guards. Off by default, JIT-folded to ~zero when off.

What's here

  • Tier 0 (always-on, free): 3× ManagedPagedMMF duplicate-root + 2× AccessControl wrong-thread release/demote → ThrowHelper.ThrowCorruption; 7× SpatialRTree.Query DFS-overflow → new latch-safe SpatialRTreeDiagnostics (counter + one-shot [LoggerMessage]).
  • CheckConfig — the strict-mode gate (Enabled + DeclaredAccessActive, static readonly JIT-fold), reusing TelemetryConfig's config source, wired in the ProfilerBootstrap module-init. Require/Record primitives with a lazy interpolated-string message handler.
  • ~47 conversions across EntityRef, ClusterRef, ComponentValue, EntityId, EcsQuery, PointInTimeAccessor, Transaction(.ECS), SystemAccessValidator (behind DeclaredAccessActive), PagedMMF/BootstrapDictionary/PagedHashMapBase; affinity field promoted out of #if DEBUG.
  • Tests + BDN off-path benchmark + docs (doc/feature-set/Observability/strict-mode-checks.md).

Acceptance criteria

All 8 met — see the implementation summary comment on the issue for AC-by-AC evidence.

Deviation: PackedDateTime's 3 checks deferred (it's in Typhon.Schema.Definition, a leaf assembly Engine depends on → can't reference CheckConfig without a cycle). Net ~47, not 50.

Verification

  • Engine + tests build clean; 24 Runtime-gated correctness checks ("strict mode") for the Release NuGet #422 tests pass (strict mode active suite-wide via the test typhon.telemetry.json).
  • Full suite green apart from pre-existing parallel-flaky tests (ExceptionPathLeakTests ×3, one TransactionTests read) that all pass in isolation.
  • Off-path cost measured at ~0.24 ns/call, zero allocation (real-JIT micro-benchmark).
  • 3-agent code review — no critical/high bugs; all actionable findings addressed.

⚠️ Reviewer note — this commit bundles unrelated changes

The single commit cb6caaf "Solved #422" also carries changes that are not part of #422 and rode in from the working tree:

  • src/Typhon.Engine/Observability/public/TraceIdEnricher.cs (deleted) + src/Typhon.Engine/Typhon.Engine.csproj — belong to the Distribution/Packaging work (Package the Typhon engine as a NuGet (bundle + metadata + symbols) #427–434).
  • Several doc/in-depth-overview/* edits (01-foundation, 06-ecs, 08-transactions, 10-runtime, README) — not authored as part of this feature.

Consider splitting these out before merge if you want a clean #422-only history. Also note the matching claude/ docs (design-doc promotion + overview/09-observability.md) are not yet committed in the nested docs repo.

🤖 Generated with Claude Code

@nockawa nockawa changed the title #422 Runtime-gated correctness checks ("strict mode") for the Release NuGet #422 Runtime-gated correctness checks - strict mode for the Release NuGet Jul 2, 2026
@nockawa

nockawa commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

/benchmark

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🏎️ Benchmark (regression) triggered on feature/422-strict-mode-checks → watch it

@nockawa

nockawa commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

/benchmark

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🏎️ Benchmark (regression) triggered on feature/422-strict-mode-checks → watch it

@nockawa

nockawa commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/benchmark

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🏎️ Benchmark (regression) triggered on feature/422-strict-mode-checks → watch it

@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

📊 Benchmark (regression) finished — full report · commit af43f7a

@nockawa

nockawa commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/benchmark

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🏎️ Benchmark (regression) triggered on feature/422-strict-mode-checks → watch it

@nockawa
nockawa merged commit 719548e into main Jul 3, 2026
4 checks passed
@nockawa
nockawa deleted the feature/422-strict-mode-checks branch July 3, 2026 09:28
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.

Runtime-gated correctness checks ("strict mode") for the Release NuGet

1 participant