Skip to content

feat(3d-tiles): support draft implicit spatial semantics - #3997

Open
ibgreen wants to merge 20 commits into
masterfrom
codex/3d-tiles-2-implicit-spatial
Open

ibgreen wants to merge 20 commits into
masterfrom
codex/3d-tiles-2-implicit-spatial

Conversation

@ibgreen

@ibgreen ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Goals

  • Add experimental implicit-tiling support for the inspected glTF-based 3D Tiles 2.0 draft.
  • Normalize draft spatial bounds, CRS declarations, and georeferencing into the existing tiles runtime.
  • Preserve 3D Tiles 1.x implicit tiling and geometric-error behavior.

Changes

  • Parses 3DTILES_subtree JSON glTF and GLB resources, including availability accessors, structural-metadata rows, and package-backed files.
  • Adapts draft 3DTILES_implicit_tiling nodes to the existing lazy subtree traversal and cache, with QUADTREE/OCTREE availability and embedded-resource resolution.
  • Applies tile/content attribute overrides and property-backed URI templates using content, tile, then coordinate precedence.
  • Normalizes ellipsoid-region, S2, and cylinder-region shapes, using conservative oriented boxes where the runtime has no exact volume.
  • Reads EXT_geospatial_crs WKID/WKT2 declarations and composes EXT_georeference transforms.
  • Keeps transform-scaled geometric errors for 1.x while leaving draft 2.0 errors unscaled.
  • Retains legacy binary subtree loading and adds focused coverage for malformed resources, worker transfer, subtree caching, bounds, metadata, URI substitution, CRS transitions, and LOD semantics.

The draft-facing behavior is experimental and is pinned to CesiumGS/glTF commit 1737151386460f190ffd90239b38eb0e3f1949f5. This PR exposes parsing, normalization, traversal, and spatial semantics; it does not add renderer-level vector support.

Validation

  • yarn
  • yarn lint fix
  • yarn build
  • yarn test-node — 445 passed, 6 skipped
  • yarn build-workers
  • yarn test-headless — 4,917 passed, 39 skipped
  • yarn test-audit — 770 files, 0 Tape, 0 violations

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 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-09-15T03:23:50.332849Z bd492c7 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.

@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: 64184c19dd

ℹ️ 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 modules/tiles/src/tileset-3d/format-3d-tiles/implicit-tiling.ts
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
Comment thread modules/tiles/src/tileset-3d/format-3d-tiles/implicit-tiling.ts
Comment thread modules/gltf/src/lib/gltf-utils/get-typed-array.ts
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: b4de0b0ebc

ℹ️ 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 modules/3d-tiles/src/tiles-3d-loader-with-parser.ts Outdated
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
Comment thread modules/tiles/src/spatial/format-spatial-reference.ts Outdated
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 299e51f7c5

ℹ️ 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 modules/3d-tiles/src/tiles-3d-loader-with-parser.ts Outdated
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts Outdated
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts Outdated
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 5b6d6363ca

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
Comment thread modules/tiles/src/tileset-3d/format-3d-tiles/implicit-tiling.ts Outdated
Comment thread modules/tiles/src/tileset-3d/format-3d-tiles/implicit-tiling.ts Outdated
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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

const parsedGltf = await parseGltfForClassification(
data,
preprocessedContent as GltfPreprocessedContent,
options,
context
);

P2 Badge Force buffers when directly parsing draft subtrees

When callers parse a 3DTILES_subtree directly with Tiles3DLoader and set 3d-tiles.loadGLTF: false, this call leaves loadStructureBuffers at its default, causing parseGltfForClassification to disable buffer loading before the later subtree branch reads availability, attributes, and property tables. The new forced-buffer argument on the isSubtree path is fresh evidence that the source-managed case was fixed, but the public auto-classification path still rejects valid bitstream-backed subtrees.

ℹ️ 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 modules/3d-tiles/src/tiles-3d-loader-with-parser.ts
Comment thread modules/tiles/src/spatial/format-spatial-reference.ts Outdated
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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

