Skip to content

mocs_to_orders: ragged batch moc_to_order β€” plus an API sweep for bulk-by-default operatorsΒ #156

Description

@espg

πŸ€– from Claude (filed at espg's direction, 2026-08-07)

Part 1 β€” mocs_to_orders: ragged batch moc_to_order

zagg's batch shardmap rewire (englacial/zagg#400, consuming #153's polygons_to_morton_mocs) eliminated the per-ring coverage calls, and profiling the survivor shows moc_to_order is now the residual per-ring Python call β€” roughly a third of the remaining wall. Same shape as #153, one level up the pipeline:

values, out_offsets = mortie.mocs_to_orders(
    moc_values, moc_offsets,   # ragged MOCs, arrow list layout (e.g. polygons_to_morton_mocs output, verbatim)
    order,                      # shared scalar target order (mirrors #153's shared-setting ruling)
    max_cells=...,              # per-MOC budget, same semantics as the scalar
)
# values: flattened order-cells, all MOCs concatenated; out_offsets: arrow list layout

Part 2 β€” sweep mortie for scalar-only operations; bulk operators by default

This is the second consumer-driven batch request in two days (#153, now this). Rather than filing these one at a time, espg's direction: audit the public API for scalar-only / per-object-loop operations and add ragged/array batch variants as the default posture β€” new operations should take array/ragged inputs natively, with the scalar form as the convenience wrapper, not the other way around.

Known candidates to seed the audit (from zagg's call sites):

Deliverable for part 2: an audit table on this issue (operation β†’ scalar-only? β†’ consumer/hot-path evidence β†’ batch variant proposed y/n), then individual implementation as follow-ups sized like #153/#154.

Refs: #153 / PR #154 (the pattern: strict ragged contract, plural naming, shared scalar params, fail-fast index naming, chunked assembly), englacial/zagg#396 + englacial/zagg#400 (the consumer), #152 (the convenience-scalar counterexample).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions