comparison · c_d59e1908ed6f (tommy-mor) vs c_5d4f3299fa6d (tommy-mor)
No judgments yet.
constitution · epochs · watch · epoch 4
tommy-mor · sha1:0e81b5e1958ca486bffe87c800cc68e389c9a810
Solve Rank Centrality exactly instead of capping power iteration. `compute_scores_from_edges` ran power iteration for at most 10 000 sweeps and returned whatever vector it had reached, with no signal when the cap bound. On a preference chain the spectral gap is Theta(1/n^2), so the cap binds past n ~= 1500 -- and worse, the L1 *step* tolerance is an absolute test, so on a 1024-node chain with mixed ratios it declared success after 4325 sweeps while leaving 486 of 1024 items at the wrong rank. A 1024-node star fails outright: it needs 14 154 sweeps. New `stationary` module owns every candidate solver -- power, Aitken-accelerated power, Gauss-Seidel/SOR, preconditioned BiCGSTAB, dense LU, dense GTH, and a sparse GTH state reduction with minimum-degree elimination -- behind one `solve` that splits disconnected components, tries the sparse direct path first (trees and chains reduce in O(n) with zero fill), and falls back to Gauss-Seidel then power iteration on the dense graphs elimination cannot help with. Every answer carries its own recomputed residual and a `converged` flag; nothing comes back claiming success it did not earn. Scores are also produced in log space. A chain of n items each preferred 2:1 spans 2^(n-1), which leaves the f64 range at n ~= 1075, so `pi` genuinely cannot order a long chain no matter how it is computed. `Solution::log_pi` stays exact there and is what `ranked_items_subset` now sorts on. Edges are sorted before aggregation, so the result no longer depends on `HashMap` iteration order. The legacy builder produced a different bit pattern on 7 of 7 rebuilds of the same graph; the sort costs ~10% of chain construction. Adds `benches/stationary_solvers.rs` (~80s) and `examples/solver_probe.rs` (~30s), which reports time, residual, and rank displacement against closed-form answers per topology. No new dependencies. Co-authored-by: Cursor <cursoragent@cursor.com>
No judgments yet.
The full patch is loaded only by the download route: download patch