Repository navigation
Continuous wrapping method - #262
Conversation
The wrap was a distance field: threshold at the ball radius, flood fill, erode back to clearance, trace the level set with marching squares, then fair the result. Every one of those steps was bounded by the grid, so cell_size set the fidelity of the wrap and padding the field for min_concave_radius cost time in both directions. pivot_contour rolls the ball around the cloud and emits what its contact side sweeps: an arc of radius clearance about each point it touches, joined by an arc of the ball radius across each gap it cannot enter. Those arcs are the wrap boundary, so there is no resolution to choose. cell_size becomes min_clearance, a floor on clearance rather than a grid pitch, and is still accepted under the old name. The wrap now sits at exactly clearance from the cloud rather than a cell over it, so a V3 canopy's aft strip is 2*clearance thick where the grid gave 3.5*cell_size. One V3 slice at min_concave_radius 0.4 drops from 173 ms to 10 ms, and at the default radius from 15 ms to 3 ms. The resampling had to follow. push_arc! steps each arc to a chord tolerance, so its segments scale as sqrt(radius) and the trace's node spacing alternates by a factor of several between the two arc families. Diffusing the turning per node carried that alternation into the sampling measure and left the resampled panel lengths oscillating by up to 5.7x between neighbours; smoothed_curvature averages the turning over a fixed arclength band instead, which brings that down to the 3.0 of a plain cosine-clustered .dat. enforce_min_spacing! then keeps cosine clustering, which thins as the square of the station count, from putting leading-edge panels a fraction of a percent of chord long. Known limitation: XFoil's viscous solver still fails to converge on the wrapped NACA0012 of test/solver/test_backend_comparison.jl, where the distance-field wrap succeeded, and does so non-monotonically in the panel size. XFoil reports no LEFIND warning, so the contour is well formed; the suspect is the round trailing edge cap, which the contour both starts and ends inside. That is why this is a branch of its own and not part of #258. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@1-Bort-1 rebase and try to fix the continuous wrapping method such that the tests pass. |
|
Picked up as |
|
@1-Bort-1 the tests are still failing... |
# Conflicts: # CHANGELOG.md
The rolling-ball wrap floored clearance at min_clearance for every convex corner, so a closed airfoil wrapped at clearance=0 grew a round trailing-edge cap of min_clearance radius. XFoil flags the contour sharp (first point equals last) yet the geometry is blunt, and the blunt TE shifts the Kutta point: cl came out +-0.486 instead of +-0.434 and the viscous march failed to converge. A closed loop now uses its true clearances, so clearance=0 hugs the input and keeps a sharp trailing edge sharp; an open single-membrane cloud still gets the min_clearance capsule.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XBU65VqHBHJ12YyCXF9ZF3
|
Local full suite: PASS (5 min, Julia 1.12.7, one cell of the matrix) |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@1-Bort-1 do you think this is ready to merge? Is it stable/does it work well? |
|
Question from Diagnosed, not built: AGENTS.md §1 puts tool-permission policy and egress allowlists among the three things I never change on my own initiative, so this one needs your word before I branch. It is one line. Not a separate bug for the The thing worth your attention before saying yes. A chat turn runs as the ordinary agent unix user with the agent's own environment; what contains it today is that tool list plus starting in ~/repos — which is what the comment at the top of chat.ts means by "the credentials the agents use are not reachable". Grant Bash, even prefix-scoped, and containment becomes "the prefix matcher holds" against text arriving from Slack. PLAN §2 says that boundary should be a credential, not a prompt, and there is no read-only GitHub credential on the box to be one. So: which shape do you want? A) Credential first. You provision a read-only GitHub token for the chat turn; I put it in the turn's environment and allow gh pr view/list/search, gh api, agent status|logs|cost, WebFetch and WebSearch under both harnesses. A write then fails at GitHub whatever the model types, so the allowlist stops being the only thing standing between a Slack message and your repos. B) Patterns only, today, no new credential. Same allowlist, the agent's own token stays in the environment, and My recommendation: A. B buys you the answer to "is my PR merged" this week and quietly hands the chat side write rights it is documented not to have; the whole grant is worth having only once the credential is what limits it. If you want B as a stopgap say so and I will land it with the gap named in the card. Plan and the full diagnosis are in .agent/plan.md in the worktree; nothing is committed. |
|
Yes — I would merge it. (Sorry this is late: my last turn posted a harness question Green. GitHub CI 9/9 on Does it work well. Beyond the suite, XFoil converges 6/6 on δ ∈ {0,1,3} × crease ∈ Is it stable. The thing that made this "not ready to merge" is gone at the root What I would not claim:
One thing I would offer to land first: my own standing review comment — pivoting from |
|
@1-Bort-1 rebase onto main and address the comment as long as it doesn't hurt performance. |
FixedThe suite is green. First, CI had never seen the earlier trailing-edge fix — it was The real defect: Changes
Verification
Two things found on the way
Commits
Task |
1-Bort-1
left a comment
There was a problem hiding this comment.
Independent review (advisory)
Verdict: REQUEST CHANGES · 1 inline, 0 off the diff
Good
- The entire distance-field subsystem (distance_parabolas!, squared_distance_transform!, grid_sampler, flood_outside, trace_level_set, smooth_turning!) is deleted cleanly with no dangling callers — grep confirms zero remaining references, satisfying the §2 removal rule.
- cell_size → min_clearance is a documented, backward-compatible migration: the constructor keeps a cell_size=nothing alias, so existing ShrinkWrap(cell_size=...) call sites keep working.
- Docs stay in sync: airfoil_pipeline.md prose and private_functions.md's @docs list both reflect the new rolling-ball names with the old entries removed.
- The resampling change (smoothed_curvature over an arclength band, enforce_min_spacing! floor) is well documented and directly targets the two defects named in the PR card (per-node diffusion and cosine thinning).
Not good
src/airfoil_aero/shrink_wrap.jl:349— The PR card itself declares this 'Known limitation — not ready to merge': XFoil's viscous solver still fails on the wrapped NACA0012 (exercised via deform_section here and in test/solver/test_backend_comparison.jl), which the round clearance-radius trailing-edge cap now produces. Shipping a known-failing validation test, before the .dat-roundtrip-plus-noise check the author lists as the repo's bar, is blocking.- The outer pivot bound 4*length(x)+100 (and the +100) is an unexplained magic cap with no justification in docstring or PR.
- cell_size is accepted as a silent alias with no deprecation path, so the old name can linger forever — §3 discourages renaming API without a removal plan.
- private_functions.md lists enforce_min_spacing! before resample_arc and smoothed_curvature last, out of source order, which is only cosmetic.
opencode, rubric CLEAN_CODE.md. A different lab from the implementer
on purpose: a reviewer sharing its blind spots would not flag its mistakes.
| return (cx + (gap - d) * gx / len, cy + (gap - d) * gy / len) | ||
| end | ||
| ball = max(method.min_concave_radius, 1.01 * linking / 2) | ||
| px, py = pivot_contour(xn, yn, ball, gap) |
There was a problem hiding this comment.
MAJOR: The PR card itself declares this 'Known limitation — not ready to merge': XFoil's viscous solver still fails on the wrapped NACA0012 (exercised via deform_section here and in test/solver/test_backend_comparison.jl), which the round clearance-radius trailing-edge cap now produces. Shipping a known-failing validation test, before the .dat-roundtrip-plus-noise check the author lists as the repo's bar, is blocking.
Split out of #258, which carried this rewrite alongside unrelated section-order work and failed CI because of it.
What changes
shrink_wrapwas a distance field: threshold at the ball radius, flood fill, erode back toclearance, trace the level set with marching squares, fair the result. Every step was bounded by the grid, socell_sizeset the fidelity of the wrap and padding the field formin_concave_radiuscost time in both directions.pivot_contournow rolls the ball around the cloud and emits what its contact side sweeps: an arc of radiusclearanceabout each point it touches, joined by an arc of the ball radius across each gap it cannot enter. Those arcs are the wrap boundary, so there is no resolution to choose.ShrinkWrap'scell_sizebecomesmin_clearance— a floor onclearancerather than a grid pitch. Still accepted under the old name.clearancefrom the cloud instead of a cell over it: a V3 canopy's aft strip is2 * clearancethick where the grid gave3.5 * cell_size.min_concave_radiusstops costing anything. One V3 slice at radius 0.4 drops from 173 ms to 10 ms; at the default radius, 15 ms to 3 ms.Resampling had to follow
push_arc!steps each arc to a chord tolerance, so its segments scale assqrt(radius)and the trace's node spacing alternates by a factor of several between the two arc families. Diffusing the turning per node carried that alternation into the sampling measure, leaving resampled panel lengths oscillating by up to 5.7x between neighbours.smoothed_curvatureaverages the turning over a fixed arclength band instead, which is independent of how the arcs happen to be stepped. Neighbour ratio drops to the 3.0 of a plain cosine-clustered.dat.enforce_min_spacing!keeps cosine clustering — which thins as the square of the station count — from putting leading-edge panels a fraction of a percent of chord long.Known limitation — not ready to merge
XFoil's viscous solver still fails to converge on the wrapped NACA0012 in
test/solver/test_backend_comparison.jl, where the distance-field wrap succeeded, so that test errors ininterpolate_matrix_nans!with nothing to interpolate from.What is established so far:
LEFINDwarning, so the contour is well formed; it is the viscous march that fails, returning an alpha-independent cl (~-0.484 at -4, 0 and +4 deg alike).repanel=trueconverges 6/6, so XFoil's own repaneling repairs whatever it dislikes.clearance. The contour both starts and ends inside it, so each surface turns ~90 deg around the cap before the boundary layer can start. A sharp-TE airfoil has no such cap in the distance-field wrap.Next step is to confirm that mechanism and, per the validation bar this repo needs, check any fix through a written
.datroundtrip plus ~1e-7 coordinate noise over several sections rather than a single in-memory pass.🤖 Generated with Claude Code