You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core-engineModifications to the central physics and parsing engineenhancementNew feature, sensor, or structural signaturemetricsHeuristics, risk exposures, and topological math updatesperformance
Reproduce random.Random(42).sample(list(nodes), k), heapq Dijkstra with the insertion counter and exact-float tie handling, _accumulate_basic, and _rescale for the sampled and unsampled directed cases.
Parallel sources with fixed-order reduction.
Acceptance criteria
Parity at 6 dp with networkx for V ≤ 500 and for the sampled V > 500 case
Beats 85 ms on the crucible graph
Relevant baseline
operation
networkx
notes
betweenness k=100 seed=42
84.9 ms
Networkx conventions to match
Sample is random.Random(42).sample(list(G.nodes()), k), since py_random_state wraps an int seed in random.Random
Weighted Brandes: _single_source_dijkstra_path_basic pushes (dist, next(count), pred, v) on a heapq
Equal-length paths are counted when vw_dist == seen[w] (exact float equality)
sigma starts at 0.0, and 1.0 for the source
Accumulation: _accumulate_basic
Rescale (_rescale, directed, normalized=True, endpoints=False): N = n-1
Unsampled: scale = 1/(K_source*(N-1))
Sampled: per-node scale_source = 1/((K_source-1)*(N-1)) for v in the sample, and scale_nonsource = 1/(K_source*(N-1)) otherwise
Revised by the tailoring decisions on #3033 (2026-09-14). This supersedes the "networkx-compatible seeded sampler" scope.
Exact betweenness at every size. No sampling: sampling found 11 nonzero files vs 78 exact on crucible, and read 14 of the exact top-20 choke points as 0.
Hop count, not weight-as-distance. networkx interprets weight as distance, which made entity imports longer paths. So this is an unweighted BFS Brandes: no Dijkstra, and no sampler or _rescale k-branch to reproduce.
Speed:
skip sources with no outgoing import
parallel sources with a fixed-order reduction, so the result is bit-deterministic regardless of worker count
core-engineModifications to the central physics and parsing engineenhancementNew feature, sensor, or structural signaturemetricsHeuristics, risk exposures, and topological math updatesperformance
Activity
squid-protocol commentedon Sep 14, 2026
Revised by the tailoring decisions on #3033 (2026-09-14). This supersedes the "networkx-compatible seeded sampler" scope.
Exact betweenness at every size. No sampling: sampling found 11 nonzero files vs 78 exact on crucible, and read 14 of the exact top-20 choke points as 0.
Hop count, not weight-as-distance. networkx interprets
weightas distance, which made entity imports longer paths. So this is an unweighted BFS Brandes: no Dijkstra, and no sampler or_rescalek-branch to reproduce.Speed:
The number to beat is networkx's exact-weighted 1,560 ms on crucible.
Oracle:
nx.betweenness_centrality(G)(exact, unweighted, normalized, directed).Acceptance:
[-]Native graph engine: betweenness (weighted Brandes + networkx-compatible seeded sampler)[/-][+]Native graph engine: exact betweenness (hop-count BFS Brandes, every repo size)[/+]Native graph engine: exact hop-count betweenness at every size (#3038)
test: re-bless golden masters for #3038 (exact hop-count betweenness)
Native graph engine: exact hop-count betweenness at every size (#3038) (