Skip to content

Weber vote-for-or-against-k: IC-coupled ballots (default) + optional uniform types#57

Draft
endolith wants to merge 1 commit into
masterfrom
cursor/weber-voa-extremal-strategy-c297
Draft

Weber vote-for-or-against-k: IC-coupled ballots (default) + optional uniform types#57
endolith wants to merge 1 commit into
masterfrom
cursor/weber-voa-extremal-strategy-c297

Conversation

@endolith

@endolith endolith commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

Rebased onto master (resolves conflicts from strategies package flatten in #47).

Adds Weber vote-for-or-against-k simulation support:

  • vote_for_or_against_k in elsim/strategies.py — each voter flips a fair coin, then either +1 on their top-k candidates by utility or -1 on their bottom-k (IC-coupled ballots; ties broken with jitter).
  • best_vote_for_or_against_k(m) — discrete search replacing round(alpha * m); fixes cases like m=91 → k=34.
  • Effectiveness table example — Monte Carlo SUE for best vote-for-or-against-k via combined_approval.
  • Benchmark script (examples/weber_voa_k_ballot_variants_benchmark.py) — compares repo strategy vs simultaneous ±, same-top XOR, uniform subset, and vote-for-k baseline against Weber's closed form.

Uniform-type ballots are demonstrated in the benchmark script (ballot_uniform_subset_coin); the exported API is the utility-ranked coin strategy only.

Verification

pip install -e ".[test,examples]"
ruff check . --select=E9,F63,F7,F82
pytest

All 221 tests pass.

Open in Web Open in Cursor 

@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.49%. Comparing base (14b8d55) to head (a969ece).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
+ Coverage   96.37%   96.49%   +0.12%     
==========================================
  Files          17       17              
  Lines         496      514      +18     
==========================================
+ Hits          478      496      +18     
  Misses         18       18              
Flag Coverage Δ
no-numba 95.91% <100.00%> (+0.14%) ⬆️
numba 88.52% <100.00%> (+0.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Rebase onto master after strategies package flatten (PR #47). Add
vote_for_or_against_k to elsim/strategies.py: fair coin between +1 on
top-k or -1 on bottom-k by utility rank (IC-coupled simulation).

- Discrete best_vote_for_or_against_k(m) search in weber_1977_expressions
- Effectiveness table example uses combined_approval + best k
- Ballot variant benchmark script compares MC SUE vs closed form
- Tests for ballot shape, invalid k, and fair-coin distribution

Co-authored-by: endolith <endolith@gmail.com>
@cursor cursor Bot force-pushed the cursor/weber-voa-extremal-strategy-c297 branch from 953507f to a969ece Compare June 12, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants