Skip to content

eval: root cache keys on the shape under a rigid placement (posed assemblies re-render from cache) - #929

Merged
ecto merged 3 commits into
mainfrom
render-photoreal-gpu
Oct 16, 2026
Merged

ecto merged 3 commits into
mainfrom
render-photoreal-gpu

Conversation

@ecto

@ecto ecto commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Root mesh cache: key a root on its shape, not its placement.

When a root is a rigid Translate/Rotate chain over a shape, the cache now keys on the shape underneath and applies the placement to the cached mesh afterwards. A posed assembly rendered in a new pose is then all cache hits instead of re-running every boolean.

Workload: a two-arm robot scene from rose. 242 roots, about 280 bolt-hole booleans, each plate emitted as [translate [rotate shape]].

main this PR
first frame (cold) ~100–156 s same
every later pose (same parts, new placements) ~100 s, 221 of 242 roots miss 0.08 s, all 242 hit

Measured with vcad export frame.loon frame.glb on top of current main.

Details

  • peel_rigid_placement strips the outer Translate/Rotate chain (bails on Scale) and reuses collect_transform_chain for the composed transform. place_mesh maps positions and normals. It only applies when a cache is configured; uncached evaluation is unchanged.
  • On a miss, the shape is meshed in its own frame and stored, then placed. The returned Solid gets the same transform, so BRep consumers see the placed solid.
  • root_keys: a peeled root reports None, because a mesh bundle written from its key would be the unplaced shape. Those parts simply aren't bundled.
  • Earlier, with the pre-kosm-render renderer, raster output was pixel-identical to uncached renders.

Scope change

This PR first carried a GPU mesh tracer and photoreal look changes (cyclorama backdrop, edge rounding, finishes) inside vcad-kernel-raytrace. Main has since moved the tracer into kosm-render, which already has a GPU path, so that work will come back as a kosm-render PR instead. It's preserved on the local branch render-gpu-look.

Verification

  • New test rigid_placement_is_peeled_off_the_cache_key: one cube placed twice gives 1 miss and 1 hit, both copies land at their own placements, and root_keys is [None, None].
  • cargo test --release -p vcad-eval passes. cargo fmt and cargo clippy are clean on the touched file.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Actions Updated
mecheval Ignored Ignored Oct 16, 2026 6:08pm UTC
vcad Ignored Ignored Oct 16, 2026 6:08pm UTC
vcad-docs Ignored Ignored Oct 16, 2026 6:08pm UTC
vcad-mcp Ignored Ignored Oct 16, 2026 6:08pm UTC

Request Review

ecto and others added 2 commits October 16, 2026 13:29
The placement is applied to the cached mesh, so a posed assembly in a new
pose hits the cache instead of re-running every boolean. Two-arm scenario
frame (242 roots): ~100 s -> 0.3 s per frame once the shapes are cached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mesh bundle written from root_keys can't stand in for a placed shape, so a
root whose rigid placement was peeled off the cache key reports None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ecto ecto changed the title render: shape-keyed cache, GPU photoreal, product look -- 420-frame animation in 4 min eval: root cache keys on the shape under a rigid placement (posed assemblies re-render from cache) Oct 16, 2026
@ecto
ecto force-pushed the render-photoreal-gpu branch from 198ddf2 to 516466d Compare October 16, 2026 17:46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ecto
ecto merged commit 89030b8 into main Oct 16, 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