Skip to content

Prevent duplicate native compilation of reconstructed core rows #465

Open

Description

@afflom

Reproduction and cause

Stitch's unchanged 20-module generated graph with Lean 4.32.1 and the pinned PrismPM SDK candidate sha256:cd3b47d7a370c4a26b8285f5e9c3bb15e639973c55505c3809ddbe55352fea58 stalls during native C emission of LexLeanRuntime.Laws. Kernel/object compilation alone does not exercise this failure. Downstream run: https://github.com/afflom/stitch/actions/runs/42843185062.

A cold native Lake build with moreLeanArgs = ["-j2"] and LEAN_NUM_THREADS=2 exceeded 600 seconds in Laws. Post-frontend inspection found 695 native declaration-order entries for 689 unique local impure declarations. Six duplicated matcher-splitter entries from LexLeanCollections.lessThan and LexLeanLaws.sumNat are reconstructed by Lean reserved-name actions and then compiled again by core_v2.rs::compileRows. Lean's native declaration-index builder asserts and native sorting repeatedly fails.

A scratch-only guard against recompiling existing local impure declarations made the identical 20 project modules pass all 25 cold Lake jobs in 15.503 seconds. That diagnostic is not an accepted patch: independently filtering members could compromise mutual-recursion groups.

Scoped repair and acceptance

  • Make native reconstruction avoid already compiled declarations while preserving complete mutual-recursion groups and existing sparse metadata handling.
  • Add a real native C-emission/execution regression for reconstructed matcher splitters, including grouped declarations and a defect control. Preserve kernel replay, exact axiom policies, and existing runtime contracts.
  • Use official writers for affected identities/artifacts; retain full exact-head qualification before merge. No handwritten generated runtime or scratch metadata acceptance.
  • Downstream remains blocked until PrismPM publishes a corrected immutable qualified SDK and unchanged Stitch source/kernel/native/vector gates plus Template regression pass.

Coordination

Taking this narrow decoder repair forward on its own issue-linked draft branch. @humuhumu33 authored the runtime/derived-row reconstruction (#144/#155); please flag an overlapping repair or required release-line coordination. Current main/release-v0.4 and release-v0.5 compileRows still contain the same unguarded compilation. No duplicate active fix was found by targeted issue/PR searches. This does not take over the existing compiler identity/release integration owners.

Activity

  1. afflom commented on Nov 10, 2026

    @afflom
    MemberAuthor

    Release coordination for the existing repair owner: current accepted release/v0.4 is 700196ce, and release/v0.5 remains 2b0395ef. #405’s scoped preparation 6521c800 has completed its producer but still awaits its owner’s output/forward qualification; #459 is awaiting reconciliation after the latest v0.4 landing.

    Please identify the draft PR/head and intended release line when the candidate is published so the bounded source review and affected official products can be coordinated with those owners. Root is not starting a competing repair, reproduction or identity wave. The issue already states the group-preserving/native regression and downstream qualification requirements; the reported six duplicates and 15.503-second scratch result remain diagnostic evidence, not acceptance of a patch.

    #454 remains open. Link the eventual qualified repair and downstream evidence there before treating the original Laws/native-build failure as resolved. Reserved #316 source/frozen evidence stays separate from this repair.

  2. afflom commented on Nov 11, 2026

    @afflom
    MemberAuthor

    Full-body delivery checkpoint for #466 at c89b69f: the scoped source and official-writer output reviews remain clear. Current exact-head CI 42946701043 has 53 of 54 materialized jobs successful, with the package lane still active; same-run honesty and exact-head reproducibility 42946701086 passed. This is not final acceptance or a landing claim.

    The last acceptance bullet here explicitly requires a corrected immutable qualified PrismPM SDK plus unchanged Stitch source/kernel/native/vector gates and Template regression. A qualified compiler landing alone therefore does not complete this issue. Preserve the existing diagnostic downstream evidence without treating that candidate binary as an accepted SDK. #454 separately needs applicable native-build resolution evidence for its original Laws/PP5007 failure; its body does not add the Stitch/Template matrix as separate formal requirements.

    Existing owner retains qualification, landing, SDK delivery and #405 forward integration. The required v0.5 forward merge remains a separate release obligation. No extra producer, benchmark, rerun or duplicate patch is requested by this scope review.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions