Skip to content

perf(row-reduce): optimize prepared helpers and complete Phase 4 evidence #9811

Description

@kim-em

library: HexRowReduce

Problem

HexRowReduce advertises executable row reduction, rank, nullspace, and span-coefficient operations, but has no compiled Phase-4 benchmark coverage. Premise validation also found two avoidable costs that must be fixed before scientific complexity evidence can be accepted:

  • IsEchelonForm.freeColsList filters every column using linear membership in the sorted pivot list, making the complement quadratic instead of linear.
  • IsRowReduced.nullspaceMatrix performs the linear pivotIndex? scan for every output entry, making the prepared constructor cubic instead of quadratic.

This issue therefore includes the prerequisite implementation work; it is not a documentation-only Phase-4 promotion.

Deliverables

  • Implement a linear sorted complement for free columns and prove it equivalent to the existing definition.
  • Keep the public pivotIndex? behavior unchanged, but build a private column-to-pivot-row lookup once inside nullspaceMatrix, use constant-time entry lookup, and prove equivalence.
  • Repair downstream HexBerlekamp/PackedKernel.lean proofs that currently rely on definitional unfolding of these implementations.
  • Add direct mode-1 registrations for all 12 advertised executable operations, with independently derived models, prepared-state isolation, fixed schedules, default tolerance 0.15, and the normal signal floor/time budget.
  • Add an informational persistent python-flint comparison for the directly comparable rank result only. Keep full RREF/nullspace correctness in conformance and give exact non-comparability reasons for the remaining operations.
  • Add Phase-4 input-family metadata, scientific evidence, representative profiles, an empty-Concerns headline report, and set the release manifest bench flag.

Initial schedules may be calibrated before evidence is frozen only to obtain adequate signal or avoid a documented runtime/allocation transition. Do not change the expected model or tolerance, omit difficult rungs, or retune after accepting a clean evidence run.

Context

Verification

  • lake build HexRowReduce
  • lake build HexBerlekamp
  • lake build
  • lake exe hexrowreduce_bench list
  • lake exe hexrowreduce_bench verify
  • fixed scientific runs, FLINT informational comparison, and representative profiles
  • python3 scripts/check_phase4.py
  • python3 scripts/check_dag.py
  • git diff --check

Metadata

Metadata

Assignees

Labels

claimedpod coordinationfeaturePlanner-dispatched implementation work

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions