Skip to content

Implement Godot and Unity spatial adapters with real geometry and profiling evidence - #159

Merged
link1345 merged 5 commits into
mainfrom
codex/spatial-133
Oct 2, 2026
Merged

link1345 merged 5 commits into
mainfrom
codex/spatial-133

Conversation

@link1345

@link1345 link1345 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Implements the spatial-r1 engine adapters over the bounded spatial-host-r1 scheduler. Godot reads only the registered World3D at a physics callback; Unity reads only the registered PhysicsScene at an approved synchronized main-thread boundary. Both support sphere/capsule/oriented-box overlap and fixed-orientation translation, including diagonal motion and arbitrary orientations, with initial-overlap detection, explicit filters, honest missing normals/IDs, coverage and truncation. A trusted additive C ABI checks the conservative prepared engine volume before physics and retains it for revocation and publication; strict legacy documents remain unchanged.

Validation on Windows x64: pinned Godot 4.7.stable.official.5b4e0cb0f with GodotPhysics3D and Jolt Physics, and Unity 6000.5.3f1 PhysX Play Mode each passed 33 shared analytic scenarios, the second door state and 16-query batches (67 result records), plus 360 actual physics-callback profile samples and 34 deterministic post-Take selective-revocation/deadline records. The race fixtures preserve the first item's terminal reason and complete the next eligible real-engine query within the same held boundary. Scenarios include gap ray/capsule, box orientation/handedness, capsule height/coincident endpoints, diagonal casts, initial overlap, floor/internal ray/zero delta, anonymous/self/trigger filtering, saturation, scene isolation, coverage unknown, Player/whole-volume rejection and stale origin epochs. Actual-engine regressions reject rounded-volume grant expansion and capsule-axis underflow before physics. Godot document serialization uses full precision, and registration rejects a precision representation that differs from the running binary32 build.

Four native spatial suites and 102 managed spatial tests pass. Independent read-only cumulative audit found the capsule underflow case; it was reproduced in Godot, fixed in both readers and verified in fresh engine runs. No remaining actionable finding. docs/spatial-engine-r1.md records measured CPU time/cycles, queue and callback impact, cooperative deadline limits, reproduction and unsupported/unverified combinations. No transport exposure or parent #130 completion claim; unknown mesh/one-way/OS/version combinations remain explicitly unverified.

The same native, managed and three real-engine combinations were rerun after integrating main b83ad39 (PR158 Trace changes), without conflicts or spatial source changes. All 29 Trace integration tests also pass after building their documented offline viewer prerequisite.

Fixes #133

@link1345 link1345 changed the title [Spatial-03] Prototype Godot/Unity readers with real geometry fixtures Implement Godot and Unity spatial adapters with real geometry and profiling evidence Oct 1, 2026
@link1345
link1345 marked this pull request as ready for review October 1, 2026 09:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 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-01T23:56:22.494790Z a5f6393 Manual request
ℹ️ 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.

link1345 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

The latest head adds a narrowly scoped follow-up to the capsule underflow guard. Real Godot 4.7 probing showed that an axis of 1e-22 has a nonzero subnormal squared length but normalizes to a direction about 1% away from unit length. Both readers now refuse subnormal squared axis lengths before physics; Godot additionally validates the normalized axis. Both real-engine fixtures assert unsupported_shape with no geometry for 1e-25 and 1e-22 axes. Fresh GodotPhysics3D, Jolt and Unity PhysX runs each passed 67 geometry records and 360 actual callback profile samples. Please review the current head.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ff2c758c7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread examples/godot-gdscript/addons/gua/gua_spatial.gd Outdated
Comment thread bindings/unity/Runtime/GuaUnitySpatial.cs Outdated

link1345 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Acceptance checkpoint at c984df2: all general sphere/capsule/oriented-box geometry, diagonal translation, coincident endpoints and handedness scenarios pass in the pinned real Godot 4.7 GodotPhysics3D and Jolt backends and Unity 6000.5.3f1 PhysX. Each combination has 67 result records, 360 actual physics-callback CPU/time/cycle/queue/game-impact profile samples and 34 deterministic post-Take selective-revocation/deadline records. Native spatial suites4/4 and managed spatial tests102/102 pass; no geometry tolerance was relaxed. Unsupported/unverified numeric, mesh/one-way, OS/version and precision combinations remain documented. Both review findings are fixed and independently verified; final-head CI and this final review are the remaining merge gates. #133 is still open.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: c984df2747

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

link1345 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Final integration head a5f6393 merges current main b83ad39 (PR158 Trace integration) without conflicts or spatial source changes. The prior c984df2 acceptance evidence and final review were complete, with all17 CI checks green. Fresh CI now runs against the updated base; native spatial suites4/4 already pass, and real Godot/Unity plus affected managed integration tests are being rerun. Please review the cumulative spatial diff against current main.

link1345 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Integration validation complete at a5f6393 against current main b83ad39 (PR158): four native spatial suites and102 managed spatial tests pass. Fresh Godot4.7 GodotPhysics3D/Jolt and Unity6000.5.3f1 PhysX runs each pass67 geometry records,34 selective-revocation/deadline records and360 real physics-callback profile samples. All29 unchanged TraceIntegrationTests also pass after building the documented offline viewer prerequisite; the initial viewer-not-bundled setup failure is retained in evidence. No tolerance/assertion relaxation or spatial source change. Final-head CI/review are pending. The isolated branch is clean and the original checkout is preserved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: a5f6393957

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

link1345 commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Current checkpoint (2026-10-02 00:23 UTC): execution and latest-main integration resumed successfully. Head a5f6393 includes main b83ad39 (PR158). Native spatial suites: 4/4; managed spatial tests: 102/102; unchanged Trace integration tests: 29/29 after the documented viewer build. Fresh GodotPhysics3D, Jolt and Unity PhysX runs each passed 67 fixture result records, 34 lease-race records and 360 callback profile samples. New-head review completed with no new findings. CI run36942981473 is16/17 green; macOS Intel Godot Debug/Release compilation remains. No approval-service failure has recurred. The cumulative spatial diff is unchanged against the updated base; the isolated worktree and original checkout are clean. Merge and issue checklist/label cleanup follow the last CI check.

link1345 commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Completed: merged as 8216848. Issue #133 is closed with all eight acceptance items checked, and codex-ready removed while retaining type:feature. Final integration head a5f6393 includes main b83ad39 (PR158); all 17 CI checks passed and the refreshed review found no new issues. Fresh native spatial suites 4/4, managed spatial tests 102/102 and unchanged Trace integration tests 29/29 pass. Real GodotPhysics3D/Jolt and Unity PhysX each passed 67 fixture result records, 34 lease-race records and 360 callback profile samples. The final evidence archive includes raw records/logs, historical measurement evidence, final merge/CI/review metadata and verified SHA-256 manifests. Unsupported/unverified combinations remain documented; no parent #130 or transport completion claim.

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.

[Spatial-03] Godot・Unityの空間照会adapterと共通幾何fixtureを実装する

1 participant