Skip to content

perf: Recover Delaunay realization performance after 0.5.2 kernel adoption #331

Closed

Description

@acgetchell

Resolution — investigation completed

No demonstrated upstream performance defect; no code fix justified by the controlled evidence. See the findings, methods, limitations and evidence. The reduced-4D slowdown is layout-sensitive, and the controlled whole-5D confirmation does not support a stable approximately 1.7% adoption cost.

Whole-5D raw evidence and initial attribution/reduced-4D evidence are attached with verified SHA-256 digests. Remaining release validation and publication are explicitly retained in #333. No production or Git changes were made.

The original report below is preserved as historical context; it is not a claim that its dirty-source experiment was reconstructed exactly.

Historical report at filing

Target v0.5.3. Investigate and remove the remaining realization-validation overhead observed when Delaunay adopted the published la-stack 0.5.2 kernels in acgetchell/delaunay#654, acgetchell/delaunay#655, acgetchell/delaunay#656, acgetchell/delaunay#657, and acgetchell/delaunay#659.

The consumer has a measured local 5D whole-realization slowdown of approximately 1.7%. The individual upstream operation responsible has not been isolated. This issue starts with attribution and a reduced kernel benchmark; it must not assume that column_basis, rational_dot, or interval solving is defective merely from an end-to-end comparison. No numerical correctness failure was observed.

Historical evidence

Same macOS 27.2 aarch64 host, Rust 1.99.1, Criterion 0.8.2, locked dependencies, serial runs, --profile perf, ten samples, one-second warmup and requested two-second measurement. Setup and invariant admission are outside timing. Both consumer revisions already resolve la-stack 0.5.2: this measures adoption of its APIs, not a dependency-version comparison.

Consumer workload Before median After median Change
Whole realization, 2D / 500 vertices 6.782767 ms 6.852263 ms +1.02%
Whole realization, 3D / 20 vertices 104.279625 ms 104.415573 ms +0.13%
Whole realization, 4D / 10 vertices 103.878386 ms 103.304729 ms -0.55%
Whole realization, 5D / 8 vertices 14.553804 ms 14.803797 ms +1.72%
Single shared vertex, 4D 1.345815 µs 1.378288 µs +2.41%
Single shared vertex, 5D 2.225618 µs 2.256544 µs +1.39%

For whole 5D realization, Criterion reports a change estimate of +1.6757%, 95% interval [+1.0761%, +2.2427%], p < 0.05. The table uses medians, so its percentage differs slightly from Criterion's change estimate.

The broader comparison is mixed: coincident exact LP cases improve 15–21%; degenerate SoS predicates improve 30–46%; ordinary shared-face cases improve about 2.5–3.3%. Delaunay-validity checks show no statistically detected change. Preserve these gains. This is focused local evidence, not a release-wide claim.

Historical reproduction and source identity

The unchanged whole-realization fixture is in Delaunay's benchmark at the baseline commit: seed 0x482, coordinates in [-100, 100], 8 vertices in 5D, adaptive kernel; construct and certify outside timing, then time is_valid_realization().

Run on baseline production source and the completed group-4 consumer source, serially on the same host:

# Baseline: substitute --save-baseline group4-before for --baseline group4-before.
cargo bench --locked --profile perf --bench realization_validation -- \
  '^(realization_narrow_phase|realization_validation|realization_lp)/' \
  --noplot --sample-size 10 --warm-up-time 1 --measurement-time 2 \
  --baseline group4-before

Baseline production commit: f6ebaed0033ca7d46f273eb460ce41f30b310134. The five coincident-LP fixtures were added before baseline measurement with identical timed boundaries. At filing, the consumer implementation is still uncommitted; its git diff HEAD --binary -- src benches SHA-256 is 208380195424aff4f6c31f5b7bb0fc0af62da9b0138d8a730becf0b3582802a7. Root Cargo.lock SHA-256: 4e7e1c7dff267618e82cfa50322e95731258d9fbd77504ddf870d1327f6c8fa2.

Consumer report: docs/la_stack_adoption.md. Retained local raw evidence: target/group4/final/criterion.tgz, before/after logs and source.diff. These local artifacts are not GitHub attachments. Link the eventual group-4 commit/PR and durable evidence before claiming an independently reproducible upstream fix.

Completed investigation and disposition

The maintainer accepted this investigation as complete on 2026-11-09 UTC. The final findings and evidence supersede the original assumption that an upstream optimization must be delivered.

  • Compare explicit baseline/adopted Delaunay revisions with identical locked dependencies and the shared original harness; retain the 16-case attribution measurements and profiling. Document the unavailable historical dirty source/raw artifacts rather than claim exact reconstruction.
  • Build and validate the reduced 4D reproducer, compare generated code and relocation operands, and establish that the reproduced full-harness timing difference is sensitive to process layout.
  • Apply matching layout controls to the actual whole-5D benchmark and complete a separately planned fixed-size confirmation: 80 executions and 2,400 validated raw samples in total. No stable approximately 1.7% adoption penalty is established.
  • Retain raw samples, plans, scripts, source/harness/binary identities, preflights, logs and focused generated-code evidence as GitHub attachments; verify downloaded archive checksums.
  • Preserve production code, supported successful behavior, tolerances, rank/shape contracts, typed errors, exact certificates, interval guarantees and SoS semantics. No numerical or API workaround was introduced.
  • Record the supported no-fix disposition and transfer remaining release validation/publication to release: plan, publish and verify la-stack v0.5.3 #333 before closing this investigation.

