Skip to content

fix(gfql): degree facts build on real graphs — density was my requirement, not the math's - #1872

Merged
lmeyerov merged 3 commits into
masterfrom
perf/gfql-degree-positional
Aug 12, 2026
Merged

lmeyerov merged 3 commits into
masterfrom
perf/gfql-degree-positional

Conversation

@lmeyerov

Copy link
Copy Markdown
Contributor

#1871's degree facts built on every test fixture and on zero real graphs: the builder refused gapped id spaces, and real node spaces are gapped — the benchmark's own is (ids [1,107438], nunique 107434). Answers stayed correct via the scan, so nothing failed; a 1-minute engagement probe caught it before a multi-hour lane receipted "degrees don't help" as a false negative.

The fix is removing a requirement, not adding a mechanism

Density is not required for the arrays: ids absent from the span contribute zero to the dot, so sum_i indeg[i]*outdeg[i] equals the gather-sum regardless of gaps. Only the kernel's domain proof needs density — and it already does that itself. My builder was strictly tighter than the kernel it served.

Degrees now build over each edge partition's own endpoint span (already in hand from the per-type facts), bounded by the existing span cap.

Considered and rejected: per-label block intervals

Per-label intervals are dense on this board — and one shuffle un-denses every one of them. That's the generator's file layout, not a property of graphs; keying to it would flip the board while users see nothing. Owner called it what it is.

Probe (dev-container, labeled, not a receipt)

degree facts: 0 -> 5, consult engaged, values identical
q8@100k: 13.72 ms -> 2.84 ms

The receipted lane follows the merge; no verdict is claimed here.

Pins

Fixtures now interleave ids by default (block-contiguous fixtures are how 13 pins passed while the real board built nothing). The gapped-space pin flips from 'builds nothing' to 'builds and stays exact'. 29 pass, whole-tree mypy clean apart from the two pre-existing degrees.py errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi

lmeyerov and others added 3 commits August 11, 2026 23:05
…ement, not the math's

The builder refused gapped id spaces. Real node spaces are gapped (the board's
is: ids [1,107438], nunique 107434), so degree facts built on every fixture and
on ZERO real graphs -- answers stayed correct via the scan, so nothing failed. A
1-minute engagement probe caught it before a multi-hour lane receipted 'degrees
do not help' as a false negative.

Density is not required for the ARRAYS: ids absent from the span contribute zero
to the dot, so sum_i indeg[i]*outdeg[i] over the span equals the gather-sum
regardless of gaps. Only the kernel's DOMAIN proof needs density, and it already
does that itself. Degrees now build over each edge partition's own endpoint span
(from the per-type facts already in hand), bounded by the existing span cap.

Considered and REJECTED: per-label block intervals (dense per-label on this
board) -- one shuffle un-denses all of them; that is generator layout, not a
graph property, and keying to it would be benchmark hacking.

Probe on real board data, labeled dev-container, not a receipt: facts 0 -> 5,
consult engaged, values identical; q8@100k 13.72 -> 2.84ms. The receipted lane
follows the merge.

Fixtures now interleave ids by default; the gapped-space pin flips from
'builds nothing' to 'builds and stays exact'; 29 pins pass.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi
Review audit found two gaps. (1) The consult's span check had only its positive
side: nothing pinned that a fact covering a NARROWER span than the domain is
refused -- and using one would slice out of range and miscount. Now pinned
against the no-fact oracle. (2) The interleaved test's name went stale ('build
no facts') after the span fix; measured contract is facts BUILD (2), kernel does
NOT consult (its own dense-domain proof fails on scattered ids first), answer
correct -- all three now asserted, so a future change that makes scattered
domains provable flips the pin deliberately rather than silently.

Perf numbers audit: none in product code or tests; probe figures live in the
commit/PR text labeled dev-container, receipts owed to pyg-bench post-merge.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi
@lmeyerov
lmeyerov merged commit 25215ce into master Aug 12, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant