Skip to content

NA: Carve movement / zoned / compaction monoliths by interface #215

Description

@arniber21

Parent

#201

Context

Domain algorithms are deep; modules are monoliths:

File ~LOC Clusters
movement.rs 1797 params, plan_aod_movement, duals/pack, geometry R1–R3, banks, legality
compaction.rs 1124 deps/ASAP, merge classes, geometry verify, force_merge
zoned.rs 1049 ZoneSpec/arch, cost, schedule_zoned, placer modes

Helpers like layer_has_entangle / geometry predicates are copy-pasted across files. Goal is navigability and locality, not algorithm rewrites.

What to build

Split by interface without changing planner behavior:

  • geometry / R1–R3 checkers (shared)
  • conflict / bank packing
  • placer search vs cost evaluation
  • compaction merge policy vs verify

Share layer predicates. Keep public entrypoints (plan_aod_movement, schedule_zoned, compact_schedule) stable.

Acceptance criteria

  • Geometry / legality predicates have one module; movement and compaction both call it
  • No intentional schedule changes (existing NA tests / snapshots gold)
  • Largest file size drops materially (target: no single planner file ≫ ~800 LOC without a documented reason)
  • Module headers describe each interface’s invariants

Blocked by

Prefer landing ZoneKind (#212) first if zone types move. Not blocked on #211 unless files are rewritten there.

Related

#201, #212, ADR-0008

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendGeneral backend / compilation pipeline (not NA- or IBM-specific)enhancementNew feature or requestneutral-atomNeutral-atom backend target (quon_na, quantum.na, AOD/schedule)ready-for-humanRequires human implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions