Skip to content

MUTATION CHECK (do not merge): prove the #283 tie-break test can fail - #284

Closed
On1x wants to merge 1 commit into
masterfrom
test/tie-break-mutant
Closed

On1x wants to merge 1 commit into
masterfrom
test/tie-break-mutant

Conversation

@On1x

@On1x On1x commented Nov 18, 2026

Copy link
Copy Markdown
Member

This PR is a mutation check, not a change

It flips one comparison in database::canonical_sibling_id():

- (n == best_count && entry.first < best)
+ (n == best_count && entry.first > best)

i.e. when two rivals hold the same number of votes, rank the larger id instead of the smaller one.

Why it exists

#283 added tie_between_two_siblings_resolves_to_the_smaller_id. That case went green — but a test that has never been seen red is only proof that the fixture runs, not proof that it guards the rule. Eighteen days of consensus work this month were spent on rules that were "obviously covered": the certified-sibling acceptance gate in viz-tools turned out to be reading the failure line as success, and the convergence counter was blind to the very path it was meant to watch.

Expected result

Testnet config + consensus_sim (1|2|4 validators) must fail, and the failing assertion should name the tie case.

If those jobs pass, the case is decorative and needs fixing.

Outcome

Close without merging once the run is read. master is untouched.

This commit exists to prove that the tie-break case added in #283 can fail. A green test that
has never been seen red is only an assertion that the fixture runs.

If tests/consensus_sim/scenarios/test_certified_sibling_switch.cpp is doing its job,
'tie_between_two_siblings_resolves_to_the_smaller_id' must fail on the testnet arms.

Do not merge. Close after the run.
@On1x

On1x commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

Мутация поймана.

Арм Testnet config + consensus_sim (4 validators): run_parallel: 1 of 16 cases failed → certified_sibling_switch_suite/tie_between_two_siblings_resolves_to_the_smaller_id. Ровно тот кейс, который должен был покраснеть.

Армы 1v и 2v зелёные не потому, что кейс декоративный: сьют test_certified_sibling_switch.cpp собирается только при CHAIN_TESTNET_VALIDATORS = 4 или 21 (tests/consensus_sim/CMakeLists.txt:95-99), в 1v/2v его в бинаре нет. Первый прогон 4v упал на установке зависимостей (не на тесте) — перезапуск дал чистый вердикт.

master не тронут. Ветка удалена.

@On1x On1x closed this Nov 18, 2026
@On1x
On1x deleted the test/tie-break-mutant branch November 18, 2026 21: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.

1 participant