Add radix-ness classifier as first step of the radix lower-bound path#85
Add radix-ness classifier as first step of the radix lower-bound path#85bc1cindy wants to merge 2 commits into
Conversation
|
also related with #5 |
arminsabouri
left a comment
There was a problem hiding this comment.
Couple questions to start with. Im curious how this will be used in the simulations. I may take a stab at integrating some of this
Wires the dense-subset-sum 4-path subset-sum/coinjoin-mapping counts (brute, radix, sparse, Sasamoto) into btsim two ways: - As agent cost: WLowerBoundMetric (W lower bound via brute/sparse) and RadixMappingMetric (k×m! denomination mappings, gated by radix density) plug into the existing PrivacyBundle. With a subset_sum_threshold / radix_threshold set in ScorerConfig, each candidate plan is scored by a linear deficit to the threshold, so agents favor coinjoins with more subset-sum ambiguity. - As measurement: four_counts runs all four paths over the sim's confirmed txs recording CPU, peak RAM (alloc-probe feature), and density regime (kappa via the L bracket). Plus a correctness benchmark against the dep's oracle, a kappa/L sweep, a switch_sweep locating the sparse->Sasamoto handoff, and a CJA comparison (W vs Maurer sub-transaction mappings). Adds denominated funding (standard-denomination UTXOs in a band, via mine_denominated) so the sim can produce dense coinjoins, and fixes a latent over-spend in coin selection that the dense funding exposed (select_all now returns None unless inputs cover the target; session contribution is gated on coverage). Exploration on the fork (review-only) - distinct from the native radix metric of payjoin#84/payjoin#85. rustfmt + clippy clean.
bc1cindy
left a comment
There was a problem hiding this comment.
thanks for the review @arminsabouri
Im curious how this will be used in the simulations.
test and measure benchmarks from the simulations of the four primitives: brute force / radix / sparse convolution / Sasamoto , who are competing/complementary, with two asymmetries worth stating:
brute,radixandsparseare guaranteed lower bounds whileSasamotois an approximation- radix is the cheap, pre computable shortcut for the standard-denomination special case (it avoids solving subset-sum at all), whereas brute and sparse are the ones with real cost/limits. So in the sim we run them in parallel with guards(brute aborts before the exponential blow-up; sparse stops once the sumset table exceeds a RAM budget) and characterize each on two axes - correctness (matches the exact brute/DP count? lower bound holds? Sasamoto error?) and cost (CPU time, peak RAM). That's what lets us later compose them into per-actor profiles (a maker can spend minutes/GB; a mobile client can't) and pick the regime-switch points.
please take a look at #86, it will be better to see it
I may take a stab at integrating some of this
sounds great!
bc1cindy
left a comment
There was a problem hiding this comment.
removed max_gap/max_combination_value/sumset from this PR, keeping just the per-series multiplicities. the gap/density check can come back with the lower-bound consumer
the radix path applies when amounts decompose into Hamming-weight-1 denominations in complementary bases (2, 3, 10). geometric progressions with non-trivial multiplicity in those bases generate dense subset-sum instances, which let the number of valid sub-transaction mappings be lower-bounded cheaply
this PR delivers a classifier that, given a tx's input and output amounts, returns per-series multiplicity counts
primitives vendored from small hamming weight denominations for coinjoins. Consts and generators match the notebook
the gap/density check is deferred to the lower-bound consumer that uses it
part of #84