12/23/2025
cd <devhome>
git clone https://github.com/JohnLCaron/rlauxe.git
cd rlauxe
To do a clean build (no tests):
cd <devhome>/rlauxe
./gradlew clean assemble
Normally rlauxe-vierer keeps the current rlauxe library inside its own repo. However, if the library has changed on github and you need to rebuild it:
cd <devhome>/rlauxe
git fetch origin
git rebase -i origin/main
Then rebuild the code:
./gradlew clean assemble
Before running the tests, go to the source file core/src/testFixtures/kotlin/org/cryptobiotic/rlauxe/TestUtils.kt. At the top of the file, change the line:
val testdataDir = "/home/stormy/rla"
to some directory on your system. Make sure the directory exists.
To build the complete library and run the core tests:
cd <devhome>/rlauxe
./gradlew clean assemble
./gradlew core:test
To run a subset of tests in cases:
cd <devhome>/rlauxe
./gradlew :cases:test --tests "org.cryptobiotic.util.*"
We recommend using the IntelliJ IDE if you plan on doing Java/Kotlin coding, or even if you are just building and running.
Start up IntelliJ, and in the top menu:
IntelliJ will create and populate an IntelliJ project with the rlauxe sources.
To build the library, from the topmenu: Build / Build Project (Ctrl-F9)
To run the core tests, from the left Project Panel source tree, navigate to the core/src/test/kotlin/org/cryptobiotic/rlauxe directory, right click on the directory name, choose “Run tests in …”. If that menu option isnt shown, check if you’re in the main source tree instead of the test source tree.
To run individual tests, go to the test source; IntelliJ will place a clickable green button in the left margin wherever there is a runnable test.
There’s lots of online help for using IntelliJ.
The repo contains all the test case data, except for San Francisco. Download
https://www.sfelections.org/results/20241105/data/20241203/CVR_Export_20241202143051.zip
into testdataDir/cases/sf2024/ (where testdataDir is as you chose in the “Set the test data directory” step above)
Then run createSf2024CvrExport() test in cases/src/test/kotlin/org/cryptobiotic/rlauxe/sf/CreateSf2024CvrExport.kt to generate testdataDir/cases/sf2024/crvExport.csv. This only needs to be done one time.
All the test cases can be generated from:
cases/src/test/kotlin/org/cryptobiotic/util/TestGenerateAllUseCases.kt.
Run the verifier on all the gnerated test cases:
cases/src/test/kotlin/org/cryptobiotic/util/TestVerifyUseCases.kt.
Download the rlauxe-viewer repo and follow instructions there to view Audit Records and run audits on them, in particular, on any of the test cases.
Caveat Emptor: The serialization formats are undergoing rapid changes, with no backwards compatibility (yet). Expect that if you download a new version of the library, you will possibly have to regenerate any audit records (including tests cases), before viewing them.
core test coverage
| date | pct | cover/total LOC |
|---|---|---|
| 11/20/2025 | 84.0 % | 5602/6667 |
| 11/25/2025 | 85.2 % | 5229/6136 |
| 11/28/2025 | 85.9 % | 5188/6039 |
| 11/29/2025 | 86.3 % | 5208/6034 |
| 11/30/2025 | 86.7 % | 5255/6058 |
| 12/04/2025 | 85.0 % | 5327/6265 |
| 12/10/2025 | 80.5 % | 5338/6634 |
| 12/13/2025 | 82.8 % | 5341/6449 |
| 12/18/2025 | 83.9 % | 5332/6357 |
| 12/23/2025 | 83.9 % | 5393/6431 |
core + cases test coverage
| date | pct | cover/total LOC |
|---|---|---|
| 11/28/2025 | 79.3 % | 6417/8094 |
| 11/29/2025 | 79.6 % | 6434/8087 |
| 11/29/2025 | 81.4 % | 6479/7962 |
| 12/04/2025 | 81.7 % | 6530/7994 |
| 12/10/2025 | 78.4 % | 6597/8412 |
| 12/13/2025 | 80.7 % | 6606/8187 |
| 12/23/2025 | 81.0 % | 6634/8186 |
last changed: 03/10/2025
//////////////////////////////////////////// Simulation
Production
Estimation
Polling: ContestSimulation.simulateCvrsDilutedMargin(contestRound.contestUA, config) ContestSimulation(contestOrg, contestUA.Npop).makeCvrs() else ContestSimulation(contestScaled, sNb) // could we use PollingCardFuzzSampler ??
Clca: ClcaCardFuzzSampler(config.simFuzzPct ?: 0.0, contestCards, contestUA.contest, cassorter) // for one contest, this takes a list of cards and fuzzes them for the mvrs
OneAudit: OneAuditVunderBarFuzzer.makePairsFromCards(contestCards) // fuzz cvrs, leave pools alone i think
OneAuditVunderBarFuzzer // uses primitives in SamplingForEstimation // simulate pooled data from the pool values; (not sure about IRV) VunderBar = simulate pooled data Votes and Undervotes for multiple OA Pools VunderPool = Votes and Undervotes for one OA Pool Vunder = Votes and Undervotes for one OA contest
// combines Vunder for multiple contests into cvrs for one pool
// make cvrs until we exhaust the votes
// this algorithm puts as many contests as possible on each cvr
// the number of cvrs can vary when there are multiple contests
fun makeVunderCvrs(vunders: Map<Int, Vunder>, poolName: String, poolId: Int?): List<Cvr>
Auditing
for a real audit, so simulation is used:
// the sampleMvrsFile is added externally for real audits, and by MvrManagerTestFromRecord for test audits
open class PersistedMvrManager(val auditDir: String, val config: AuditConfig, val contestsUA: List<ContestUnderAudit>, val mvrWrite: Boolean = true): MvrManager {
Testing
(or)
(or)
(or)
// used for singleRoundAudit
Other Testing
testFixtures
MultiContestTestData: specify the contests with range of margins, phantoms, undervotes, phantoms, single poolId, poolPct
used by RunRlaStartFuzz (Polling, Clca)
MultiContestCombineData: specify the contests with exact number of votes
OneAuditTest : One OA contest
makeOneAuditTestContests: multiple OA contests
used by RunRlaCreateOneAudit
// Simulation of Raire Contest; pass in the parameters and simulate the cvrs; then call raire library to generate the assertions
simulateRaireTestContest: single raire contest
makeTestContestOAIrv : One OA IRV contest (not used?)
ContestForTesting.makeContestFromCrvs(): single contest, make cvrs first
/////////////////////////////////////////
you could say theres two kinds of Contests, Regular and Irv you could say theres two kinds of Audits, Polling and Clca if a Clca has pools, then its a OneAudit with ClcaAssorterOneAudit
| audit | contest | assorters |
|---|---|---|
| polling | regular | PAssorter |
| polling | irv | RaireAssorter |
| clca | regular | ClcaAssorter |
| clca | regular | ClcaAssorterOneAudit |
| clca | irv | ClcaAssorter with RaireAssorter |
| clca | irv | ClcaAssorterOneAudit with RaireAssorter |
ContestIF Contest DhondtContest RaireContest
ContestUnderAudit
hasa ContestIF
hasa List
->subclass RaireContestUnderAudit
hasa RaireContest
hasa List
AssorterIF (aka PrimitiveAssorter) PluralityAssorter AboveThreshold BelowThreshold DhondtAssorter RaireAssorter
ClcaAssorter hasa AssorterIF
->subclass ClcaAssorterOneAudit
Assertion hasa AssorterIF
->subclass ClcaAssertion hasa ClcaAssorter