Skip to content

Mesh one large model on all cores (ENG-3833) - #29

Merged
akhilles merged 3 commits into
masterfrom
akhil/eng-3833-foxtrot-one-large-model-uses-6-of-16-cores
Oct 11, 2026
Merged

akhilles merged 3 commits into
masterfrom
akhil/eng-3833-foxtrot-one-large-model-uses-6-of-16-cores

Conversation

@akhilles

Copy link
Copy Markdown

This change meshes the shells of a shape concurrently, scans large STEP files in parallel, and lowers spline boundary points in parallel. On 16 threads, ASP-184330-01 tessellates in 0.26 s instead of 1.26 s. The output is identical on all 1,004 corpus models. Part of ENG-3833.

A shell-based surface model can hold hundreds of shells:
ASP-184330-01 is one shape with 568 shells of about 58 faces each.
triangulate meshed the shells of a shape one after another, so each
shell was a separate small fork-join. Threads idled between shells and
during each shell's serial merge, and the model took longer on 16
threads (1.5 s) than on 4 (0.6 s).

Each shell now meshes into its own mesh on the rayon pool, and the
meshes are appended in shell order. Output is unchanged.
Before meshing, triangulate builds its lookup tables (units, colours,
representation relationships, products and occurrences) in about ten
serial passes over every entity. ASP-184330-01 has about a million
entities, and these passes took 70-80 ms, as long as meshing its
32,840 faces on 16 threads.

A file with more than 65,536 entities now filters them on the rayon
pool and keeps file order, so the tables and the output are unchanged.
Smaller files still scan serially: waking the pool for each pass cost
more than the pass itself.
A spline face projects each boundary point onto its surface with a
global search, and one projection can take milliseconds. A face with
many such points was one long serial job: on RFPC-SMA16-FN-A, two faces
took most of the model's time on one core. Under pcb, which tessellates
all models on one rayon pool, a model that stole such a job waited for
it too.

The projections are independent, so lower_verts now runs them on the
rayon pool with one scratch per worker, and reports the first error in
vertex order. Output is unchanged.

@cursor cursor 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.

Left a non-blocking comment. This is a functional tessellation and parallelism change, not a small fixup, so it still needs human review. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@akhilles
akhilles merged commit 1737ac3 into master Oct 11, 2026
4 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