const parsedGltf = await parseGltfForClassification(
data,
preprocessedContent as GltfPreprocessedContent,
options,
context

P2 Badge Force hierarchy buffers for auto-classified subtrees

When a caller parses a glTF subtree without the internal isSubtree hint and sets 3d-tiles.loadGLTF: false, this classification call still omits loadStructureBuffers, so parseGltfForClassification disables buffer loading before the later is3DTiles2Subtree branch. Any auto-classified subtree using bitstreams, attributes, or property tables consequently fails with missing buffer data. The newly added forced-buffer argument in the hinted branch is fresh evidence that the earlier fix does not cover this public auto-classification path.

ℹ️ 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 modules/tiles/src/tileset-3d/format-3d-tiles/implicit-tiling.ts Outdated
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts Outdated
Comment thread modules/3d-tiles/src/tiles-3d-loader-with-parser.ts
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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

const parsedGltf = await parseGltfForClassification(
data,
preprocessedContent as GltfPreprocessedContent,
options,
context

P2 Badge Force hierarchy buffers in the auto-detected subtree path

When callers parse a draft subtree directly with 3d-tiles.loadGLTF: false and do not set the internal isSubtree hint, this auto-classification call leaves loadStructureBuffers false. parseGltfForClassification consequently disables buffer loading, but the later is3DTiles2Subtree branch still tries to read availability, attribute, and property-table buffer views and fails. The added structure-buffer override is fresh evidence that the earlier fix remains incomplete because only the explicit isSubtree branch passes true.

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts Outdated
Comment thread modules/gltf/src/lib/extensions/utils/3d-tiles-utils.ts Outdated
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 713199d9a9

ℹ️ 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 modules/3d-tiles/src/tiles-3d-loader-with-parser.ts
Comment thread modules/3d-tiles/src/tiles-3d-loader-with-parser.ts
Comment thread modules/3d-tiles/src/tiles-3d-loader-with-parser.ts Outdated
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
@ibgreen

ibgreen commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 9b45962a99

ℹ️ 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 modules/3d-tiles/src/tiles-3d-loader-with-parser.ts Outdated
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: d138b97fbb

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts Outdated
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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

if (file.bufferUri && this.coreApi) {
const response = await this.coreApi.fetchFile(this.getTileUrl(file.bufferUri));

P1 Badge Route package buffer reads through the source resolver

When a draft package is loaded through a 3TZ or another custom resolver and a files[].bufferView resides in a URI-backed glTF buffer, the retained file has bufferUri but no data. This direct coreApi.fetchFile call bypasses resolver.loadResource and its archive-backed fetch implementation, so an archive-relative buffer URL is treated as an external network URL and embedded content or subtrees cannot load.

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
Comment thread modules/3d-tiles/src/tiles-3d-loader-with-parser.ts Outdated
@ibgreen
ibgreen force-pushed the codex/3d-tiles-2-implicit-spatial branch 2 times, most recently from bf548f7 to a8aa573 Compare September 15, 2026 01:28
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: a8aa5736a6

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tile-header.ts
Comment thread modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
@ibgreen
ibgreen force-pushed the codex/3d-tiles-2-implicit-spatial branch from a8aa573 to 1700c49 Compare September 15, 2026 01:44
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 1700c49965

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

@ibgreen
ibgreen force-pushed the codex/3d-tiles-2-implicit-spatial branch from 1700c49 to 4db4ba8 Compare September 15, 2026 01:59
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 4db4ba8f72

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
Comment thread modules/tiles/src/spatial/format-spatial-reference.ts
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 2f436b8ff9

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 5c10ca66fc

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts Outdated
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: a6a49937dc

ℹ️ 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 modules/3d-tiles/src/lib/parsers/parse-3d-tiles-2-gltf.ts
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: ce6467dc10

ℹ️ 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 modules/tiles/src/tileset-3d/format-3d-tiles/implicit-tiling.ts Outdated
@ibgreen

ibgreen commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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

expect(child.boundingVolume.region).toEqual([3, -0.5, 0, 0, 0, 20]);

P1 Badge Split wrapped regions at the antimeridian

When a region crosses the antimeridian (west > east), this expectation codifies an incorrect midpoint of zero because calculateImplicitBoundingVolume subtracts the wrapped endpoints directly. For [3, -0.5, -3, ...], the longitude span is the short interval through ±π, so its children should split near π/−π rather than produce [3, ..., 0, ...]; the current volumes cover a large unrelated portion of the globe and can incorrectly cull or request draft implicit tiles near the dateline.

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

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