feat(math): in-conv greedy floor + persistent carry (PR-E)#2623
Draft
jucor wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 18, 2026
jucor
marked this pull request as draft
July 18, 2026 02:29
This was referenced Jul 18, 2026
jucor
force-pushed
the
spr/edge/ca2af3c7
branch
2 times, most recently
from
July 18, 2026 13:35
6a3085f to
eb3dcb5
Compare
This was referenced Jul 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Ports Clojure’s :in-conv semantics into the Python clojure-legacy engine path so legacy-mode clustering uses the same “persistent carry + greedy floor to 15” participant selection behavior as the Clojure math pipeline, while keeping the default improved mode unchanged.
Changes:
- Add
Conversation.in_convwarm-state to persist legacy-mode in-conv membership across ticks (carry semantics). - Implement legacy-mode greedy floor logic in
_get_in_conv_participants(fill to 15 by vote-count, stable tie-break by row order, and prune banned participants). - Add a focused test module covering improved-vs-legacy behavior, carry persistence, serialization, monotonicity, and ban-prune floor refill.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
delphi/polismath/conversation/conversation.py |
Adds legacy-mode persistent in_conv state, greedy floor + prune logic in participant selection, and legacy serialization of in-conv to match clustered rows. |
delphi/tests/test_in_conv_greedy_carry.py |
New unit tests validating legacy carry+greedy behavior and ensuring improved mode remains threshold-only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jucor
force-pushed
the
spr/edge/a861cd87
branch
2 times, most recently
from
July 21, 2026 19:49
81f5d9d to
c9ec6ad
Compare
This was referenced Jul 24, 2026
Draft
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.
Port the two Clojure :in-conv steps the Python pipeline was missing
(conversation.clj:243-269) into the 'clojure-legacy' engine mode of
Conversation._get_in_conv_participants. Improved mode (default) is unchanged
(threshold set only, no carry, no greedy floor).
Legacy mode now, every tick:
PERSISTENT in-conv set carried on the conv (
(or (:in-conv conv) #{}),conversation.clj:247), so a participant, once in, never leaves.
top
15 - nremaining participants by vote count descending, INCLUDINGbelow-threshold voters (conversation.clj:259-268), and persists them.
The persisted set feeds base clustering (which matrix rows) and is serialized
as the blob :in-conv (to_dict), matching the clustered rows.
self.in_conv is threaded in-memory across update_votes (deepcopy in recompute),
NOT persisted to dynamo — same lifetime as the PCA/smoother/cluster warm state.
Greedy tie rule: Clojure sorts a hash-map with
(sort-by (comp - second)),whose order among EQUAL vote counts is hash-map iteration order — inherently
non-deterministic. We break ties by matrix ROW ORDER (user-vote-counts
insertion order) via a STABLE sort — a deterministic, reproducible surrogate
for that underspecified Clojure tie case. Flagged for the integrator.
RED evidence (against PR-C HEAD, before this commit):
GREEN: 9 new tests pass; full suite 520 passed / 17 skipped / 47 xfailed (was
511 after PR-C), zero regressions. The vw cold-identity gate stays green (67
in-conv > 15, so no greedy fires and the serialized :in-conv is unchanged).
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
commit-id:a861cd87
Stack: