Skip to content

perf(gfql): dense two-hop count round 3 — elide second bincount via gather-sum identity - #1851

Merged
lmeyerov merged 3 commits into
masterfrom
perf/gfql-q8-dense-r3
Aug 5, 2026
Merged

perf(gfql): dense two-hop count round 3 — elide second bincount via gather-sum identity#1851
lmeyerov merged 3 commits into
masterfrom
perf/gfql-q8-dense-r3

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1847 (round 2). ONE algebraic change to the proof-gated dense-domain kernel, values identical by construction:

Elision of the second degree table: sum_b indeg(b)*outdeg(b) = sum_e indeg(src(e)) — each middle node contributes its in-degree once per out-edge — so the out-degree bincount and the aligned product-sum collapse into a single gather-sum of in-degrees at each edge's source. Exactly one O(E) bincount remains, on every backend (on cupy this also drops a kernel launch). No new guards, no new state, no concurrency.

The host-threading variant measured alongside this was split out to draft #1852 pending the owner's call on library-owned thread pools; this PR is the thread-free core.

Testing: T6 mechanism-spy pins moved to the one-bincount shape (shift-elision, scratch-buffer, mixed-dtype, both budget-boundary sides); new degree-product oracle pin on duplicate-heavy random graphs covering both the raw and shifted lanes. mypy clean; no new casts.

Measured effects and verdicts live with the receipted lanes in pyg-bench (r3 candidate lanes in progress) and the docs board.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi

…gather-sum identity

sum_b indeg(b)*outdeg(b) = sum_e indeg(src(e)): the out-degree bincount
and aligned product-sum collapse into one gather-sum of in-degrees at
each edge's source. One O(E) bincount remains on every backend (cupy
also drops a kernel launch). No new guards, no new state. Spy pins
moved to the one-bincount shape; new degree-product oracle pin covers
raw and shifted lanes on duplicate-heavy random graphs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi
@lmeyerov
lmeyerov force-pushed the perf/gfql-q8-dense-r3 branch from 54ae25b to 3b01773 Compare August 5, 2026 21:36
@lmeyerov lmeyerov changed the title perf(gfql): dense two-hop count round 3 — elide second bincount, host-thread O(E) passes perf(gfql): dense two-hop count round 3 — elide second bincount via gather-sum identity Aug 5, 2026
Same owner rule as #1846: claims live in pins (one-bincount spy shapes,
degree-product oracle, budget-boundary both-sides), not comment prose.
Comment/docstring-only change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF7uRZLKZaD6Q9FGWSmyXi
@lmeyerov
lmeyerov changed the base branch from perf/gfql-q8-bincount-r2 to master August 5, 2026 22:55
@lmeyerov
lmeyerov marked this pull request as ready for review August 5, 2026 23:19
@lmeyerov
lmeyerov merged commit 08182e9 into master Aug 5, 2026
70 of 101 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