Run it yourself
Current publication: the original separate Goti and Jhor arrangements. Selection criterion · Additional Goti evidence.
You can repeat the research at three depths. Each depth checks itself and says PASS or names what differs. Everything uses Python 3.10 or newer and the standard library; OR-Tools is needed only for the optional proofs.
In PowerShell set $env:PYTHONPATH = "src" before the commands below, or run pip install -e . once and replace python -m bangla_dh with bangla-dh. Run the commands from the repository folder. Multiprocessing commands must be started from the command line, not typed into an interactive Python session.
Which depth do you need
Section titled “Which depth do you need”| Depth | What you do | Download | Time | You learn |
|---|---|---|---|---|
| 1. Search | Run the layout search and compare with Kala | none | minutes (--seeds 32) to about 25 minutes on 32 cores (--reproduce) |
Do independent searches find Kala Jhor and Kala Goti, or something different or better? |
| 2. Rebuild the tables | Download the public texts and rebuild every keystroke table | about 1 GB | about 30 minutes after the download | Do the texts give exactly the numbers the search used? |
| 3. Everything | Rebuild all stages in order | about 1 GB | about 1.5 hours on 32 cores after the download | Does the whole chain, from text to layout files, reproduce? |
Depth 1: run the search
Section titled “Depth 1: run the search”The keystroke tables the search needs are committed under results/, so no download is needed.
PYTHONPATH=src python -m bangla_dh generate-layout --style D --seeds 32PYTHONPATH=src python -m bangla_dh generate-layout --style A --seeds 32A search of 32 seeds takes a few minutes on 8 cores. It starts from random layouts, prints its best layout and the published layout side by side (training J1 and the three held-out J1 values), and says whether it found the same layout, a different one that scores worse, or a better one. It writes its files to work/generate-<style>/, never over the published results. The layout file D-layout.json or A-layout.json can be scored with the challenge scorer.
Options:
--seeds N: independent runs. The published layouts were reached from 24 of 512 starts (Jhor) and 36 of 512 starts (Goti), so 32 seeds find them only some of the time.--first-seed N: shift the seeds to explore other starts.--workers N: processes to use.--weights bnwiki/train=0.5 newspaper/train=0.5: change the training mix, for examplebnwiki/train=1for Wikipedia only.
To repeat the published run exactly (512 seeds, the published seed range, and the polishing from the earlier Wikipedia and news layouts):
PYTHONPATH=src python -m bangla_dh generate-layout --style D --reproduce --workers 28This takes about 25 minutes on 32 cores and prints the same layout as Kala Jhor when it matches; the exit code is 0 only if it does.
Depth 2: rebuild the tables from the texts
Section titled “Depth 2: rebuild the tables from the texts”PYTHONPATH=src python -m bangla_dh fetch-dataPYTHONPATH=src python -m bangla_dh prepare-dataPYTHONPATH=src python -m bangla_dh build-inventoryPYTHONPATH=src python -m bangla_dh build-corpusPYTHONPATH=src python -m bangla_dh compute-frequencyPYTHONPATH=src python -m bangla_dh build-problemPYTHONPATH=src python -m bangla_dh style-frequencyPYTHONPATH=src python -m bangla_dh crosscheck-buildPYTHONPATH=src python -m bangla_dh check-results --group tablesThe last command compares every rebuilt frequency and keystroke table with the published one. The data commands are described in DATASETS.md.
Depth 3: every stage
Section titled “Depth 3: every stage”After depth 2:
PYTHONPATH=src python -m bangla_dh evaluate-phase2PYTHONPATH=src python -m bangla_dh optimizePYTHONPATH=src python -m bangla_dh evaluate-phase3PYTHONPATH=src python -m bangla_dh crosscheck-optimizePYTHONPATH=src python -m bangla_dh evaluate-crosscheckPYTHONPATH=src python -m bangla_dh mix-optimize --styles A D --seeds 512 --workers 28PYTHONPATH=src python -m bangla_dh kala-exportPYTHONPATH=src python -m bangla_dh challenge-kitPYTHONPATH=src python -m bangla_dh check-results| Stage | Command | What it does | Ends with |
|---|---|---|---|
| Phase 2 report | evaluate-phase2 |
Checks the scorer against the original analyzer port and an independent verifier, round-trips 454,000 words, scores UniJoy | three PASS lines |
| Phase 3 search | optimize |
64 seeds for each of the four styles on Wikipedia | check-results --group "phase3 search" |
| Phase 3 report | evaluate-phase3 |
Held-out scores, baselines, independent verification | all checks PASS |
| News search | crosscheck-optimize |
The same search on newspaper text | check-results --group "news search" |
| News report | evaluate-crosscheck |
Scores every baseline layout on the three held-out texts | all checks PASS |
| Mixed search | mix-optimize |
512 seeds for A and D on the Wikipedia and newspaper mix, then polish | one PASS line |
| Kala files | kala-export |
Writes the layout files and the leaderboard, types 500,000 held-out words with a port of Kala’s engine | Checks: PASS |
| Challenge kit | challenge-kit |
Builds the one-file scorer and proves it equals the integer model exactly | twelve PASS lines |
| Final check | check-results |
Compares all tables, searches and layout files with the published ones | eight PASS groups |
Each stage rewrites its folder under results/ (report, results, run-manifest.json with the SHA-256 of its inputs and outputs). Use git diff to see what changed.
Optional: the proofs and the model check
Section titled “Optional: the proofs and the model check”pip install "ortools==9.14.6206"PYTHONPATH=src python -m bangla_dh certify-lpPYTHONPATH=src python -m bangla_dh certifyPYTHONPATH=src python -m bangla_dh sensitivityPYTHONPATH=src python -m bangla_dh evaluate-phase4PYTHONPATH=src python -m bangla_dh fetch-upstreamPYTHONPATH=src python -m bangla_dh reproduce-colemakThe first four produce the certified lower bounds, the scoped proofs and the parameter-sensitivity study of Phase 4 and take several hours. The last two download the original Colemak Mod-DH analyzer at a pinned commit and reproduce its published results (about one minute); every check must end PASS.
Exactness and what to do if it differs
Section titled “Exactness and what to do if it differs”The search is deterministic: the same seed on the same Python gives the same layout. The result also depends on the exp function of your platform’s C library, so on a very different platform an annealing run can drift by a last digit and then end somewhere else. The final layouts were reached by many independent seeds, which is why a different platform still finds them. If check-results reports DIFFERS:
- Re-run
verify-datato rule out damaged downloads. - Run the unit tests:
PYTHONPATH=src python -m unittest discover -s testsshould endOK. - Open an issue with your operating system,
python --versionand the names of the differing files.
Running on a smaller computer
Section titled “Running on a smaller computer”Everything that takes long is parallel. Use --workers to limit processes, and mix-optimize --seeds 64 or generate-layout --seeds 16 to shorten a search. Keep in mind that fewer seeds find the best layout less often. The assembled texts need about 4 GB of disk space on top of the 1 GB download.
