Remove duplicate chunk discovery paths - #75
Open
asinghvi17 wants to merge 2 commits into
Open
Conversation
Phase 4's gate: one query implementation defines graph edges, and neither
the executor nor the interface translates that relation back through a
compatibility tree. Both halves are now tests.
Deleted, each after a repo-wide audit recorded in the note:
- `connectedchunks` and `connectedchunks!` (all four methods). Not
exported, not `public`, and after E1 with no caller outside
`test_lazy.jl`. The two `srcindex` in-place forms were the card's
"compatibility source-index state": a prebuilt source index carried
around outside any relation and re-queried, which is what E1 removed
from `LazyRegridArray`.
- The whole `chunktree` bridge: the export, the declaration, the
`chunktree`-collecting `chunkextents` fallback with
`_collectextents!`, `RasterFlatTree` and its fifteen trait methods,
and `chunktree(::RasterGrid)`. Nothing implemented it but the bridge
itself and three test toys; `DGGSpace` never had one, and DGG's
private `_cachedchunktree` is an unrelated name and is untouched.
`chunkextents` is now a required hook with no fallback, so a space
no longer has two ways to answer one question.
Kept, because the audit says they are not dead: `chunkextents`, which
has many real consumers that want the caps as values rather than as a
query; `chunkextent`, which is `public`, documented and part of the C1
contract, and which `RasterGrid` now specializes at O(1) in the chunk
count rather than materializing the whole vector; the gates harness's
archived `:latjoin` arm, whose sunset condition (G2's waiver retired)
has not fired; and the generic `candidatechunks!` fallback, which is one
method of the one query rather than a second relation.
`TileCells` forwards `chunkextents`/`chunkextent`/`chunkindex` where it
used to forward `chunktree`, which also makes it answer over a
`DGGSpace`.
The oracle tests now read every claim off `sourcesof(dependencies(plan),
d)`, and the shared oracles in `graphoracles.jl` are reused rather than
re-spelled. `G4ProbeSpace`'s counter moved up one level from `chunktree`
to `chunkextents` — the same funnel, since `chunktree` had no caller of
its own.
Evidence, all in regrid-notes/2026-08-23-e2-delete-legacy-discovery.md:
- `benchmark/chunk_graph_gates.jl` before/after, 13 cases including the
production pair from a local tile list, 26 rows each: every relation
field identical on every row, `graph_allocated_bytes` byte-identical
on every row, and both runs "PASS on 9 oracle-checked case(s)".
- Residency and values byte-identical: LazyStats peak 2073600 B, 400
readblock! calls, repeated reads/slices/retiled plan stable, and the
pre-existing max |eager - lazy| = 2.44249e-15 unchanged.
- Suites: GlobalRegridding 3999 -> 4021 pass (+22, itemized in the
note; nothing was deleted along with the code it covered), 1 broken,
0 fail; crosssystem regrid 236, acceptance 22, copdem_policy 89,
copdem_source_mode 7 and CopernicusDEM 16258/3 all unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019DuGKTmvs5B4EynwZddKMg
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019DuGKTmvs5B4EynwZddKMg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task E2, the whole of Phase 4 of
regrid-notes/2026-08-21-regridding-simplification-plan.md. Fifth in the stack, on top of #74 (which is on #72, on #71, on #70). Record:regrid-notes/2026-08-23-e2-delete-legacy-discovery.md.Phase 4's gate: one query implementation defines graph edges, and neither the executor nor the interface translates that relation back through a compatibility tree. Both halves are tests, in
test_chunkgraph.jl, testsetone query implementation defines every edge.Deleted, each after a repo-wide audit
connectedchunks/connectedchunks!— all four methods. Not exported, notpublic, and after E1 no caller outsidetest_lazy.jl. The twosrcindexin-place forms were the card's "compatibility source-index state": a prebuilt source index carried around outside any relation and re-queried.chunktreebridge — the export, the declaration, thechunktree-collectingchunkextentsfallback with_collectextents!,RasterFlatTreeand its fifteen trait methods, andchunktree(::RasterGrid).The
chunktreeverdict: removeNothing implemented it but the bridge itself, a
TileCellsforwarder, and three test toys.DGGSpacenever had one — it specializeschunkextents/chunkindex/candidatechunks!directly. DGG's private_cachedchunktreeis an unrelated name (it caches aHierarchicalGridCursor's caps) and is untouched, as is the local variable namedchunktreeincrosssystem/regrid.jl.ext/has no reference anddocs/does not build GlobalRegridding.So the only thing that still needed
chunktreewaschunktree: a space packed its caps into a flat tree so the genericchunkextentscould walk it and collect the same caps straight back out.chunkextentsis now a required hook with no fallback, asserted as!hasmethod(chunkextents, Tuple{RegridSpace}).RasterFlatTreewent with it, closing the note atrastergrid.jl:969-971.Kept, because the audit says they are not dead
chunkextents— many real consumers that want the caps as values:spacestamp,_builddependencies(both sides),subspace_dependencies, the genericchunkindex, and three production scripts.chunkextent— afterconnectedchunkswent it had zero callers and zero specializations, but it ispublic, documented, and asserted by the qualified-contract testset. The card says keep a cheap one, and the genericchunkextents(space)[chunk]was not cheap, soRasterGridnow specializes it atO(1)in the chunk count.:latjoinarm — there is no latitude join left insrc/at all (G2 deleted it). What remains carries an explicit sunset condition tied to G2's waiver, which has not been retired; deleting it would have destroyed both the waiver's audit trail and half of this PR's own before/after evidence.candidatechunks!STI fallback — unreached in-repo after the above, but it is one method of the one query function rather than a second relation, and it is what makes the documentedchunkindexpromise true.api.jldocuments thatchunk_dependency_graphhas noplanmethod) or "redundant cap vectors" (E1 moved the graph's two onto the relation on purpose; in production they alias the twoDGGSpaces' own arrays).Gate: the relation is identical
benchmark/chunk_graph_gates.jlat the branch point and on this branch. 13 cases including the productioncopdem90-igeo7-l12pair from a local tile list, both arms, 26 ndjson rows each,-t 8 --gcthreads=4, 5 samples.Every relation field identical on all 26 rows —
edges,demanded_pairs,demand_missing,oracle_pairs,oracle_missing,only_here,missing_here,destination_chunks,source_chunks,radius,identity_bytes,graph_allocated_bytes,graph_summarysize_bytes.graph_allocated_bytesbyte-identical on every row is the direct evidence the bridge was never on the build path. Both runs printverdict: PASS on 9 oracle-checked case(s); 4 case(s) unchecked— a real geometric verdict, notNOT CHECKED. Production:indexed+1.8 %, inside the band G3/G4/E1 all recorded on unchanged code.Values and residency: byte-identical
0e3fb70)LazyStatsreadblock!callsSuites
lib/GlobalRegridding/testcrosssystem/regrid.jlcrosssystem/regrid_acceptance.jlscripts/copdem_policy.jlscripts/copdem_source_mode.jlCopernicusDEM/runtests.jlNo count dropped. Every assertion that named a deleted function was rewritten onto the relation rather than removed. The +22 is itemized assertion by assertion in the record: 19 in the new Phase 4 gate testset, 2 in
discovery, 1 in the wave-failure testset.🤖 Generated with Claude Code
https://claude.ai/code/session_019DuGKTmvs5B4EynwZddKMg