(not-to-merge) kicking the tires: dense subset sum in btsim#86
Draft
bc1cindy wants to merge 1 commit into
Draft
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wires the dense-subset-sum 4-path subset-sum/coinjoin-mapping counts (brute, radix, sparse, sasamoto) into btsim two ways:
WLowerBoundMetric(W lower bound via brute/sparse) andRadixMappingMetric(k×m!denomination mappings, gated by radix density) plug into the existingPrivacyBundle. With asubset_sum_threshold/radix_thresholdset inScorerConfig, each candidate plan is scored by a linear deficit to the threshold, so agents favor coinjoins with more subset-sum ambiguity.four_countsruns 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, akappa/Lsweep, aswitch_sweeplocating 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_allnow returnsNoneunless inputs cover the target; session contribution is gated on coverage).the metric is wired + unit-tested, but it doesn't yet steer the sim, emergent coinjoins are still sparse (same-seed runs are identical with the threshold on or off). Driving the sim to produce dense coinjoins is a separate work
BTSIM_CORRECTNESS=1 cargo run - 4 paths vs oracle, κ/L sweep, switch_sweep, CJA
BTSIM_FOUR_COUNTS=1 CONFIG_FILE=dense_small.toml cargo run - 4 paths over the sim's confirmed txs
related to #84