Skip to content

Initialize engine-side TriSurf allocators (#108) - #111

Merged
themuffinator merged 2 commits into
mainfrom
codex/issue-108-dmap-trisurf-lifecycle
Aug 15, 2026
Merged

Initialize engine-side TriSurf allocators (#108)#111
themuffinator merged 2 commits into
mainfrom
codex/issue-108-dmap-trisurf-lifecycle

Conversation

@themuffinator

@themuffinator themuffinator commented Aug 15, 2026

Copy link
Copy Markdown
Owner

What changed

  • Initialize the engine/tool copy of the render-geometry TriSurf allocators after renderer data setup and before startup scripts can invoke a tool command, then release it during common shutdown.
  • Make the TriSurf lifecycle idempotent so static-renderer builds safely share the renderer-initialized copy while module builds retain independent renderer and tool copies.
  • Keep static-renderer allocation hooks and counters paired by preventing engine/tool initialization before the renderer installs its hooks.
  • Add a focused lifecycle/order/source-partition contract and register it in local, commit, and push validation.
  • Add the user-facing release-completion entry.

Root cause

The v0.10 crash dump was symbolized against the exact shipped engine PDB. dmap game/airdefense1.map crashed in idDynamicBlockAlloc<idDrawVert>::AllocInternal() while deriving a light polytope. After renderers became runtime modules, openq4_render_geo is linked once into the client and independently into each renderer. Renderer startup initialized only the renderer module's file-static allocator copy; built-in dmap used the client copy, which remained uninitialized.

Validation

  • Full Windows rebuild after the lifecycle-order hardening: 1145/1145 targets; client, dedicated server, SP/MP GameLibs, OpenGL renderer, and Vulkan renderer linked
  • python tools/tests/dmap_render_geometry_lifecycle.py
  • python tools/tests/renderer_vulkan_md5r_compatibility.py
  • documentation, charset, validation-hardening, Python compile, and diff checks
  • Fresh windowed/no-input stock-assets runtime after the final change: dmap -noCM -noAAS game/airdefense1 completed in 3 seconds, reported the stock map leak normally, and shut down cleanly without an allocator or lifecycle error
  • No fullscreen launch, input injection, or OS capture was used

Fixes #108

The renderer module and built-in dmap compiler have separate copies of the render-geometry static library. Initialize the engine copy for tools, make the lifecycle idempotent across static-renderer builds, and release it during common shutdown.

Fixes #108
Initialize the engine/tool render-geometry copy after renderer data setup but before startup scripts can invoke dmap. Static-renderer builds now preserve matched allocation accounting while module builds retain an independent initialized tool copy.

Refs #108
@themuffinator
themuffinator force-pushed the codex/issue-108-dmap-trisurf-lifecycle branch from 6aca8ea to 9f6cce0 Compare August 15, 2026 10:45
@themuffinator

Copy link
Copy Markdown
Owner Author

Final hosted validation for 9f6cce0: 21 checks passed, 4 failed, 0 pending. Commit Validation and ARM64 Cross Build passed completely, including Windows/Linux builds, ASan/UBSan, all four macOS thin builds, and both universal2 assembly/package/dedicated-smoke jobs. The four red macOS Push Verification jobs exactly reproduce main baseline renderer-default-safety diagnostics and contain no TriSurf allocator or lifecycle failure.

@themuffinator
themuffinator marked this pull request as ready for review August 15, 2026 16:50
@themuffinator
themuffinator merged commit 59f3917 into main Aug 15, 2026
21 of 25 checks passed
@themuffinator
themuffinator deleted the codex/issue-108-dmap-trisurf-lifecycle branch August 16, 2026 11:56
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.

Windows x64: dmap game/airdefense1.map crashes in v0.10

1 participant