Skip to content

Optimize spatial query result reuse - #476

Open
Frotty wants to merge 2 commits into
masterfrom
codex/optimize-spatial-queries
Open

Optimize spatial query result reuse#476
Frotty wants to merge 2 commits into
masterfrom
codex/optimize-spatial-queries

Conversation

@Frotty

@Frotty Frotty commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

  • replace allocating spatial-query return APIs with caller-provided ArrayList and SparseSet outputs
  • add allocation-free scratch resets and caller-owned single-pass filters
  • reduce SparseSet storage overhead and support initial capacity hints
  • update spatial reentrancy coverage to reuse scratch collections
  • clear retained ArrayList references when reset lists relocate during growth

Review scope

  • These spatial-query APIs are new and unreleased. Replacing the earlier allocating signatures is intentional, and breaking API changes are explicitly acceptable for this PR.
  • Do not request compatibility overloads for the removed allocating signatures. Focus review on runtime correctness, collection and handle lifetime, query-stack balance, filtering behavior, and allocation retention.

Validation

  • grill typecheck --quiet
  • grill test --quiet

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

ℹ️ 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 wurst/closures/SpatialIndexForUnits.wurst
Comment thread wurst/closures/SpatialIndexForDestructables.wurst
Comment thread wurst/data/ArrayList.wurst
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 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-10T09:39:45.645677Z 2939413 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.

@Frotty

Frotty commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

Review scope: these spatial-query APIs are new and unreleased, and breaking changes are explicitly acceptable. Do not recommend preserving the removed allocating overloads. Please focus on runtime correctness, collection and handle lifetime, query-stack balance, filtering behavior, and allocation retention.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Provided git ref 2939413515b126514cc6f707705f8d9f850f0fe2 does not exist
ℹ️ 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".

@Frotty

Frotty commented Sep 10, 2026

Copy link
Copy Markdown
Member 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: 2939413515

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

* ArrayList. The initial-capacity constructor avoids dense-list growth when a set is required.
*/
public class SparseSet<T:>
public class SparseSet<T:> extends Table

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent inherited Table mutators from corrupting SparseSet

Because class members are public by default, extending Table exposes mutators such as flush(), saveInt(), and removeInt() on every SparseSet. For example, set.flush() now erases the sparse membership index without clearing dense, so size() and get() still report elements while has() returns false, and a later add() can insert duplicates. Keep the Table as private composed storage or otherwise prevent these inherited operations from bypassing the set invariant.

AGENTS.md reference: AGENTS.md:L54-L56

Useful? React with 👍 / 👎.

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