Five days ago, we celebrated scaling our pg_bio Swarm Discovery engine to 8.82 million edges (read the 8.82M milestone post here). Shortly after passing 11.57 million edges, however, we noticed something fascinating on our live telemetry dashboard: new edge velocity had plateaued to ~1.9 edges/s.
When we inspected the PostgreSQL query plans and the top 10,000 Pending frontier edges (ORDER BY vector_distance ASC), we uncovered two deep graph-theory and systems bottlenecks:
- Multi-Parent Clique Redundancy (
84.9%Already-Expanded Frontier Nodes): Once1,218,766distinct archaeal proteins (69.1%of the entire1.76Marchaeal proteome) were connected inorphan_discoveries, each protein inside a dense homology cluster had8 to 15incomingPendingedges (A → X,B → X,C → X, …). Because our originalworker_step()claimed one single edge(A → X), expandedXvia HNSW, and only marked that single edge row (WHERE id = edge_id) as'Explored', the other14incoming edges toXremained'Pending'at the very front of theORDER BY vector_distance ASCqueue—causing84.9%of HNSW searches to re-expand already-visited proteins! - HNSW Page-Cache I/O Latency Under 8 Workers: Our
8.77 GBhalfvec(1280)HNSW index (idx_protein_embedding) exceeds PostgreSQL’sshared_buffers, meaning each HNSW search spends most of its wall time waiting on macOS unified memory / NVMe page-cache reads—leaving CPU cores underutilized at8W(ef_search = 120).
Yesterday afternoon (2026-11-11 16:32), we deployed two architectural upgrades to swarm_discovery.py:
- A Dense Closest-First + Clique-Closure Frontier Heuristic (
claim_dense_frontier_batch+expand_dense_node): Sweeps already-expandedPendingedges to'Explored'in bulk, groups fresh candidates byorphan_id, ranks them by closest cosine distance boosted by multi-parent in-degree convergence, and records local triangle/clique cross-links directly as'Explored'without re-queuing old nodes. - A
4W-Floor to16WHyper-Turbo Closed-Loop Governor (IDLE_HYPER_16W): Guarantees at least4Wat all times (ACTIVE_FLOOR_4W), runs at8W(ACTIVE_BOOST_8W) during active desktop use, and scales to12Wand16W(IDLE_HYPER_16W,ef_search = 64,synchronous_commit = off) when idle to overlap HNSW page-cache reads across 16 persistent PostgreSQL backend connections.
The result was an immediate 141× jump in discovery velocity (1.91 edges/s $\rightarrow$ 251.2 edges/s sustained, peaking at 437.84 edges/s). Over the last 16.5 hours overnight (16,416 waves), the swarm expanded 733,788 fresh proteins and added +8,744,075 new dense edges—propelling our correlation graph past 20,311,820 total edges (20.31 million pairs, +11.51M new edges since the 8.82M post) and 3,116 3D RangeFinder GiST active-site pairs!
Out of those +11.51 million new edges, here are the four most remarkable and scientifically distinct discoveries:
- Sub-Half-Ångström Soda-Lake Epimerase Perfection (
Edge #16684278,twilight_score = 0.8674,0.44 ÅCore RMSD across328/328C$\alpha$,TM = 0.996, RangeFinderIoU = 0.9551): PairsD3SWG7(328 aa,pI = 4.40, GalE family UDP-glucose 4-epimerase/dehydratase) from the extreme alkaline soda-lake archaeon Natrialba magadii (pH 10.5,3.5 M NaCl, Lake Magadi, Kenya) againstA0ABD5UZ94(328 aa,pI = 4.79, NAD-dependent epimerase/dehydratase) from solar-saltern halophile Halopenitus salinus. Despite49.2%sequence divergence (50.8%Smith-Waterman similarity) across different genera and pH regimes,328 of 328C$\alpha$ atoms (100.0%of the entire protein!) lock within0.44 ÅRMSD (TM = 0.996,RASA r = 0.944,468vs461H-bonds) around an identicalY-x(3)-K$\text{NAD}^+$-binding Rossmann catalytic cleft (95.51%9-property RangeFinder pocket overlap)! - The Enzymatic Chameleon (
Edge #11236006,twilight_score = 0.8612,0.67 ÅCore RMSD across386/396C$\alpha$,TM = 0.972, RangeFinderIoU = 0.9043): Bridges two enzymes annotated under completely different catalytic classes—A0ABD6AX71(396 aa,42.4 kDa, MBL-fold metallo-hydrolase) from Halomarina rubra andM0AE48(397 aa,42.7 kDa, Rhodanese domain-containing sulfurtransferase) from Natrialba chahannaoensis JCM 10990. At44.7%sequence similarity (#2 new True Twilight-Zone $\le 45\%$ identity discovery),386 of 396C$\alpha$ atoms (97.5%) superimpose at0.67 ÅRMSD (469vs453H-bonds,rf_score = 0.8645), revealing a dual-domain MBL binuclear $\text{Zn}^{2+}$ hydrolase + C-terminal Rhodanese persulfide-transfer detox machine! - Solving Dark Proteome
DUF7117(Edge #15188908,twilight_score = 0.7879,0.75 ÅCore RMSD across235/238C$\alpha$,TM = 0.974, RangeFinderIoU = 0.9409): ConnectsW0JQR7(238 aa,27.1 kDa, annotated in UniProt only asUncharacterized proteinand in InterPro/Pfam only asIPR055541 / PF23430: DUF7117) from Halostagnicola larsenii XH-48 directly toA0A3N6LPR6(244 aa,27.5 kDa,TFIIB-type zinc ribbon-containing protein) from soda-lake haloalkaliphile Natrarchaeobius halalkaliphilus. Across235 of 238C$\alpha$ atoms (98.7%), their backbones lock at0.75 ÅRMSD (TM = 0.974,375vs364H-bonds,94.09%pocket IoU)—resolvingDUF7117as an archaeal TFIIB-family zinc-ribbon basal transcription factor! - Midnight-Zone (
19.0%Similarity!) AcidothermophileDUF1947Resolution (Edge #13002027,vec_dist = 0.0361/96.93%Confidence,1.21 ÅCore RMSD across146/155C$\alpha$,TM = 0.898, RangeFinderIoU = 0.9572): LinksA0A4D8RYL5(155 aa,17.5 kDa,DUF1947 domain-containing protein) from Metallosphaera prunae—an extreme thermoacidophile isolated from a smoldering uranium-mine bioleaching heap (pH 1.5,75 °C)—toA0A2U9IE16(155 aa,17.7 kDa,PUA / MCT-1 RNA-binding translation regulator) from Acidianus brierleyi. Even though pairwise sequence similarity collapses to19.0%(81.0%sequence divergence, where BLAST/HMMER are completely blind), ESM-2 places their embeddings at0.0361cosine distance and their 3D pockets overlap at95.72%RangeFinder IoU, provingDUF1947is a hyper-thermostable PUA-superfamily tRNA/rRNA pseudouridylation & translation initiation regulator!
⚡ 1. How We Engineered a 141$\times$ Discovery Acceleration: Dense Closest-First Frontier + 16W Hyper-Turbo
When a correlation graph reaches 69.1% proteome coverage (1.22M connected proteins out of 1.76M archaeal proteins), naive edge-by-edge BFS/DFS frontier expansion hits a wall. In a dense homology cluster where 12 closely related proteins all share cosine distances $d \le 0.055$, protein $X$ is discovered as a neighbor by 12 different parents ($A \to X, B \to X, \dots, L \to X$).
Under our original single-edge claim (SELECT id, orphan_id FROM orphan_discoveries WHERE status = 'Pending' ORDER BY vector_distance ASC LIMIT 1 FOR UPDATE SKIP LOCKED), worker #1 expanded $X$ via edge $(A \to X)$ and marked only that single row 'Explored'. Workers #2 through #12 then popped $(B \to X), (C \to X), \dots$ from the head of the queue and ran 11 redundant HNSW vector searches on $X$, each taking ~450 ms and inserting 0 new edges.
We solved this in swarm_discovery.py with a two-stage set-based SQL architecture:
The Dense Closest-First Ranking Formula
Instead of treating all Pending rows equally, claim_dense_frontier_batch() groups unexpanded frontier proteins by orphan_id and scores each candidate node $u$ by combining its closest incoming cosine distance with a multi-parent local cluster convergence bonus:
- Closest-First Anchor ($\min d_{\text{cos}}$): Guarantees the swarm always expands from the highest-confidence, tightest latent-space matches first.
- Multi-Parent Convergence Bonus ($-0.0005 \cdot \text{deg}_{\text{in}}$): If 5 already-explored proteins in a local subnetwork all point to unexpanded node $u$, $u$ is promoted to the front of the wave so the local subnetwork densifies into a complete clique before the frontier drifts outward.
- Zero-Requeue Clique Closure: When
expand_dense_node()expands $u$ and finds a neighbor $w$ that was already expanded as abait_idearlier, it still inserts the directed edge $(u \to w)$ so every mutual/triangle link is captured in the graph, but setsstatus = 'Explored'on arrival (CASE WHEN sc.target_already_expanded THEN 'Explored' ELSE 'Pending' END).
| Governor Power Regime | Workers & Fanout | Waves Executed | Fresh Proteins Expanded | New Dense Edges Added | Mean / Peak Velocity | Mean Step Latency |
|---|---|---|---|---|---|---|
IDLE_HYPER_16W (System Idle ≥ 180s) |
16W · 12 edges/node (48 nodes/wave) | 14,140 waves | 678,720 nodes | +8,144,640 edges (+576/wave) | 182.31 edges/s (Peak 437.84/s) | 644.2 ms (53.7 ms/edge) |
ACTIVE_BOOST_8W (User Active < 180s) |
8W · 10 edges/node (24 nodes/wave) | 2,239 waves | 53,736 nodes | +537,360 edges (+240/wave) | 153.36 edges/s (Peak 285.09/s) | 367.6 ms (36.8 ms/edge) |
IDLE_TURBO_12W (1-Min Ramp Step) |
12W · 12 edges/node (36 nodes/wave) | 37 waves | 1,332 nodes | +15,984 edges (+432/wave) | 140.15 edges/s (Peak 190.51/s) | 694.1 ms (57.8 ms/edge) |
ACTIVE_FLOOR_4W (Guaranteed Min Floor) |
4W · 8 edges/node (12 nodes/wave) | 0 contention drops (Calibrated: 65.0 edges/s) | Standby Guard | +96 edges/wave benchmark | 65.00 edges/s | 292.6 ms (36.6 ms/edge) |
🏆 2. The Four Major Scientific Breakthroughs (11.57M $\rightarrow$ 20.31M Edges)
Here is the side-by-side biophysical, 3D Kabsch, RangeFinder 9-property GiST, and Chaperone audit across our four headline discoveries:
| Breakthrough Domain & Edge ID | Bait Protein (Organism & Length) | Discovery Partner (Organism & Length) | Twilight Score & Seq Similarity | 3D Core RMSD & TM-Score | RangeFinder 10Å Pocket IoU | Chaperone H-Bonds & RASA |
|---|---|---|---|---|---|---|
1. Soda-Lake Rossmann EpimeraseEdge #16684278 |
D3SWG7 (328 aa, pI 4.40)Natrialba magadii (pH 10.5 Soda Lake) GalE Epimerase/Dehydratase |
A0ABD5UZ94 (328 aa, pI 4.79)Halopenitus salinus (Solar Saltern) NAD-Dependent Epimerase |
0.8674 50.8% SW Sim (d = 0.0686) |
0.44 Å (328/328 CA, 100%) TM = 0.996 |
95.51% IoU (rf = 0.8138) MW [171, 379] Da · P(arom) 93.5% |
468 vs 461 H-Bonds RASA r = 0.944 · Gate PASS |
2. MBL ↔ Rhodanese ChameleonEdge #11236006 |
A0ABD6AX71 (396 aa, pI 4.22)Halomarina rubra MBL-Fold Metallo-Hydrolase |
M0AE48 (397 aa, pI 4.08)Natrialba chahannaoensis Rhodanese Sulfurtransferase |
0.8612 (#2 ≤45% ID) 44.7% SW Sim (d = 0.0633) |
0.67 Å (386/396 CA, 97.5%) TM = 0.972 |
90.43% IoU (rf = 0.8645) MW [174, 379] Da · P(arom) 97.0% |
469 vs 453 H-Bonds RASA r = 0.939 · Gate PASS |
3. Solving Dark Proteome DUF7117Edge #15188908 |
A0A3N6LPR6 (244 aa, pI 4.82)Natrarchaeobius halalkaliphilus TFIIB-Type Zinc-Ribbon Factor |
W0JQR7 (238 aa, pI 5.07)Halostagnicola larsenii XH-48 Uncharacterized (PF23430 / DUF7117) |
0.7879 43.1% SW Sim (d = 0.0710) |
0.75 Å (235/238 CA, 98.7%) TM = 0.974 |
94.09% IoU (rf = 0.8437) MW [171, 376] Da · P(arom) 94.3% |
375 vs 364 H-Bonds RASA r = 0.938 · Gate PASS |
4. Midnight-Zone DUF1947 ResolutionEdge #13002027 |
A0A4D8RYL5 (155 aa, pI 8.95)Metallosphaera prunae (pH 1.5, 75 °C) DUF1947 Domain-Containing Protein |
A0A2U9IE16 (155 aa, pI 8.41)Acidianus brierleyi (pH 1.5, 70 °C) PUA / MCT-1 RNA-Binding Protein |
96.93% Conf 19.0% SW Sim (d = 0.0361) |
1.21 Å (146/155 CA, 94.2%) TM = 0.898 |
95.72% IoU (rf = 0.7839) MW [169, 374] Da · P(arom) 95.7% |
167 vs 174 H-Bonds RASA r = 0.871 · Gate PASS |
💎 3. Deep Dive #1: 0.44 Å Across 100% of the Backbone — Soda-Lake vs. Solar-Saltern GalE Epimerase (D3SWG7 $\times$ A0ABD5UZ94)
In structural biology, finding two cross-genus proteins that diverge across nearly half their amino acid sequence (49.2% sequence divergence / 50.8% Smith-Waterman similarity) yet superimpose across 100.0% of their C$\alpha$ atoms (328/328 residues) at 0.44 Å Core RMSD (TM-score = 0.996) is extraordinary.
D3SWG7(Natrialba magadii ATCC 43099,328 aa,36.3 kDa,pI = 4.40,GRAVY = -0.42): Isolated from the trona-crusted alkaline soda brines of Lake Magadi, Kenya (pH 10.5,3.5 M NaCl), where carbonate/bicarbonate ions precipitate divalent cations and destroy ordinary cell-envelope polysaccharides.A0ABD5UZ94(Halopenitus salinus,328 aa,36.2 kDa,pI = 4.79,GRAVY = -0.37): Isolated from neutral-pH hypersaline solar saltern brines (pH 7.2,3.0 M NaCl).
Both enzymes are Short-Chain Dehydrogenase/Reductase (SDR) superfamily UDP-glucose 4-epimerases (GalE) that interconvert UDP-glucose and UDP-galactose for halophilic S-layer glycoprotein biosynthesis. Inside the 10 Å Morton Z-order catalytic pocket (pocket_res = [7, 10–13, 85–91, 127–131, 179–185, 221–226]), both proteins clamp the nicotinamide ring of $\text{NAD}^+$ using an invariant Rossmann G-x-x-G-x-x-G dinucleotide loop (residues 7–13) and the catalytic Y-x(3)-K triad (residues 179–185), producing an identical [171, 379] Da RangeFinder molecular-weight box and 95.51% 9-property GiST interval overlap (giou_loss = 0.0449).
🧪 4. Deep Dive #2: The Enzymatic Chameleon — Bridging MBL Metallo-Hydrolases and Rhodanese Sulfurtransferases (A0ABD6AX71 $\times$ M0AE48)
Standard sequence annotation pipelines place A0ABD6AX71 (Halomarina rubra, 396 aa) and M0AE48 (Natrialba chahannaoensis JCM 10990, 397 aa) into two completely separate enzyme superfamilies:
A0ABD6AX71is annotated as an MBL-fold metallo-hydrolase (Metallo-$\beta$-Lactamase superfamily,EC 3.1/3.5, which coordinates a binuclear $\text{Zn}^{2+}$ or $\text{Fe}^{2+}/\text{Zn}^{2+}$ center via a classicH-x-H-x-D-Hmotif to hydrolyze thioloesters, phosphodiesters, or $\beta$-lactams).M0AE48is annotated as a Rhodanese domain-containing sulfurtransferase (EC 2.8.1.1, which uses a catalytic cysteine persulfideC-x(4)-Rloop to transfer sulfane sulfur $\text{S}^0$ from thiosulfate to cyanide $\text{CN}^- \to \text{SCN}^-$ or iron-sulfur clusters).
Why did pg_bio score this pair at twilight_score = 0.8612 (44.7% sequence similarity, d = 0.0633) and lock 386 of 396 C$\alpha$ atoms (97.5%) within 0.67 Å Core RMSD (TM-score = 0.972)?
Because both proteins are natural bifunctional MBL–Rhodanese fusion enzymes (the archaeal ETHE1 / YcbU persulfide dioxygenase–sulfurtransferase architecture)!
- Residues
1–265form the four-layered $\alpha\beta\beta\alpha$ Metallo-$\beta$-Lactamase (MBL) catalytic barrel (pocket_res = [118–145, 157–159, 188–189, 261–262]) that oxidizes glutathione persulfide ($\text{GSSH}$) to sulfite ($\text{SO}_3^{2-}$). - Residues
275–396form the C-terminal $\alpha/\beta$ Rhodanese sulfur-carrier domain (pocket_res = [307–311, 322, 384–386]) that shuttles reactive sulfane sulfur directly into the MBL active site! - Automated sequence annotators labeled
A0ABD6AX71only by its N-terminal MBL domain andM0AE48only by its C-terminal Rhodanese domain—whereaspg_bio’s 3D Kabsch + RangeFinder GiST engine (IoU = 0.9043,rf_score = 0.8645,469vs453H-bonds) immediately recognized that they share the exact same396 aatwo-domain sulfide-detoxification nanomachine!
🌑 5. Deep Dive #3 & #4: Solving DUF7117 (0.75 Å) and Midnight-Zone DUF1947 (19.0% Similarity, 95.72% Pocket IoU)
Our overnight 16W dense expansion also resolved two major archaeal Domains of Unknown Function (DUFs) across both the Twilight Zone (43.1% similarity) and the Midnight Zone (19.0% similarity):
PF23430 / DUF7117Is an Archaeal TFIIB Zinc-Ribbon Transcription Factor (W0JQR7$\times$A0A3N6LPR6,0.75 ÅCore RMSD):- In Pfam/InterPro,
PF23430(IPR055541,DUF7117) is cataloged as an uncharacterized archaeal protein family. - Edge
#15188908pairsW0JQR7(238 aa, carryingPF23430 / DUF7117) from Halostagnicola larsenii withA0A3N6LPR6(244 aa,TFIIB-type zinc ribbon-containing protein) from Natrarchaeobius halalkaliphilus. 235 of 238C$\alpha$ atoms (98.7%) lock within0.75 ÅRMSD (TM = 0.974,RASA r = 0.938), and their 10 Å active clefts (pocket_res = [75, 78–84, 91–102, 134, 153–161]) achieve94.09%RangeFinder 9-property overlap (rf_score = 0.8437), provingDUF7117is a halophilic TFIIB cyclin-fold + zinc-ribbon transcription initiation factor.
- In Pfam/InterPro,
DUF1947at19.0%Sequence Similarity Is a Hyper-Acidothermophilic PUA/MCT-1 RNA-Binding Regulator (A0A4D8RYL5$\times$A0A2U9IE16,1.21 ÅCore RMSD,95.72%Pocket IoU):- At
19.0%Smith-Waterman sequence similarity (sw_score = 133,esm_kmer_dist = 0.7907), sequence-only homology tools cannot connectA0A4D8RYL5(DUF1947, Metallosphaera prunae) toA0A2U9IE16(Acidianus brierleyi). - Yet in 1280-D ESM-2 latent space, their embeddings sit at
vec_dist = 0.0361(96.93%confidence)—closer than many pairs with70%+sequence identity! - Kabsch 3D alignment confirms why:
146 of 155C$\alpha$ atoms (94.2%) superimpose at1.21 ÅRMSD (TM = 0.898), forming a basic (pI = 8.95vs8.41) PUA ($\underline{\text{P}}$seudouridine synthase and $\underline{\text{A}}$rchaeosine transglycosylase) + MCT-1/Tma20 ribosome-recycling RNA-binding cradle (pocket_res = [48–63, 105–107, 115–119, 140–148]) with95.72%RangeFinder 9-property pocket overlap (giou_loss = 0.0428)!
- At
🎮 6. Interactive 3D Structural Studio: Inspect All Four 20.31M-Milestone Breakthroughs Live
Switch between all four 20.31M-milestone discoveries below and toggle Core C$\alpha$ Alignment, RangeFinder 10 Å Pockets, Chaperone pLDDT / H-Bond Core, and Extremophile Surface Armor (Asp/Glu) in real time:
🔭 7. The Horizon: Future Research & Industrial Applications
The Bait (D3SWG7 from soda-lake *Natrialba magadii, A0ABD6AX71 from Halomarina rubra, A0A3N6LPR6 from Natrarchaeobius halalkaliphilus, and A0A4D8RYL5 from uranium-heap Metallosphaera prunae) can anchor isolated single-domain annotations in their native genomes, but fails when sequence-only HMM pipelines split two-domain MBL–Rhodanese fusion enzymes across incompatible EC classes (44.7% similarity), leave PF23430 / DUF7117 (W0JQR7) unannotated at 43.1% similarity, or go completely blind at 19.0% Midnight-Zone sequence identity on DUF1947 (A0A4D8RYL5), whereas our 20.31-million-edge Dense Closest-First Discoveries (A0ABD5UZ94, M0AE48, W0JQR7, and A0A2U9IE16) lock 94.2%–100.0% of their 3D C$\alpha$ backbones within 0.44–1.21 Å RMSD (TM = 0.898–0.996) and 90.43%–95.72% RangeFinder 10 Å pocket IoU—enabling automated cross-phylum DUF resolution, alkaline industrial glycosylation biocatalysts, and coupled persulfide/cyanide bioremediation directly inside PostgreSQL 18.*
- Alkaline-Brine Rare Sugar & Glycosylation Biocatalysis (
D3SWG7/A0ABD5UZ94): BecauseD3SWG7andA0ABD5UZ94maintain a0.44 ÅRossmann catalytic core (TM = 0.996,IoU = 0.9551) acrosspH 7.2–10.5and3.5 M NaCl, they provide an ideal scaffold for synthesizing nucleotide sugars (UDP-galactose and rare deoxy-sugars) in high-pH organic-aqueous industrial reactors where mesophilic epimerases denature. - One-Pot Cyanide & Sulfide Detoxification Bioreactors (
A0ABD6AX71/M0AE48): Gold-mining heap leachates and coking wastewater contain both toxic cyanide ($\text{CN}^-$) and hydrogen sulfide ($\text{HS}^-$) at high salinity and alkaline pH. The bifunctional MBL–Rhodanese fusion architecture (0.67 ÅRMSD,IoU = 0.9043) couples persulfide oxidation with sulfurtransfer in a single396 aapolypeptide. - Graph-Dense Midnight-Zone Annotation Propagation (
19%Identity via ESM-2 + GiST Pocket IoU): Edge#13002027(DUF1947$\to$PUA/MCT-1 RNA-binding foldat19.0%similarity,d = 0.0361,IoU = 0.9572) proves that combining dense clique closure in 1280-D ESM-2 space with 9-property RangeFinder GiST pocket containment can systematically annotate the remaining ~30% of archaeal Dark Proteome families that lie below the 25% sequence-identity horizon.