Skip to content

fix: reference-matched native drag decomposition - #40

Merged
aeronauty-flexcompute merged 2 commits into
codex/preserve-run-cachefrom
codex/reference-drag-components
Oct 14, 2026
Merged

aeronauty-flexcompute merged 2 commits into
codex/preserve-run-cachefrom
codex/reference-drag-components

Conversation

@aeronauty-flexcompute

@aeronauty-flexcompute aeronauty-flexcompute commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

The native drag decomposition skipped low-Rtheta stations, clamped signed shear and used absolute x distance, so it disagreed with XFOIL’s actual CDf/CD−CDf report even though total CD matched. Replace those heuristics with CDCALC’s signed freestream projection, preserve surface y coordinates in the faithful force bridge, and gate both component outputs.

XFOIL’s polar-file CDp is a different surface-pressure integral; this PR explicitly compares the native cd_pressure = CD−CDf field with the matching final iteration report. It does not redefine that API or add a new pressure-integral output.

Measured evidence:

  • All 48 old native cases fail the matching component checks (maximum discrepancy about 0.00424).
  • Corrected 48/48 native cases pass; maximum CDf difference 4.91e-6 and CD−CDf 4.99e-6, both within 1e-5. Existing total-CD/CL/CM/transition/BL tolerances are unchanged.
  • An instrumented pinned-source control matches all 158 surface intervals: x/y exactly, projected distance within 3.47e-18, wall-shear differences ≤3.62e-7. The instrumented Rust/Fortran drivers and logs are retained; production contains no probe code.
  • 574 local Rust tests pass (23 inherited ignored); final-head Linux Rust CI also passes after inheriting the two additional flap regressions, 155 Python tests pass, four gate-negative/definition tests pass, 48/48 rebuilt shipping-WASM/reference/native cases pass, and docs/API build passes.

PR impact

Base/merge base: #39 at ad4a361. Head: 5a056e4. Twelve incremental files; inherited gate/cache/docs/flap slices are separate reviews.

Source-confirmed route: faithful update_force_state → canonical_force_state carries physical U, density-weighted Cf and actual surface y → shared compute_forces_from_canonical_state → signed compute_row_friction_drag → native/CLI CDf and CD−CDf output. The shared canonical integrator can also reach existing legacy callers; legacy station-based integration and general legacy-engine validity remain outside the reference claim. No new public Rust signature is introduced by this slice.

Gate route: final converged XFOIL iteration CDf/CD−CDf → native serial and batch comparisons. A negative test distinguishes that report from polar-file CDp and rejects missing component output. The WASM bridge does not expose these component fields, but its coefficients/Cp still pass the complete existing binding gate. Tests do not establish arbitrary geometry/Mach, experimental physical accuracy, global derivatives or interacting multi-element flow. The advisory reference scan is capped.

Changelog, Versions & Docs

  • CHANGELOG covers the changed native component behavior
  • UI package/top entry and both lock metadata versions agree (1.1.16)
  • Python distribution bumped (1.1.16)
  • Force/gate/API docs updated with equations, actual extracted source, interactive projection and measured limits
  • Docs built with no broken links or anchors

Final-head Linux CI passed: run38557641634, rust/python and Bugbot green. Base/merge base and impact were refreshed after the flap follow-up.

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.

2 participants