Skip to content

WIP haskell resolve packs — STAGING (parity decision needed, do not merge) - #411

Draft
Disentinel wants to merge 1 commit into
mainfrom
hbp/haskell-packs-staging
Draft

WIP haskell resolve packs — STAGING (parity decision needed, do not merge)#411
Disentinel wants to merge 1 commit into
mainfrom
hbp/haskell-packs-staging

Conversation

@Disentinel

Copy link
Copy Markdown
Owner

Status: DRAFT — decision artifact, do not merge as-is

Four adversarially-reviewed derive packs that replace the native haskell-resolve arms (imports / local-calls / cross-module-calls / local-refs). Inert in this PR: not wired into STDLIB_PACKS (rfdb) or STDLIB_RULE_PACKS (orchestrator), so graph output is unchanged and the cross-registry uniformity test passes. This banks the validated authoring work and surfaces the activation decision.

The decision

js/rust reached exact differential parity (679/679, 7800/7800 → 0) before native was retired. These haskell packs are documented supersets of native, with zero native-only rows (full coverage) but extra rows:

arm native pack Δ
local_refs 16,934 117,400 +100,466 (scope-incorrect PARAMETER name-multiplicity)
imports ArmA (IMPORT→MODULE) 814 3,090 +2,276 (duplicate MODULE.name across packages)
cross_module_calls 1,618 6,782 +5,164

The superset is intrinsic: native precision comes from Map.fromList keeping one arbitrary winner per (file,name); set-semantics Datalog derives all same-(file,name) candidates and cannot replicate an insertion-order winner. Neither is scope-correct (proper scope resolution needs SCOPE edges, outside this resolver's contract) — native just emits fewer, arbitrarily-chosen edges.

Choose before activation:

  1. Accept the superset as the haskell graph (full coverage, lower scope-precision), gate the 4 native arms off, keep haskell-globals native.
  2. Hold for a scope-edge precision pass so packs match native's edge count.

Globals/prelude arm is deferred to a wave-2 pack regardless (the HASKELL_GLOBAL:: minter).

Each pack's header carries the full per-arm delta accounting and live-query evidence.

… pending)

Four adversarially-reviewed derive packs replacing the native haskell-resolve
arms (imports / local-calls / cross-module-calls / local-refs). Authored and
LIVE-measured against the dogfood graph; NOT wired into STDLIB_PACKS or
STDLIB_RULE_PACKS, so they are inert dead files — graph output is unchanged and
the cross-registry uniformity test still passes.

Why staged, not activated: unlike js/rust (which reached EXACT differential
parity — 679/679, 7800/7800 → 0 — before native was retired), these packs are
documented SUPERSETS of the native resolver:
  - haskell_local_refs : pack 117,400 vs native 16,934 (Δ dominated by
    scope-incorrect PARAMETER name-multiplicity)
  - haskell_imports ArmA: pack 3,090 vs native 814 (duplicate MODULE.name)
  - haskell_cross_module: pack 6,782 vs native 1,618
  In every arm pack ⊇ native with ZERO native-only rows (full coverage), but
  the extra rows come from set-semantics deriving ALL same-(file,name)
  candidates where the native resolver's Map.fromList kept ONE arbitrary
  winner — a choice set-semantics Datalog cannot replicate.

Decision required before activation (do NOT merge as-is): accept the superset
(more coverage, less scope-precision) as the haskell graph, or hold for a
scope-edge precision pass. Globals/prelude arm is also deferred (wave-2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant