Repository navigation
Evaluate B-spline derivatives with differenced control points - #112
asinghvi17 wants to merge 3 commits into
Conversation
Partial derivatives of B-splines were evaluated by contracting the control points with the derivatives of the basis functions, which gives rounding errors of order eps * |u| / h^k. Instead, difference the control points per dimension (de Boor) and contract them with the lower degree basis functions, so the rounding error is relative to the size of the derivative. The differenced control points are computed on the fly, without temporaries whose size depends on the degree. For multi point evaluation the precomputed basis function values for derivative order k are now the degree p - k basis function values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: 3dece05f-5f73-426c-bc3b-240539472b27 Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task 3dece05f-5f73-426c-bc3b-240539472b27 on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1cd75-1b6b-7cc1-9db1-0f5fcecef80b, reviewed head 8dec935
This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers. CI: CI unreadable; review only; merge gates unchanged Riskmedium (M3: measured high-order derivative slowdown up to approximately 20,000×; M2 also applies to changed numerical results on existing evaluation paths) Blocking findings
Non-blocking findingsNone. What I ranAI reviewer:
What I did not verifyCI results, author verification claims, QA, the Symbolics extension suite, docs builds, Julia 1.10, 32-bit platforms, and broader downstream/performance workloads. Complete GPU evaluation and GPU basis-cache construction remain unverified as detailed in blocking finding 3. No checkout edits, commits, pushes, GitHub posts, approvals, or merges were performed. 🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
Integer control points wrapped around and large Float32 control points overflowed when differenced in the element type of the data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: aad110d0-3832-4375-bdbd-87f21b89f4eb Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task aad110d0-3832-4375-bdbd-87f21b89f4eb on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
The recursive computation of the differenced control points took time exponential in the derivative order. Instead difference the p + 1 local control points once per derivative order along each dimension, and contract the dimensions without a derivative afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: aad110d0-3832-4375-bdbd-87f21b89f4eb Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task aad110d0-3832-4375-bdbd-87f21b89f4eb on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1cf3b-8c9f-7ec3-bc0b-9cefb1ba09fc, reviewed head 2912e17
This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers. CI: CI unreadable; review only; merge gates unchanged Riskmedium (M2: B-spline derivatives on working paths change their numerical evaluation and rounding; independent accuracy and regression verification pending.) Blocking findingsReview in progress; no final finding yet. Non-blocking findingsPending verification. What I ranIndependent risk recorded from the code diff before reading the requested prior review. What I did not verifyVerification in progress. 🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
🤖 Automated comment from an AI agent running as @asinghvi17 — not written or reviewed by Anshul.
B-spline partial derivatives were computed by contracting the control points with differentiated basis functions, so rounding error grew like eps·|u|/hᵏ. This switches to the standard de Boor derivative spline: control points are differenced on the fly per dimension, and the code evaluates a degree p − k spline. It works for mixed partials in N-D and stays allocation-free. Point derivative evaluation is 1.3–4× faster;
eval_gridis unchanged except about 10% slower for 1D derivatives.Max error (eps·max|exact derivative|, cubic, against BigFloat), before → after:
This replaces the basis-function-derivative recurrence used since the B-spline code was first written; it is new, not a restoration.
🤖 Generated with Claude Code
https://claude.ai/code/session_014mFQHtrhbkjCL96BmvXjDA
🤖 Posted by an AI agent — harness: Claude 2.1.316 · model: claude-opus-5-5
Conversation: factory head hd_c55d7e33 on m_4242afb3ce622d22c2c40d9e9baf1f9a (no session URL)