feat(math): Clojure hash-map iteration order for the in-conv greedy tie-break (legacy)#2650
Draft
jucor wants to merge 1 commit into
Draft
feat(math): Clojure hash-map iteration order for the in-conv greedy tie-break (legacy)#2650jucor wants to merge 1 commit into
jucor wants to merge 1 commit into
Conversation
This was referenced Jul 22, 2026
Draft
docs(delphi): R1-parity goal docs, journal (2026-07-18 → 07-22 s3), quirks + divergence ledger
#2626
Draft
Draft
…ie-break (legacy) The greedy floor (conversation.clj:259-268) sorts the user-vote-counts hash-map with a STABLE sort by count desc — so equal-count ties follow Clojure's PersistentHashMap ITERATION ORDER, which is deterministic: sort by successive 5-bit chunks (low first) of Murmur3 hashLong (Clojure hasheq for Long keys). Validated against three recorded-blob oracles (user-vote-counts raw key order: vw front-loaded6 n=18, vw uniform8 n=30, biodiversity n=98 — all exact). The PR-E port assumed this order was non-deterministic and substituted matrix row order; on vw front-loaded6 step 0 that admits pid 14 where Clojure admits pid 17 (five-way 1-vote tie at the floor boundary), seeding an in-conv/base-cluster membership divergence that cascades through every downstream key — the battery's last diverging entry. Adds polismath/utils/clj_hash.py (hashLong + HAMT key order; int keys only, with a documented row-order fallback otherwise) and applies it to the legacy greedy candidate order. Array-map (≤8 entries, insertion order) cannot affect the pick: ties only matter with ≥16 participants, which guarantees hash-map. Improved mode unchanged. commit-id:d5f1f51d
Delphi Coverage Report
|
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.
The greedy floor (conversation.clj:259-268) sorts the user-vote-counts
hash-map with a STABLE sort by count desc — so equal-count ties follow
Clojure's PersistentHashMap ITERATION ORDER, which is deterministic:
sort by successive 5-bit chunks (low first) of Murmur3 hashLong
(Clojure hasheq for Long keys). Validated against three recorded-blob
oracles (user-vote-counts raw key order: vw front-loaded6 n=18, vw
uniform8 n=30, biodiversity n=98 — all exact).
The PR-E port assumed this order was non-deterministic and substituted
matrix row order; on vw front-loaded6 step 0 that admits pid 14 where
Clojure admits pid 17 (five-way 1-vote tie at the floor boundary),
seeding an in-conv/base-cluster membership divergence that cascades
through every downstream key — the battery's last diverging entry.
Adds polismath/utils/clj_hash.py (hashLong + HAMT key order; int keys
only, with a documented row-order fallback otherwise) and applies it to
the legacy greedy candidate order. Array-map (≤8 entries, insertion
order) cannot affect the pick: ties only matter with ≥16 participants,
which guarantees hash-map. Improved mode unchanged.
commit-id:d5f1f51d
Stack: