feat(workers): representative density graph prototype + benchmark (ADR 0113 exploration) #1255
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/representative-density-graph-prototype"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Additive exploration companion to ADR 0113 (PR #1254) — implements decision V2 (graph construction) as an INERT prototype and measures it. No production behavior changes.
Contents (3 commits):
rep_graph_prototype.py—build_rep_graph()(U×U via production_density_graphcorrected tiles + rectangular U×R tile pass, same 192 MiB float32 budget, ISSUE-081 memory invariant; no L-blocks, no R×R; deterministic node order [U pool, R by (person_id, rep index)]) +partition_pool_groups()(components over U×U subgraph only) +RepGraphLayout. NOT registered in CLUSTERING_METHODS, no dispatch path.tests/test_rep_graph_prototype.py— 11 contract tests: node/label invariants, no R–R edges, inclusive threshold, identity separation, rep-edges-never-glue-components, determinism, degenerate inputs.experiments/rep_graph/benchmark.py+ README — seeded synthetic generator at production geometry; baseline (_density_graphover L+U) vs prototype.Measured results (synthetic, 512-dim, reps via production
_person_representatives@ 0.50):Computed pairs steady state: 78.1M → 342k (228×). Identity sanity: 100.0% known-person U faces adjacent to ≥1 own-person rep, 0.0% to foreign reps; same-mode U–U connectivity 100.0% (cross-mode fragments by threshold design — reps carry identity).
Test plan
.venv/bin/python -m pytest workers/people/tests/test_rep_graph_prototype.py -q→ 11 passedtest_semisupervised_v2_clustering.py(20 + 92 subtests) andtest_multi_representant.py(19) stay greenPYTHONPATH=workers/people/src .venv/bin/python workers/people/experiments/rep_graph/benchmark.pyThis PR can merge independently or together with #1254; it changes no production paths either way.
bf6da5ef112d1cd200e2