Keep sequence projection storage proportional to assigned items

This commit is contained in:
2026-10-24 14:04:26 +00:00
parent e94a0642ff
commit d0848290da
4 changed files with 99 additions and 47 deletions

View File

@@ -783,7 +783,15 @@ scope; do not change selector meaning or require consumers to remove valid rules
## 19. Avoid Dense Global-Position Storage For Sparse Item Projections — P2
Status: [ ] Open.
Status: [x] Complete.
Completion: contiguous composition ranges and their origin contributions retain
arithmetic offset lookup. Scattered projections use independently cloned sparse
maps in both directions; unprepared range queries no longer allocate indexes.
Audited the shared projection/history callers for batch preparation. Added
structural coverage for many one-item ranges, widely separated assignments, and
absent coordinates. Existing upsert, history, version, and ownership tests pass,
along with `./scripts/check.sh` and `go test -race ./internal/engine`.
Owners: `newSequenceItemProjectionIndex` in
[`sequence_projection.go`](../../internal/engine/sequence_projection.go),