Skip to content

Fix dmap vertex-allocation crash on heavily split maps - #182

Merged
themuffinator merged 2 commits into
mainfrom
codex/fix-dmap-hub2-181
Oct 15, 2026
Merged

themuffinator merged 2 commits into
mainfrom
codex/fix-dmap-hub2-181

Conversation

@themuffinator

@themuffinator themuffinator commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Compiling the attached hub2.map from #181 requests 2,344,661,760 bytes for unshared vertices in ShareMapTriVerts. The legacy allocator rejects that request and the writer dereferences the null buffer.

Allocate vertices after sharing, using a spatial hash that preserves the original epsilon matching and first-match/index order. The reported surface needs only 21,559 shared vertices (1,379,776 bytes). Check rejected geometry allocations and count overflow, and retain triangle-list tails during T-junction repair and surface assembly to avoid repeated scans. Add a production-code regression fixture to both validation workflows. Allow 150 minutes for the full Windows x64 PR validation job, matching Push Verification, so its existing regression suite, build and dedicated-server checks can finish.

Validation:

  • Windows optimized build and staging pass.
  • Native fixture passes with Windows MSVC/Clang and Linux Clang/GCC ASan/UBSan. The original implementation reproduces the null write with the same allocation-limit fixture.
  • Existing dmap geometry-lifetime, AAS compiler-contract and Linux ARM64 portability checks pass.
  • The supplied map completes geometry (503 seconds), collision and all five AAS outputs, then exits normally.
  • Staged OpenGL single-player gameplay on stock game/airdefense1 passes, including an engine screenshot.

Independent validation of PR head a7e7a0a08ea285d1c574457b458b81eff57c93dd:

  • The production-code vertex-sharing fixture passes with Windows Clang and MSVC, and with Linux Clang and GCC under ASan/UBSan (Ubuntu on WSL).
  • The dmap geometry-lifetime, AAS compiler-contract and Linux ARM64 source-portability checks pass; the diff has no whitespace errors.
  • Local Windows LLVM 20.1.7 sanitizer execution fails while handling a C++ exception. The same failure reproduces in a standalone throw/catch program without engine code; that Windows sanitizer result is not used as qualification. No additional engine build or gameplay run was performed during this independent check.

Remaining limitation: the rebuilt hub2 still cannot enter gameplay. Its 36,635,340-index surface exceeds the renderer's existing 16,777,216-index limit (R_ParseModel: bad surface counts); loading also reports MAX_SIL_EDGES. Keep #181 open for that follow-up. This PR qualifies the compiler crash fix and records the remaining limit in the developer documentation and candidate release notes.

The original runtime validation used the staged working-tree build, which includes pre-existing UI work. The PR contains nine files covering this compiler fix and its validation.

Allocate only shared vertices, preserve original epsilon matching and order, and avoid repeated triangle-list scans. Add native regression coverage and record the remaining hub2 runtime surface limit.

Refs #181
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T09:41:55.983145Z 8a320db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The Windows x64 job reached its 60-minute limit during existing UI regression tests, before build and dedicated-server validation. Match the 150-minute Push Verification allowance while retaining every validation step.
@themuffinator
themuffinator merged commit a7e7a0a into main Oct 15, 2026
6 of 26 checks passed
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