Not applicable: a kernel optimization, fix PR/commit or supplying-fix version. No upstream or consumer defect warranting a code fix was established. Environment padding is a diagnostic intervention, not a recommended fix. The exact hardware mechanism remains unknown.

Still pending, owned by #333: final scientific/native/default/exact and package checks; final-source release measurement and affected 2D–5D, LP/SoS and applicable 6D–8D coverage; original signed CI/package evidence; v0.5.3 publication, non-yanked crates.io/checksum verification and fresh normal Cargo consumers. The local diagnostic does not mark these gates complete or establish a release-wide performance claim.

Related upstream API work: #305, #306, #307, #308. This is a follow-up to adoption, not a request to reopen those completed API deliveries.

Downstream published-release adoption: acgetchell/delaunay#680. This investigation identified no supplying fix. Actual published-release validation belongs to #333; downstream integration remains separate and is not a prerequisite for publishing the supplier.

Activity

  1. added this to the v0.5.3 milestone on Oct 30, 2026
  2. added
    performancePerformance related issues
    rustPull requests that update rust code
    on Oct 30, 2026
  3. acgetchell commented on Nov 9, 2026

    @acgetchell
    OwnerAuthor

    Whole-5D investigation evidence: 80 executions, 2,400 validated raw samples, plans, scripts, build provenance and report. Original tar.gz SHA-256: 63088bdd5542ae209d83eda486f37489430565b884f45cc8f6611c5d8df0fa05. The ZIP wrapper preserves that archive unchanged. Findings and release-validation handoff are recorded separately below.

    whole-5d-evidence.zip

  4. acgetchell commented on Nov 9, 2026

    @acgetchell
    OwnerAuthor

    Initial attribution and reduced-4D evidence: reports, plans, reproducer, measurement/analysis scripts, raw Criterion records, profiling/build logs, focused disassemblies/diffs and relocation checks. Full executable disassemblies and executables are omitted; focused compared functions and their results are retained. The ZIP contains attribution-evidence.tar.gz, SHA-256 e274e802181454f56e97b18b4550823d11704a84499d78b61486c165e69c1e23. These exploratory studies preceded the controlled whole-5D confirmation attached above.

    attribution-evidence.zip

  5. acgetchell commented on Nov 9, 2026

    @acgetchell
    OwnerAuthor

    Completed investigation: no demonstrated upstream performance defect

    Closing this investigation at the maintainer's request. The controlled whole-5D comparison does not establish the originally reported approximately 1.7% slowdown as a stable cost of API adoption. The reduced-4D investigation also supplies no evidence for changing la-stack arithmetic or APIs. No production code fix, fix commit, or supplying release is claimed. Remaining release validation and publication belong to #333; downstream published-package adoption remains separate in acgetchell/delaunay#680.

    Source and workload identities

    • Baseline Delaunay: f6ebaed0033ca7d46f273eb460ce41f30b310134.
    • Adopted Delaunay: e9f48463b28476b08a45fde6ff8651f22ebaa176, merged Delaunay PR #681.
    • Both resolve published la-stack 0.5.2. This compares API adoption, not dependency versions. Identical Cargo.lock SHA-256: 4e7e1c7dff267618e82cfa50322e95731258d9fbd77504ddf870d1327f6c8fa2.
    • Shared original sixteen-case harness SHA-256: a7392f5a8ed08a38543577cc7b831c4a919ffbf62a6f4b3797f6a1f0757f1daf. Isolated per-revision builds and effective compiler commands are retained.
    • Whole-5D case: realization_validation/5d/8v_seed_0000000000000482, eight vertices, seed 0x482, coordinates [-100, 100], adaptive kernel. Construction and fixture admission are outside timed is_valid_realization(); both phases report eight simplices.
    • Apple M4 Max, macOS 27.2 (26B123), Rust 1.99.1 / LLVM 23.1.1, Criterion 0.8.2. Measurements were November 8 local / November 9 UTC, 2026.

    Attribution and reduced 4D

    The first sixteen-case ABBA comparison retained 64 observations / 1,920 samples. Whole 5D did not reproduce the slowdown (descriptive forward/reverse changes -5.02% / -1.61%), while the original 4D single-shared-vertex case did show about +12–13%. Whole-5D profiles were dominated by rational GCD/right-shift work (approximately 76–77%); they did not isolate a defective adoption API.

    The reduced 4D reproducer uses standard/reflected simplices sharing only the origin. Its two homogeneous 5×5 determinants are independently exactly +1; untimed determinant, orientation and intersection checks pass in both builds. Original full-harness rechecks gave +12.45% / +12.90%, but reduced intersection gave +0.04% / -0.81%; reduced orientation and determinant pairs showed no corresponding regression.

    Generated-code comparison found identical relocation-normalized instruction shapes for the original Bareiss (482 instructions), orientation (290), and integer scaling (592) kernels, with independent literal/import/source-location checks. The outer intersection changed from 3,122 to 1,744 instructions and its stack frame from 1,408 to 1,152 bytes. Smaller code alone does not establish faster execution.

    Most decisively, the same adopted executable, with identical arguments and output path, measured approximately 1.32 µs with an unused empty environment variable versus 1.49–1.50 µs when absent, in empty/absent/absent/empty order. This establishes layout sensitivity, not a specific stack/cache mechanism. Environment padding is an experimental probe, not a proposed fix. The reduced/layout study validated all 53 observations and 3,518 raw samples.

    Whole-5D layout controls and confirmation

    The original verified executable bytes were copied to equal-length paths. Working directory, arguments, selected case, sampling and active output path were fixed; results were moved only after each process exited. The only deliberate layout intervention was an unused STACK_DIAGNOSTIC_PADDING variable: absent, empty, 64 spaces or 256 spaces. Every execution used 30 samples, 1 s warmup and 3 s requested measurement. Timing was serial, without concurrent compilation, profiling or analysis.

    Positive change means adoption is slower. Estimates are geometric means of adjacent same-layout process-median ratios; approximate 95% Student-t intervals use paired log ratios. Process pairs, not individual Criterion samples, are the replication units.

    Initial layout (4 pairs each) Paired change Approximate 95% interval
    Absent +0.57% [-2.53%, +3.76%]
    Empty -1.25% [-2.72%, +0.25%]
    64 spaces -3.86% [-7.25%, -0.34%]
    256 spaces +0.58% [-0.89%, +2.07%]

    A separately declared, fixed-size confirmation used 12 fresh pairs per initially uncertain layout, balanced revision/layout orders, no early stopping and no discarded observations. It is analyzed separately, not as an optionally extended pooled test.

    Confirmation layout Baseline median (ms) Adopted median (ms) Paired change Approximate 95% interval
    Absent 14.620 14.451 -1.04% [-1.90%, -0.17%]
    256 spaces 14.458 14.444 -0.33% [-0.88%, +0.23%]

    All 80 whole-5D executions / 2,400 raw samples passed inventory/sample validation. Both preflights passed, binary/harness digests remained intact, deterministic summary replays matched, and independent ratio recalculation agreed. Analysis passed Ruff and Ty, including a Windows static target; launchers passed ShellCheck and reports/plans passed Markdown/spelling checks. These are macOS measurements, not native Windows validation.

    Limits and disposition

    The original dirty adoption diff and target/group4/final raw artifacts are unavailable. The merged adoption revision includes later test work; the shared harness omits later LP/high-dimensional registrations. This is a reproducible comparison of the named revisions/harness, not exact historical reconstruction.

    Background desktop services remained active (pre-run CrashPlan approximately 90% CPU and WindowServer approximately 50%); affinity, frequency and temperature were uncontrolled. Seeded coordinates are fixed, but per-process UUID bookkeeping is regenerated. The intervals are conditional local estimates, not familywise bounds or a release-wide speedup claim. The exact hardware mechanism remains unknown.

    No upstream or consumer code defect was established that warrants a fix. Scientific contracts, tolerances, supported cases and production code remain unchanged. Final native/default/exact correctness and packaging, release-policy performance coverage (including LP/SoS and 6D–8D where applicable), eligible final-source evidence, publication and fresh normal Cargo consumers remain pending in #333. This diagnostic does not satisfy those gates.

    Durable evidence

    Both downloads were retrieved from GitHub and checked against the original archive digests.

    • Whole-5D evidence ZIP: report, predeclared plans, measurement/analysis scripts, all 80 raw runs/logs/order records, summaries, preflights, build provenance, harness and lockfile. ZIP SHA-256 4a3a5c9cbd6222d0848e26f44697c21d33f062d6141b63236ad49a8cb37f0467; enclosed tar.gz SHA-256 63088bdd5542ae209d83eda486f37489430565b884f45cc8f6611c5d8df0fa05.
    • Initial attribution and reduced-4D evidence ZIP: reports/plans, reproducer, scripts, raw measurements, profiles/build logs, focused disassemblies/diffs and relocation checks. ZIP SHA-256 99925bceb639b644bfd768c49f6d212f5baede3302a658f3db36c11cf77e8521; enclosed tar.gz SHA-256 e274e802181454f56e97b18b4550823d11704a84499d78b61486c165e69c1e23.

    Executables and full executable disassemblies are not attached; digests, compiler logs and compared function disassemblies are retained. The chronological reports preserve their original investigation-stage wording; this disposition and the whole-5D confirmation are the final conclusion.

    No Git mutations were performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance related issuesrustPull requests that update rust code

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions