Skip to content

More shapes: polyhedra, frames, quadrics and lattices (#298) - #361

Merged
rmrsk merged 24 commits into
mainfrom
more-shapes
Nov 26, 2026
Merged

rmrsk merged 24 commits into
mainfrom
more-shapes

Conversation

@rmrsk

@rmrsk rmrsk commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #298.

Background

#298 lists the primitives EBGeometry still lacks; #300 added the first nine. This pull request adds the rest in one:
polyhedra and frames, quadrics and special shapes, and lattices (triply periodic minimal surfaces). The sampled
distance fields (#298's section G) were in it and are taken out: the maintainer decided not to pursue them. Every built-in tape type
is copied into every level of every tape kernel, so each family is one type where its members share their code, and
users never list a shape type.

Solution

Eight new types, all built into the tape (Primitives in EBGeometry_Tape.hpp, after WedgeSDF), all in the .ebg
language, and all in InstantiateAll:

Type What Value Ray form
ConvexPolyhedronSDF any convex polyhedron from its planes (up to 20 faces, 20 vertices, inline, no pool); tetrahedron(), octahedron(), dodecahedron(), icosahedron(), pyramid() exact: the farthest face's plane when the foot is on that face, else the nearest edge exact (half-spaces)
BoxFrameSDF a box's twelve edges as bars exact, inside too (Quilez's frame is a bound inside, where bars meet) exact (the bars' spans, merged)
QuadricSDF hyperboloid(), hyperboloidTwoSheets(), paraboloid() exact: a monotone root for the hyperbola (Eberly-like), monotone Newton for the parabola's cubic exact (a quadratic, up to two spans)
SuperellipsoidSDF Barr's superquadric, exponents in [0.1, 2] bound: (gauge - 1) / the gauge's largest slope marched
SolidAngleSDF a cone of a ball, opening toward +y exact (Quilez) marched
VesicaSDF a lens between two tips exact (Quilez) marched (a spindle torus, not two balls: no cheap closed form)
HelixSDF a spring between two axis points exact: the squared distance searched window by window, at most one interior minimum per window marched
LatticeSDF gyroid, Schwarz P, Schwarz D (diamond), Neovius, as walls bound: |f| / max|grad f| - t/2 marched

A chain link is a documented composition (Elongate of a turned torus), tested against Quilez's exact link.

Also: the language names (tetrahedron ... lattice, convex_polyhedron(plane(...), ...)), the gallery model and
its figure, the Shapes example and its figure, a new ShapeFamilies probe,
the Sphinx pages (ImplemCSG's families subsection, ImplemRays, RayTracing, LeavesAndSurfaces,
LanguageShapes, Tape, Overview, GeometryRepresentations, PerformanceTesting, TestingLocally).

Side-effects

  • Device compile cost. Every built-in shape is compiled into every level of every tape kernel. The heavy parts of
    eight shapes are therefore EBGEOMETRY_DEVICE_NOINLINE (out of line on a device, inlined on the host): the new
    convex polyhedron's distance, the frame's bars, the quadric's hyperbola and parabola roots, the superellipsoid's
    gauge, the helix's window search and the lattice's field, and also the existing ellipsoid's root finding and polygon
    prism's cross-section. The cheap shapes stay inlined. CLAUDE.md now states the rule. sm_86, CUDA 12.5, base main
    at 344147cc (the first three rows measured with the sampled grid still in and before the ellipsoid and prism
    moved):

    build main all inlined this PR
    ebgstudio, GPU=CUDA, wall (-j7) 100 s 852 s 123 s
    ebgstudio, CPU build, wall 35 s 37 s 37 s
    proxy: four tape kernels (Tape<float/double>, signedDistance()/firstHit()), Release 89 s 139 s 115 s
    CUDA [gpu] tests, build, wall 16113 s 798 s

    The receipt's probe builds: CUDA 4677 s to 4949 s CPU (+6%), peak memory 5.5 to 5.4 GB; host 765 s to 802 s (+5%).

  • Registers (the tape-change-check, sm_86, __launch_bounds__(128), no minimum-blocks bound): the plain float tape
    kernels keep 168 registers, one signedDistance() (stack 3040 to 3056 bytes) and sixteen (stack 3024, unchanged).
    A double firstHit() kernel keeps 40 (stack 17568 to 17776, spills 484/868 to 620/968 bytes).

  • Host: the ray program's two leaf dispatches (dispatchRayLeaf, dispatchLeafHit) are split at DispatchSplit
    like the distance dispatch (rayLeafRest(), leafHitRest(), EBGEOMETRY_HOST_NOINLINE): without it, the new ray
    forms made GCC lay the chain out afresh in the renderer's loop. Device code is unchanged by it.

  • requireExactSDF() moved from TestAnalyticSDF.cpp to Tests/TestExactSDF.hpp, shared; a single shape in a tape
    is compared with the shape within four ulps (plus a few epsilons near a surface), not bit for bit.

Alternative solutions

  • One type per shape: ruled out by the maintainer (each built-in type costs every tape).
  • Merging the revolved shapes into one type: the type count is not what costs the compile (all nine types with stub
    bodies: Release proxy 211 s to 218 s), so a merge would not reduce it. Not done.
  • A pool-resident general polyhedron: a larger polyhedron is a mesh, which already exists.
  • Rolled loops (#pragma unroll 1) for the trigonometry and powers: no compile time saved, float tape kernels moved
    from 168 to 40/128 registers. Reverted.
  • Measured for the compile cost (studio GPU build, wall; proxy Release):
    • every level below the top sharing one copy of the shapes, as evaluateShared() does for the levels below the
      top except the deepest: studio 104 s, proxy 89 s, but float tapes of simple shapes 11-24% slower and double
      Regions 13-21% slower on the device. Rejected.
    • sharing the deepest level too: studio 131 s, proxy 122 s.
    • a smaller MaxCallDepth (proxy: depth 2 102 s, 1 83 s, 0 50 s): an API change, not pursued here.
  • Every new shape out of line on the device (the cheap ones and the three new ray forms too), timed against
    main: the double region-by-region query, ClosestPrimitive, the RayCrossing crossings and DomainObject go
    back to within 3%, but the traced double armadillo shell (RayShell/armadillo-tape/firstHit) becomes 8-11% slower,
    with the ray forms inlined or not; the float tapes (+4.5-6.5%) and the csg render (+4%) do not move. Not done: it
    trades one MAJOR for another.
  • Dropping shapes, or making some of them user-listed types: the only lever on the float tapes' cost, which comes
    from the longer dispatch, not from the shapes' code. Not done; the maintainer chose the shapes.

Performance

Receipt: Performance/receipts/more-shapes-532f1e6a.md (5497b3be against 344147cc), both sections accepted by
the maintainer: "Yes, the performance regressions are acceptable."

  • Host: yellow. 3 minor, 3 faster, no differing answers, nothing lost. Geometric mean over 332 cases: -0.1%.
    • TapeBVHUnion/maps64-as-written/signedDistance/float +8.1%: the float evaluator laid out afresh (a layout draw).
    • MeshTape/tape/frame/float +4.7%, ClosestPrimitive/csg/closestPrimitive/float +3.6%.
  • CUDA: yellow. No MAJOR, 15 minor, 13 faster, no differing answers or host/device disagreements. Geometric mean
    over 414 cases: -0.04%.
    • Minors, 3.6-10.0%: the float tape distances (sphere, smooth, chain16, csg; 4.6-6.6%), Domain/DomainObject
      labels (up to Domain/particles/labels/double +10.0%), Regions double (regionByRegion +7.0%), the csg render
      frames (float, +3.7%), RayCSG/scene-tape/firstHit-morton/float +4.3%, one LaunchTuning float launch,
      ClosestPrimitive parts (float). The 158 ray and render cases: geometric mean +0.03%.
  • Build costs: as in Side-effects.

Where to look

  • Source/EBGeometry_AnalyticDistanceFunctions.hpp (from ConvexPolyhedronSDF to LatticeSDF), including which
    parts are EBGEOMETRY_DEVICE_NOINLINE; the new ray forms at the end of
    EBGeometry_AnalyticRayFormsImplem.hpp; the ray-leaf split in EBGeometry_Tape.hpp/EBGeometry_TapeImplem.hpp.
  • Verified on 5497b3be (the ellipsoid and prism out of line): the debug unit tests (1526); the CUDA build of the
    test suite run on an RTX A4000 (CUDA 12.5, Release, 1654 of 1654, the [gpu] tests included); Doxygen with
    warnings as errors. On 549a19c (the grid taken out): release-test with both precisions (1523), the Sphinx HTML
    (9.1.1) with warnings as errors; nine @claude review rounds, the last with no blocking finding. Earlier, on the
    same shapes: debug-san. The full CI matrix passed on 3a581dfa (before the ellipsoid and prism moved).
  • Not verified locally: HIP (CI compiles it).

Reviewer checklist (to be completed by a human)

  • The test suite compiles and runs to completion without warnings or errors.
  • All relevant new features are documented in the user documentation (Sphinx).
  • This contribution does not break existing sections in the user documentation.
  • All relevant APIs are documented in the doxygen documentation.
  • Appropriate labels have been assigned to this PR.
  • New or revised proper licensing and copyright information is in place.
  • A PR review has been run using @claude review.
  • The continuous integration and testing hooks at GitHub run to completion.
  • The performance receipt is current (CI's Performance-receipt passes), and every regression in it is explained.

🤖 Generated with Claude Code

https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk

@rmrsk rmrsk added enhancement New feature or request csg Affects constructive solid geometry functionalities ray tracing Affects ray tracing functionality gpu Affects device code or launch labels Nov 20, 2026
@rmrsk

rmrsk commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 1m 13s —— View job


Review of #361 (more shapes)

This was a partial review. I did not build or run anything, and I did not read the quadric, helix or ray-form code in depth. I found no blocking issues in what I did read.

Read closely

  • EBGeometry_SampledGridSDF.hpp
  • The lattice shape
  • polyhedronTopology() and the ConvexPolyhedronSDF constructors
  • The language wiring in EBGeometry_LanguageImplem.hpp
  • The Tape.hpp, LeafRef.hpp, Language.hpp and EBGeometry.hpp diffs

Skimmed

  • A grep of the Sphinx and Source diff for PR numbers, history wording, measured numbers and British spellings turned up nothing.

Checked and found sound

  • SampledGridSDF bound:
    • Outside the box, sqrt(outside² + max(field,0)²) is a valid lower bound. The box is convex, so the cross term (p-q)·(s-q) is ≤ 0.
    • Inside the box, max(field, -inside) is the usual intersection bound.
    • The per-cell slope estimate is a valid Lipschitz bound for a trilinear interpolant.
    • The constructor's REQUIREs are complete, and the element count is capped at UINT32_MAX, so the uint32_t index arithmetic in interpolate() cannot overflow.
    • deepCopy reads the samples before reserving, so a copy into the grid's own pool is safe.
  • LatticeSDF scaling: the max gradient magnitudes in the scaled coordinates are √3 for the gyroid, Schwarz P and Schwarz D, and 7 for Neovius. I confirmed these numerically on a 40³ grid, so m_scale makes the value a true bound.
  • Polyhedron topology:
    • The vertex and edge construction is consistent.
    • The Euler-formula check rejects duplicate, parallel or unbounded plane sets with a REQUIRE message rather than a wrong shape.
  • Tape wiring: the Primitives order keeps the user types before the new built-ins, as the comment says.
  • Language: convex_polyhedron rejects any argument that is not a bare plane(...) with a located Error.

Nits (none blocking)

  1. Source/EBGeometry_SampledGridSDF.hpp:152-156: the comment explaining the largest-slope computation sits above the isfinite loop, not above the slope loop at line 167. Move it down to the slope loop.
  2. Source/EBGeometry_SampledGridSDF.hpp:216-218: the heightField() doc says the value is divided by sqrt(1 + s²) with s the steepest slope of the surface. The constructor actually uses the per-cell, per-axis edge maxima, sqrt(1 + sx² + sz²), which is slightly larger than the true gradient. It is still a valid bound, but the wording is looser than what the code does.
  3. Source/EBGeometry_AnalyticDistanceFunctions.hpp:5298: the topology tolerance scales with max|offset|, which measures distance from the origin, not the polyhedron's size. In float, a small polyhedron far from the origin (for example size 0.01 at 100 units out) gets a vertex-merge radius larger than itself. It then fails the Euler REQUIRE and aborts with a message. That is safe, but the error text ("do not bound a finite solid") will mislead. Consider a sentence in the constructor doc saying to build a polyhedron near the origin and Translate it.
  4. Working tree: .claude/skills/tape-change-check/SKILL.md shows as modified and unstaged in this checkout. It is not part of the PR diff, so make sure it is not committed by accident.

Still open per CLAUDE.md

  • The Performance section is "to be recorded" and the receipt is not in the PR yet. That is correct for a draft, since the receipt comes after the review rounds converge.
  • The device compile cost of the new tape types and the tape-change-check numbers (float tape kernel registers, host nm -C -S) are described in the body. I could not verify them here.
  • HIP is unverified locally, as the body says. CI's GPU-HIP job covers it.
    · branch more-shapes

@rmrsk

rmrsk commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

@claude review

Round 1's nits 1-3 are fixed in 875aae0 (nit 4 is about the CI checkout, not this branch: the working tree here is clean). Please read in depth what round 1 skipped: QuadricSDF with AnalyticDetail::hyperbolaDistance() and parabolaDistance(), HelixSDF (signedDistance() and windowMinimum()), BoxFrameSDF's interior distance, and the new ray forms (convexSpan for ConvexPolyhedronSDF, quadricSpans, the box frame's frameSpans/frameNextEntry/frameStretchEnd and its firstHit()/spans()) in EBGeometry_AnalyticRayFormsImplem.hpp.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 2m 36s —— View job


Review round 2 (#361): the code round 1 skipped

I read all of it, but I did not build or run anything. The checks below are derivations by hand. I found one bug in the box frame's spans() and one validation gap in HelixSDF. Neither is a blocker.

Findings

  1. RayForm<BoxFrameSDF>::spans() marks the start as an exact crossing when the ray begins inside a bar. (EBGeometry_AnalyticRayFormsImplem.hpp:1899-1913)

    • When the origin is inside a bar, frameNextEntry() returns a_t itself, so in == a_tMin.
    • RaySpansT::addClipped() (EBGeometry_RayImplem.hpp:748) treats an end as open only if a_in < a_t0. With in == a_tMin the start is stored as Exact, as a crossing at tMin.
    • Every other span form passes the true, earlier entry time, so its start comes out Open.
    • Only the first stretch is affected. Later stretches start strictly after t, because frameStretchEnd() merges touching bars.
    • Effect: a CSG span operation (an intersection or a difference with a frame) can report a crossing at tMin that is not a surface.
    • Fix: when inside is true, pass -inf as the entry to addClipped. For example, addClipped(inside ? -inf : in, end, ...).
    • Test: add a case with the origin inside a bar and check that the first span start is Open. TestRayAnalytic does not seem to cover this.
  2. HelixSDF accepts tubes that overlap the next turn, which breaks the interior value. (EBGeometry_AnalyticDistanceFunctions.hpp:7081-7082, doc at 7017)

    • The constructor only requires 2·tube < pitch and tube < R.
    • The distance between adjacent turns is at most pitch·R/√(R² + rate²), with rate = pitch/2π. That is smaller than pitch.
    • Example: R = 0.5, pitch = 1, tube = 0.49 passes the check. The turn separation is about 0.953, which is less than 2·tube = 0.98, so the tube overlaps itself.
    • Outside the tube, distance to the line − r is still the correct distance. Inside an overlap it is no longer the distance to the union's boundary, so the claim of exactness is false there.
    • Fix: tighten the REQUIRE to 2·tube < pitch·R/√(R² + rate²), or soften the doc. The doc says "must not touch itself" but the check does not guarantee it.

Checked and found sound

  • hyperbolaDistance():
    • The stationarity condition, F(u), and the bracket (0, min(xA, S)) are correct. F falls monotonically from +∞ to −∞, so the root is unique and is the global minimum, since the vertex is not critical for y > 0.
    • F(hi) < 0 holds for y > 0. Newton steps that leave the bracket fall back to bisection, and the u = S pole is never evaluated.
    • The closed forms on the two axes are correct. The x = 0 form is the global minimum because it is convex in Y.
    • The one-sheet and two-sheet folds, (X, Y, A, B) and the inside sign, match the Kind definitions.
  • parabolaDistance():
    • The cubic s³ + Ps + Q is right. For s > 0 it is convex with g(0) ≤ 0, so there is exactly one positive root, and it is the minimum.
    • g(a+b) ≥ 0 holds in both branches of P.
    • The start is within a factor of 2 of the root when P < 0, because g(a) = Q ≤ 0 and g(b) < 0 put the root at or above max(a, b).
    • When P ≥ 0 the start is at or above the root, so Newton converges monotonically from the right. The 64-iteration cap is ample.
    • The r = 0 case exits immediately at the right root.
  • QuadricSDF::signedDistance() and quadricSpans():
    • The (α, β, γ, δ) coefficients match each Kind.
    • The sign of G, the outward normal ∇G, the cancellation-free roots, the swap into order, and the qa == 0 and disc < 0 branches are all correct.
    • qa < 0 gives (−∞, t1] ∪ [t2, ∞), in the order firstHit() needs.
    • q == 0 implies qc == 0, so the t2 = t1 fallback is safe.
  • HelixSDF::signedDistance() and windowMinimum():
    • f, g and g' are correct. Minima occur only at upward zero crossings of g inside (−s_c, s_c), so the end-point and single-root candidates cover each window.
    • The kLow/kHigh range covers [0, last].
    • The pruning bound (the height gap) grows monotonically away from kNear.
    • The count loop bound and the below/above bookkeeping visit every window that is needed.
  • BoxFrameSDF interior distance:
    • The bar geometry in barSpan and barTerms agree: the outer t of two coordinates.
    • The REQUIRE of 2t < shortest side guarantees t < b, so the quadrant distance √(oᵢ² + oⱼ²) is reachable and exact.
    • I also checked the case where the point is in a bar and the case where it is at a corner.
  • convexSpan(ConvexPolyhedronSDF): correct, with early exit once in > out.
  • frameSpans, frameStretchEnd, frameNextEntry and firstHit():
    • Entry and exit faces come from the slab normals. A touching bar is merged, since in <= end && out > end.
    • The stretch end is never inside another bar, so the face is on the union's boundary.
    • firstHit() with the origin inside gives the exit with entering = false.
    • Ties in out can pick either face when the ray passes exactly through an edge. This is harmless.

Minor

  • frameStretchEnd has a 12-pass cap. That is enough for 12 bars, since each pass extends through at least one new bar.
  • In float, quadricSpans forms qb² − 4·qa·qc with large origins. It loses precision, but the roots stay ordered, so I am not asking for a change.

State

Still pending per CLAUDE.md: the receipt and the Performance section. HIP is unverified locally, and CI covers it.
· branch more-shapes

@rmrsk

rmrsk commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

@claude review

Both round 2 findings are fixed in f2d9293, with tests (the frame's open span start, a helix tube that passed the old check and overlaps). Please check the fixes and the rest of the diff once more.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 39s —— View job


Review round 3 (#361): checking the round 2 fixes

I read f2d9293 in full plus the surrounding code. I did not build or run anything. I found no blocking issues, and there are three nits.

Round 2 fixes

  1. Box frame, span from inside a bar (fixed correctly).

    • frameNextEntry() sets inside, and spans() now passes -inf as the entry.
    • addClipped() treats !(a_in > -inf) as an open end, so the start becomes Open at tMin. The a_in <= a_out and a_in > a_t1 guards still behave with -inf.
    • frameStretchEnd() still gets the true in and face, so the exit side is unchanged.
    • Later stretches have inside == false, so they keep exact starts.
    • The new test checks the open start, the exit at x = 1, and firstHit() with entering == false. It uses TEMPLATE_TEST_CASE, so it also runs in float.
  2. HelixSDF tube check (the fix is real, but the bound is not exact; nit 1).

    • The check now uses 2·tube < pitch·R/√(R² + (pitch/2π)²). That rejects the R = 0.5, pitch = 1, tube = 0.49 case, and the new death test covers it.
    • That bound is the spacing of neighboring turns measured in the unrolled cylinder, where distances run along the arc.
    • The true 3D distance between neighboring turns uses the chord, 2R·sin(θ/2), which is a little shorter than the arc. So the check can still accept a tube that overlaps by a small margin.
    • For R = 0.5, pitch = 1 the nearest approach is at θ ≈ 0.58 rad, and the chord is about 0.5% shorter than the arc. So tube ≈ 0.4765 would still pass.
    • The exact value would need a small 1D minimization over θ. If you keep the closed form, say in the doc that it is a close bound. Do not claim the tube cannot touch.
    • To check, brute-force the center line's self-distance over non-local points for a few (R, pitch) and compare it with apart.

Nits

  1. Helix class comment line length. Source/EBGeometry_AnalyticDistanceFunctions.hpp:7018 (the "By default the helix runs..." line) is now about 190 columns. The formatting hook will likely reflow it (clang-format ReflowComments). Re-wrap it at 120 columns.
  2. Death test text. The test expects "... distance between turns 0.0499937 (0.06)".
    • The %g value comes from double(T(0.5) * apart), and apart is computed in T. In float versus double the 6th significant digit could differ.
    • This is a risk only with EBGEOMETRY_TEST_BOTH_PRECISIONS=ON, which CI uses. The test cases are not templated, so please confirm that the test runs under both and that the digits match.
    • A safer match is the prefix up to "distance between turns", as the second new death test already does.
  3. Doc wording. The @param for a_tubeRadius says "just under half the pitch". That holds for R ≫ pitch/2π. For a small R the limit can be well under half the pitch, for example R = 0.1, pitch = 5. Say "at most half the pitch" or drop the parenthetical.

Rest of the diff

I found nothing new in the code I read in rounds 1 and 2. That covers the quadric roots, the polyhedron topology, the lattice scaling, SampledGridSDF and the language wiring.

State

Still pending per CLAUDE.md: the receipt, the Performance section and the full CI run. HIP is unverified locally.
· branch more-shapes

@rmrsk

rmrsk commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

@claude review

Round 3: the helix check now uses the exact closest distance between neighboring turns (AnalyticDetail::helixTurnDistance(), sampled and refined on the host, checked against brute force), the death test uses your 0.4765 case, the second matches a prefix, and the doc no longer says 'just under half the pitch'. The over-long comment line was reflowed by the formatter. In e3d9e2a.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 36s —— View job


Review round 4 (#361): checking the helix turn-distance fix

I read AnalyticDetail::helixTurnDistance(), the HelixSDF constructor check and its tests. I did not build or run anything. I found no blocking issues, and there are two small nits.

The fix

  • Formula: squared(θ) = 2R²(1 − cos θ) + (rate·θ)² is the exact squared chord between two center-line points an angle θ apart. Using the chord instead of the arc is what the round 3 finding asked for.
  • Search:
    • The walk to the first maximum, then the smallest sample over the rest of two turns, then golden section on ±1 sample, is sound. The dip sits near θ = 2π and the later dips are higher, since the rate²θ² term grows.
    • Spacing is 4π/4096 ≈ 0.003 rad, so the minimum is bracketed by a unimodal stretch. The result is also capped by the best sample (min(minimum, refined)), so it can never exceed the sampled value.
    • With no dip (large pitch against R), it returns infinity. Then only tube < R applies. The local curvature radius is (R² + rate²)/R ≥ R, so that is enough.
  • Constructor: T(2)·tube < apart is checked in T. The apart value is computed in double and then rounded to T, so the float and double results agree to float precision. The helper is host-only and runs once per construction (about 8k cos calls), which is fine for a constructor. I am assuming the constructor is not called from a device kernel. If it can be, the std::cos loop would need to move out.
  • Tests:
    • The 0.4765 case, with R = 0.5 and one turn of pitch 1, should now be rejected. My hand estimate of the chord gives about 0.474 for half the turn distance, and 0.4765 is above that.
    • The prefix match "…less than the helix radius 0.5 and half the distance between turns" avoids the float/double digit problem from round 3.
    • The R = 1, 10 turns, tube 0.06 case is rejected by the same check, with a prefix match.
  • Docs: the @param a_tubeRadius wording is now accurate ("less than … half the closest distance between neighboring turns").

Nits

  1. No direct test of helixTurnDistance(). The PR text says it was "checked against brute force", but nothing under Tests/ calls it. A test would keep that from regressing. It could compare it with a dense scan over θ for a few (R, pitch) pairs, and with the no-dip case (for example R = 0.1, pitch = 5) returning infinity. It could also check that a tube just under half of it constructs and just over it aborts.
  2. Comment accuracy. The @details says the sampling covers "the first two turns" and refines by golden section. The scan starts at the first maximum and the refinement bracket is ±1 sample around the smallest. That is correct, but you could add "with the minimum capped by the best sample" so a reader sees why the result cannot be above it. This is optional.

Earlier rounds

Nothing changed in the quadrics, polyhedron topology, lattice, SampledGridSDF, box frame spans or language wiring since round 3, and I have no new findings there.

State

Review rounds have converged with no blocking finding. Still pending per CLAUDE.md: the receipt and the Performance section, then promotion and the full CI run. HIP is unverified locally, and CI covers it.
· branch more-shapes

@rmrsk rmrsk self-assigned this Nov 22, 2026
@rmrsk rmrsk added the do not merge Do not merge this yet label Nov 22, 2026
@rmrsk rmrsk changed the title More shapes: polyhedra, frames, quadrics, lattices and sampled fields (#298) [DO NOT MERGE] More shapes: polyhedra, frames, quadrics, lattices and sampled fields (#298) Nov 22, 2026
rmrsk and others added 11 commits November 24, 2026 19:52
The declarations and Doxygen contracts, proposed for approval before the
implementation: ConvexPolyhedronSDF (the regular solids and the pyramid as
static functions, any other from its planes), BoxFrameSDF, QuadricSDF (the
hyperboloids and the paraboloid), SuperellipsoidSDF, SolidAngleSDF,
VesicaSDF, HelixSDF, LatticeSDF (gyroid, Schwarz P and D, Neovius) and the
pool-resident SampledGridSDF with heightField(). The bodies are stubs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
ConvexPolyhedronSDF with its exact distance (the farthest face's plane when the
foot is on the face, else the nearest edge), the regular solids and the pyramid;
BoxFrameSDF, exact inside too; QuadricSDF (hyperbola by a monotone root, parabola
by a closed-form cubic); SuperellipsoidSDF as a gauge bound; SolidAngleSDF,
VesicaSDF; HelixSDF searched turn by turn; LatticeSDF with the gradient bounds of
each surface; SampledGridSDF with heightField(). Exact ray forms for the
polyhedron, the frame and the quadrics. All are built-in tape types and .ebg
shapes; the gallery model shows each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
…ds example, the ShapeFamilies probe

The grid's slope bound is taken cell by cell; a chain link as an elongated torus, tested and documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
…he frame and helix in double only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
…'s root, Newton for the parabola's, one call site of the helix's window search, the frame's bars' spans computed once

Each built-in shape's distance and ray form is copied into every level of every tape kernel. On a float proxy of two
tape kernels (distance and firstHit), Release, these cut the compile from 414 s to 239 s (the base: 147 s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
…the solid; the grid's comments where they belong

ConvexPolyhedronSDF takes its planes relative to their mean point, and the factories build their planes in
double, so a small regular solid far from the origin keeps its vertices apart, also in float. The constructor
from planes says to build a float solid near the origin. The grid's slope comment sits above the slope loop,
and the height field's doc says what the bound is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
… tube must clear the next turn

RayForm<BoxFrameSDF>::spans() gave a ray starting inside a bar an exact crossing at its start; it now starts
open, as every other ray form's. HelixSDF required the tube under half the pitch, but neighboring turns are
closer than the pitch across the line, pitch R / sqrt(R^2 + (pitch / 2 pi)^2): the check uses that, with a test
of a tube that passed the old one and overlaps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
…st matches a prefix

The closest approach of neighboring turns is not straight across: the constructor now finds it by sampling
the first two turns and a golden-section refinement (host only), and the test's overlapping tube is one the
previous closed form let through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
…s, not bit for bit

GCC fuses multiply-adds under -std=c++17 too, and fused the new shapes' distances differently inlined
into the tape's dispatch than called directly (one ulp, Release with FMA).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk

rmrsk commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

@claude review (rebased onto main, which now has the shared device dispatch of #376; one new commit: TestTape's single-shape check within four ulps)

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 20s —— View job


Review round 5 (#361): the rebase and the new commit

I read 8b28881 (the only new commit) in full. I did not build or run anything, and I did not re-read the rest of the diff, so the verdicts from rounds 1-4 stand as given. I found no blocking issues, and there are two nits.

Tests/TestTape.cpp: four ulps instead of bit for bit

  • The relaxation is justified. GCC fuses multiply-adds by default, also under -std=c++17. A shape's distance can therefore round differently when inlined into the tape's dispatch than when called alone, which matches the commit message. This is the case CLAUDE.md describes for the tape and the fused operations: the values agree to rounding in a Release build.
  • The include is in place. catch_matchers_floating_point.hpp is already included (line 27), so WithinULP needs no new header.
  • The check still tests something. getNumClauses() == 1U is kept, and a wrong dispatch would be off by far more than four ulps.
  • The test name now says what it checks ("to rounding").

Nits

  1. ULPs are relative, and a distance near zero is not. If a probe lands close to a surface, a one-ulp difference in the inputs of a cancelling subtraction can be many ulps of the tiny result. WithinULP would then fail only in a Release build with FMA. I did not check the values probes<T>() produces (TestTape.cpp:41) against the 34 shapes. If none is near a surface the check is safe. Otherwise, use withinAbsT<T>(..., tightMargin<T>()) or Matchers::WithinULP(...) || withinAbsT<T>(...).
  2. Mixed value and bound shapes. Shapes with a bound value (LatticeSDF, SuperellipsoidSDF) go through pow and trigonometry. Those are the likeliest to exceed four ulps when libm calls are inlined differently, and the float instantiation is the one to watch in CI's Release cells. If one fails there, widen the margin for that shape rather than for all of them.

State

The rebase onto main (with the shared device dispatch of #376) is not something I can verify without a build. CI's full matrix and GPU-HIP will exercise it. Per CLAUDE.md, these are still pending: the host and device receipts (and so the Performance section), and promotion out of draft. The receipt must be recorded on this rebased base, because the base moved.
· branch more-shapes

…r a surface

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk

rmrsk commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 21s —— View job


Review round 6 (#361): f74bbaa, the absolute floor in the single-shape check

I read f74bbaa in full, which changes only Tests/TestTape.cpp. I did not build or run anything, and I did not re-read the rest of the diff, so the verdicts from rounds 1-5 stand. I found no blocking issues, and there is one nit.

The change

  • It adds || withinAbsT(expected, 4·epsilon) to the four-ulp check. This addresses round 5's nit 1, where an ulp bound alone is too tight for a cancelling difference near a surface.
  • It compiles in both precisions, as far as I can tell.
    • WithinULP(float, …) and WithinAbs are both MatcherBase<double> in Catch2 v3, so || combines them.
    • withinAbsT<T> casts explicitly, so there is no -Wdouble-promotion warning.
    • std::numeric_limits comes in through TestFloatingPointUtils.hpp.

Nit

  1. The floor is fixed at 4·epsilon, so it does not scale with the inputs.
    • Near a surface, the error of a cancelling subtraction scales with the magnitude of the operands (the probe's distance from the shape's center, up to a few units), not with the tiny result.
    • With operands around 10 and a result near 0, the error can be about 10·epsilon, which is more than 4·epsilon.
    • It is safe only if no probe in probes<T>() lands that close to a surface of a shape with large coordinates.
    • If a Release cell with FMA fails, widen the floor to looseMargin<T>() or to something like 16·epsilon, rather than going back to a larger ulp count.
    • Since CI's full matrix exercises this, I would leave it as is.

State

Still pending per CLAUDE.md:

  • The host and device receipts (and so the Performance section), recorded on the rebased base.
  • Promotion out of draft.
  • The full CI run, including GPU-HIP.
    · branch more-shapes

…Split, like the distance dispatch

The three new shapes with ray forms added their traces to the tape's ray-leaf
chains, and GCC laid out the whole chain afresh inside the renderer's loop: the
float orthographic CSG frame (first shapes only) became slower. rayLeafRest() and
leafHitRest() send the types from DispatchSplit on out of line on the host, as
dispatchRest() does for the distance. A device compile is unchanged (ptxas output
of the float tape kernels identical).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk

rmrsk commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 19s —— View job


Review round 7 (#361): 95414cd, the ray program's leaf dispatches split at DispatchSplit

I read 95414cd in full. It changes only Source/EBGeometry_Tape.hpp and Source/EBGeometry_TapeImplem.hpp. I did not build or run anything, and I did not re-read the rest of the diff, so the verdicts from rounds 1-6 stand. I found no blocking issues, and there are two nits.

The change

  • It follows the existing pattern. dispatchRayLeaf and dispatchLeafHit now hand over to rayLeafRest() and leafHitRest() once I + 1 == DispatchSplit. This is the same scheme as dispatchPrimitive/dispatchRest() (TapeImplem.hpp:2400, :2424).
  • There is no recursion cycle. The *Rest functions re-enter the template at DispatchSplit, and the I + 1 == DispatchSplit test is false from there on, so the chain continues inline inside the out-of-line function.
  • The split is safe when it does not apply. The primitive list has far more than six types, so dispatchRayLeaf<DispatchSplit> is never the I >= Primitives::size fallback branch.
  • Device builds are unchanged. EBGEOMETRY_HOST_NOINLINE is empty there, so the functions inline back and the device chain is the same as before. This matches your note that the ptxas output of the float tape kernels is identical.
  • The @details on DispatchSplit is accurate. It states the reason and no measured figures, as CLAUDE.md asks.

Nits

  1. The #316-style history in the commit message is fine, but the new @details ties the rationale to "the first shapes only". That wording is about this change's effect on one frame. Consider saying why the split exists instead: every shape with a ray form adds its trace to the chain. The sentence already has that, so this is cosmetic.
  2. The tape-change-check numbers in the PR body are now stale.
    • The body lists the host nm -C -S changes (dispatchRest() re-split, the tagged evaluateUnion growth). rayLeafRest() and leafHitRest() are two new out-of-line host functions that were not in that list.
    • Please re-run the host check on this head and update the Side-effects bullet, since CLAUDE.md says a function that newly appears there moves the receipt.
    • Per the layout-draw rule, the Tape and renderer cases may move by a few percent either way. Report that as such, and do not rearrange the evaluator to win it back.

State

Still pending per CLAUDE.md:

  • The host and device receipts, recorded on this head. This commit changes library code, so any receipt recorded earlier is stale.
  • The Performance section.
  • Promotion out of draft and the full CI run, including GPU-HIP.
    · branch more-shapes

rmrsk and others added 2 commits November 25, 2026 08:25
…ame's effect

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
Every tape kernel compiles every built-in shape, whatever shapes its tape holds. The
solvers of the heaviest new shapes (the frame's bars, the quadric's hyperbola and
parabola roots, the superellipsoid's gauge, the helix' window search, the lattice field,
and the convex polyhedron's distance, all loops) are now EBGEOMETRY_DEVICE_NOINLINE, so
that a kernel holds one copy of each instead of one per inlined level. The cheap shapes
stay inlined. The host is unchanged (the attribute is empty there).

Measured on scratch builds (sm_86, CUDA 12.5): the studio's GPU build 852 s -> 123 s
(main 100 s), the MeshTape probe build 7260 s -> about 590 s CPU (main 650 s); plain
tape kernels keep 168 registers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk

rmrsk commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 22s —— View job


Review round 8 (#361): 3c3b059, the heavy shapes' solvers out of line on a device

I read 3c3b059 in full, the only new commit since round 7. I did not build or run anything. I did not re-read the rest of the diff, so the verdicts from rounds 1-7 stand. I found no blocking issues, and there are three nits.

The change

  • Scope: it adds EBGEOMETRY_DEVICE_NOINLINE to nine functions: ConvexPolyhedronSDF::signedDistance, BoxFrameSDF::barTerms, hyperbolaDistance, parabolaDistance, SuperellipsoidSDF::gauge, HelixSDF::windowMinimum, and LatticeSDF::field. The macro is __noinline__ in a device pass and empty on the host, so the host code is unchanged.
  • Placement: the attribute sits after EBGEOMETRY_HOST_DEVICE and before the return type. That is the same pattern as the helpers in EBGeometry_Tape.hpp. The out-of-line definition of ConvexPolyhedronSDF::signedDistance does not need to repeat it, since the declaration carries it.
  • Rule match: this follows the CLAUDE.md rule that what multiplies across the tape's levels stays out of line on a device. The new @details text gives the reason in words, with no measured figures, as the docs rules ask.
  • No behavior change: it only changes inlining, so the values, the ray forms and the [gpu] tests are unaffected in principle.

Nits

  1. The PR body is stale on this change.
    • Alternative solutions still lists "keeping the heaviest inner helpers out of line on the device ... Not done; the maintainer's call". This commit does it.
    • The Side-effects compile-cost table (Release 802 s, Debug 1950 s) and its "removing any one of the frame, the helix or the quadric" analysis predate this commit.
    • Please move the item out of Alternative solutions and re-measure the table. The commit message's figures (studio GPU build 852 s to 123 s, MeshTape probe build 7260 s to about 590 s) belong in the PR body, not in comments, which is where they are now.
  2. The run-time cost on a device is not measured yet.
    • The PR body says Nine analytic shapes: ellipsoid, capped and round cones, polygon prism, tube, capped torus, cut spheres, wedge #300 dropped the same kind of change for its run-time cost on other tapes. The commit message only reports compile time and the plain float tape kernels' 168 registers.
    • The hostdevice pairs in Performance/ShapeFamilies and the existing Tape and MeshTape pairs should show it. Please compare them on the device receipt before accepting the change.
    • Also re-run the tape-change-check on this head: firstHit() registers and stack, the 16-evaluation kernel, and the spills. The body lists spills of 244/424 bytes, which this commit may change.
  3. Reflowed comment lines. The parabolaDistance and windowMinimum @details blocks have their existing lines re-wrapped as well as the new sentence added. That is harmless, but it makes the diff larger than the change. Keep the new sentence on its own lines if you touch these again.

State

Still pending per CLAUDE.md:

  • The host and device receipts, recorded on this head, since the commit changes library code.
  • The Performance section and the refreshed Side-effects numbers.
  • Promotion out of draft and the full CI run, including GPU-HIP, which will compile the __noinline__ equivalents.
    · branch more-shapes

rmrsk and others added 2 commits November 25, 2026 20:34
SampledGridSDF, its tests, its probe cases, the SampledFields example and its
page are removed, and the tape no longer lists it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk

rmrsk commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

@claude review

Round 9: 549a19c takes SampledGridSDF out of the PR at the maintainer's request (the header, its tests, its probe cases, the SampledFields example and its page, its place in the tape's type list and in the docs). Please check that nothing still refers to it and that the docs read correctly without it.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 43s —— View job


Review round 9 (#361): 549a19c, SampledGridSDF taken out

I read 549a19c in full and searched the whole tree for leftovers. I did not build or run anything, so CI is what confirms it compiles and the Sphinx build is clean. I found no blocking issues, one stale item to flag, and one nit.

Nothing still refers to it

  • A case-insensitive search for SampledGrid, SampledField, heightField, sampled grid, sampled field, GridSDF and height field matches nothing outside the receipt directory. It covers Source/, Tests/, Examples/, Performance/, Studio/, Docs/, EBGeometry.hpp, .github/ and the CMake files.
  • The remaining hits for "sampled" are unrelated: Mollify's kernel, values sampled along a ray, and sampled reference curves in the tests.
  • The source of the removal is complete:
    • the #include in EBGeometry.hpp and in EBGeometry_Tape.hpp;
    • the Primitives entry;
    • Tests/CMakeLists.txt, in both the test list and EBGEOMETRY_GPU_TESTS;
    • the InstantiateAll entry;
    • the probe cases;
    • the Examples/SampledFields folder, its page and its figure.
  • Examples/ has no SampledFields directory left.
  • Both comments that count types are still right. Primitives is 12 + 3 mesh + user types, then 9 older shapes plus the 8 new ones, which is the "seventeen" in the comment. The LeafRef::m_type comment now ends at LatticeSDF.

Docs read correctly without it

  • Examples/README.md: the reading order is renumbered 1 to 32 with no gap. The closing "Every example that builds a shape ..." list does not mention SampledFields.
  • ExamplesComposition.rst: the intro sentence, the bullet and the toctree entry are all gone. No :ref:Chap:ExampleSampledFields remains anywhere.
  • ImplemCSG.rst:
    • The table row, the pool-handle exception paragraph and the SampledGridSDF bullet are removed.
    • The Bound list now reads "SuperellipsoidSDF and LatticeSDF", which matches the code.
    • "The constructors run on the host" stays true.
  • GeometryRepresentations.rst, Overview.rst, RayTracing.rst, Tape.rst and LanguageShapes.rst: each sentence still reads correctly. The LanguageShapes paragraph about shapes with no language call is gone, which is right since nothing is left to name.
  • PerformanceTesting.rst and Performance/README.md: the ShapeFamilies description, the input list and the GPU row no longer mention the sampled grid or the Morton/random cases.

State

  1. The receipt is stale. Performance/receipts/more-shapes-*.md records head: 3c3b059f, but this commit changes library code (Tape.hpp's type list, AnalyticDistanceFunctions-adjacent headers, Performance/ShapeFamilies). CLAUDE.md says a push that changes the library or the probes needs the receipt recorded again.

    • It is also the receipt in which the CUDA verdict was accepted. Removing a type from the tape's list changes the device kernels, so that acceptance should not carry over without a new run.
    • Please re-record the host and device receipts on this head.
    • Re-run the tape-change-check too. Registers, spills and the host nm -C -S list all depend on the primitive list.
  2. The PR body is stale. It still describes SampledGridSDF in four places:

    • the "nine new types" intro and the type table row;
    • the SampledFields example and heightField() in the "Also:" list;
    • the compile-cost table, which was measured with it;
    • Where to look (EBGeometry_SampledGridSDF.hpp) and the "four @claude review rounds" note.

    It also still lists the NOINLINE change under Alternative solutions as "not done" (carried over from round 8). Update the body once the new numbers exist. The title also says "sampled fields".

Nit

  • PerformanceTesting.rst (the ShapeFamilies paragraph): the removal left a long line, "helix and gyroid), queried at random points ... grown by a quarter on". Re-wrap it at 120 columns like the lines around it.

Review rounds 1 to 9 have no open blocking finding. Still pending per CLAUDE.md: the receipt on this head, the PR body, promotion out of draft and the full CI run including GPU-HIP.
· branch more-shapes

rmrsk and others added 2 commits November 25, 2026 21:03
@rmrsk rmrsk changed the title [DO NOT MERGE] More shapes: polyhedra, frames, quadrics, lattices and sampled fields (#298) More shapes: polyhedra, frames, quadrics and lattices (#298) Nov 26, 2026
@rmrsk rmrsk added examples Improvements, additions, or modifications to examples and removed do not merge Do not merge this yet labels Nov 26, 2026
@rmrsk
rmrsk marked this pull request as ready for review November 26, 2026 08:30
rmrsk and others added 2 commits November 26, 2026 11:01
…of line on a device; CLAUDE.md and the FMA comment

The ellipsoid's root finding and the polygon prism's cross-section distance are EBGEOMETRY_DEVICE_NOINLINE, like the
new shapes' solvers: every built-in shape is compiled into every level of every tape kernel. CLAUDE.md states the
rule (heavy parts of built-in shapes out of line on a device) and the ray program's leaf dispatch split. The
pointDistances2 comment now says what GCC and Clang contract: GCC in every C++ mode, across the intrinsics too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk

rmrsk commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 18s —— View job


Review round 10 (#361): 5497b3b and the receipt 1ffbb2e

I read both commits against 8f68163. I did not build or run anything. I found no blocking issues and one nit.

5497b3b: ellipsoid and polygon prism out of line on a device

  • Placement: EBGEOMETRY_DEVICE_NOINLINE on ellipsoidDistance and PolygonPrismSDF::polygonDistance sits after EBGEOMETRY_HOST_DEVICE and before the return type, as for the other heavy parts. It is empty on the host, so host code is unchanged.
  • Rule match: both are heavy parts under the CLAUDE.md rule (an iterative root finding, and trigonometry). The new @details give the reason in words, with no PR numbers or measured figures, as the docs rules ask.
  • CLAUDE.md:
  • FMA comment in BVHQueryImplem.hpp: the new wording is consistent with the CLAUDE.md note that GCC contracts in every C++ mode. It also matches why TestTape compares within four ulps.

Nit

  • The ellipsoidDistance @details is attached after "Internal helper; not part of the public API". The out-of-line sentence is fine there. Say "a device compile" rather than "every tape kernel", since the sentence also holds for a kernel that only reaches the ellipsoid through a plain tape.

Receipt and state

  • Performance/receipts/more-shapes-532f1e6a.md is for 5497b3be, the head before the receipt commit, so it is current. 1ffbb2e only adds the receipt and removes the earlier one.
  • Both sections are marked accepted with the maintainer's quote. That is the process CLAUDE.md describes, and I cannot verify the timings.
  • The PR body already describes the final state: SampledGridSDF is gone and the NOINLINE change is in Side-effects. The compile-cost table says which rows predate the ellipsoid and prism change.
  • The round 9 nit (PerformanceTesting.rst long line) is reflowed in 8f68163.
  • Still pending per CLAUDE.md:
    • Promotion out of draft and the full CI run on this head. The last full-matrix pass was on 3a581dfa, before this change.
    • GPU-HIP, which CI compiles. The ellipsoid and prism attribute is new for it.

Review rounds 1 to 10 have no open blocking finding.
· branch more-shapes

@rmrsk
rmrsk merged commit 0ede693 into main Nov 26, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

csg Affects constructive solid geometry functionalities enhancement New feature or request examples Improvements, additions, or modifications to examples gpu Affects device code or launch ray tracing Affects ray tracing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSG: more primitives (ellipsoid, frustum, prisms, Platonic solids, lattices, sampled fields, ...)

1 participant