Skip to content

New node: 'Aperiodic Tiling'#4016

Draft
jsjgdh wants to merge 3 commits intoGraphiteEditor:masterfrom
jsjgdh:aperiodic-tiling
Draft

New node: 'Aperiodic Tiling'#4016
jsjgdh wants to merge 3 commits intoGraphiteEditor:masterfrom
jsjgdh:aperiodic-tiling

Conversation

@jsjgdh
Copy link
Copy Markdown
Contributor

@jsjgdh jsjgdh commented Apr 8, 2026

Need few changes . (Not complete yet )
Can be used to check the this initial implementation.

image

@jsjgdh jsjgdh changed the title New Node :New Node New Node :Aperiodic tile Apr 8, 2026
@jsjgdh
Copy link
Copy Markdown
Contributor Author

jsjgdh commented Apr 8, 2026

@cubic-dev

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Apr 8, 2026

@cubic-dev

@jsjgdh I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements aperiodic tiling (specifically the 'Hat' tiling) by adding a new geometric generation module and a corresponding node to the vector graph. The feedback identifies a correctness bug where manual reflection of 'H1' tiles conflicts with the transformation matrix, as well as a performance optimization to use fixed-size arrays instead of heap-allocated vectors for vertices. Furthermore, the initial metatiles need to be recentered to ensure the viewport culling logic correctly utilizes the calculated bounding radius.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Confidence score: 3/5

  • There is a concrete regression risk in node-graph/nodes/vector/src/aperiodic_tiling.rs: viewport culling can mismatch because initial metatiles are not recentered while collect_hat_transforms assumes centroid-based origins.
  • Given the reported severity (6/10) and high confidence (8/10), this is likely user-visible behavior (tiles incorrectly culled/positioned) rather than a purely internal refactor concern.
  • Pay close attention to node-graph/nodes/vector/src/aperiodic_tiling.rs - reconcile metatile recentering/origin assumptions between generation and collect_hat_transforms.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="node-graph/nodes/vector/src/aperiodic_tiling.rs">

<violation number="1" location="node-graph/nodes/vector/src/aperiodic_tiling.rs:174">
P2: Viewport culling mismatch: The initial metatiles returned here are not recentered, but `collect_hat_transforms` assumes each metatile's origin is its centroid (`parent_xform.transform_point2(DVec2::ZERO)`). Since `bound_radius` is computed relative to the centroid in `MetaTile::new`, the culling sphere will be offset from the actual tile center, causing tiles near viewport edges to be incorrectly culled or shown. Call `recentre()` on each metatile before wrapping:
```rust
h.recentre();
t.recentre();
p.recentre();
f.recentre();

(Rc::new(TileType::Meta(h)), ...)
```</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@jsjgdh
Copy link
Copy Markdown
Contributor Author

jsjgdh commented Apr 8, 2026

@cubic-dev

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Apr 8, 2026

@cubic-dev

@jsjgdh I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 3 files

Confidence score: 3/5

  • There is a concrete runtime-risk issue in node-graph/nodes/vector/src/aperiodic_tiling.rs: near-parallel handling in intersect can yield invalid points in release builds, which may corrupt downstream metatile geometry.
  • Because this is user-impacting geometry correctness (severity 6/10, high confidence), this PR carries some merge risk rather than being a straightforward safe merge.
  • node-graph/nodes/vector/src/lib.rs also has a required PR-title format violation; it’s process/policy-related but should be fixed to meet new-node submission standards.
  • Pay close attention to node-graph/nodes/vector/src/aperiodic_tiling.rs and node-graph/nodes/vector/src/lib.rs - geometry intersection correctness in release mode and required new-node title compliance.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="node-graph/nodes/vector/src/lib.rs">

<violation number="1" location="node-graph/nodes/vector/src/lib.rs:1">
P1: Custom agent: **PR title enforcement**

PR title violates the required new-node format `New node: 'Node Name'` (casing, colon spacing, missing single quotes, and node-name capitalization).</violation>
</file>

<file name="node-graph/nodes/vector/src/aperiodic_tiling.rs">

<violation number="1" location="node-graph/nodes/vector/src/aperiodic_tiling.rs:47">
P2: Near-parallel line handling in `intersect` silently returns an invalid point in release builds, which can propagate corrupted metatile geometry.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@jsjgdh jsjgdh changed the title New Node :Aperiodic tile New node: 'Aperiodic Tiling' Apr 8, 2026
@jsjgdh
Copy link
Copy Markdown
Contributor Author

jsjgdh commented Apr 8, 2026

@cubic-dev

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Apr 8, 2026

@cubic-dev

@jsjgdh I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@jsjgdh
Copy link
Copy Markdown
Contributor Author

jsjgdh commented Apr 8, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new 'Aperiodic Tiling' node to the vector node graph, which generates hat-based aperiodic tilings. The implementation includes logic for tile substitution and metatile construction. The review highlights concerns regarding the use of 'panic!' and 'unreachable!' macros throughout the code, which could lead to application crashes if unexpected states occur. It is recommended to replace these with more robust error handling, such as returning 'Result' or 'Option' types, to ensure the stability of the node graph.

@Keavon
Copy link
Copy Markdown
Member

Keavon commented Apr 9, 2026

!build (Run ID 24217184865)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

📦 Web Build Complete for 003c38a
https://d38e1fbc.graphite.pages.dev

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.

2 participants