Skip to content

Commit 5eae752

Browse files
committed
test(parallel): record the weak-member trade for the LSP-ambiguity probe
parallel_lsp_index_exact_ambiguity_does_not_fall_through_to_legacy asserted alpha_edges == 1, which the Python weak-member guard suppresses. That assertion is a side effect, not the test's subject. Its subject — that an ambiguous exact LSP match must not fall through to the lower-ranked legacy semantic row — is unchanged: beta_edges == 0, legacy_edges == 0, and all four probe assertions (ambiguity.injected, legacy_injected, carrier_allows_fallback, shared_matcher_failed_closed) still hold. Verified before changing the number, not after. The harness deliberately injects an ambiguous exact match and forces the shared matcher to fail closed, so value.render() drops past the LSP into the registry with three same-named candidates (Alpha/Beta/Legacy.render) and bound by suffix_match -- measured: strategy=suffix_match, cands=3, conf=0.5500. That is a 1-in-3 guess that happened to land on Alpha: exactly the weak member-call class this change suppresses, and the same accepted trade recorded on python/S6 in test_lsp_resolution_probe.c. Not over-suppression: sibling tests in this suite index the same value.render() source and resolve it via lsp_method (cands=1, conf=0.9000), a strategy the guard keeps -- they still assert 1. Only the sabotaged-LSP path degrades to a weak textual guess. Flips back to 1 once py_lsp_cross resolves the receiver on this path. Refs DeusData#1276 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent b6a2284 commit 5eae752

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

‎tests/test_parallel.c‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ TEST(parallel_lsp_index_exact_ambiguity_does_not_fall_through_to_legacy) {
13081308
const cbm_gbuf_edge_t *legacy_edge =
13091309
find_calls_edge_by_tails(gbuf, "Caller.run", "Legacy.render");
13101310
if (!probe.ambiguity.injected || !probe.legacy_injected || !probe.carrier_allows_fallback ||
1311-
!probe.shared_matcher_failed_closed || alpha_edges != 1 || beta_edges != 0 ||
1311+
!probe.shared_matcher_failed_closed || alpha_edges != 0 || beta_edges != 0 ||
13121312
legacy_edges != 0) {
13131313
printf(" exact ambiguity + legacy diagnostic: exact_ambiguity=%d legacy=%d "
13141314
"fallback_allowed=%d shared_failed_closed=%d alpha=%d beta=%d legacy_edge=%d "
@@ -1325,9 +1325,26 @@ TEST(parallel_lsp_index_exact_ambiguity_does_not_fall_through_to_legacy) {
13251325
ASSERT_TRUE(probe.legacy_injected);
13261326
ASSERT_TRUE(probe.carrier_allows_fallback);
13271327
ASSERT_TRUE(probe.shared_matcher_failed_closed);
1328-
/* The ordinary registry/type fallback may still recover the source-proven
1329-
* Alpha receiver. Only the lower-ranked legacy semantic row is forbidden. */
1330-
ASSERT_EQ(alpha_edges, 1);
1328+
/* alpha_edges is a SIDE EFFECT of this test, not its subject. The subject is
1329+
* beta_edges == 0 and legacy_edges == 0 below: an ambiguous exact LSP match
1330+
* must not fall through to the lower-ranked legacy semantic row. Both are
1331+
* unchanged, as are all four probe assertions above.
1332+
*
1333+
* It used to be 1 because this harness DELIBERATELY injects an ambiguous
1334+
* exact match and forces the shared matcher to fail closed, so
1335+
* `value.render()` drops past the LSP into the registry with THREE
1336+
* same-named candidates (Alpha/Beta/Legacy.render) and bound by
1337+
* suffix_match — MEASURED: strategy=suffix_match, cands=3, conf=0.5500.
1338+
* That is a 1-in-3 guess that happened to land on Alpha: exactly the weak
1339+
* member-call class the Python guard now suppresses (#1276), and the same
1340+
* accepted trade recorded on python/S6 in test_lsp_resolution_probe.c.
1341+
*
1342+
* NOT over-suppression: sibling tests in this suite index the same
1343+
* `value.render()` source and resolve it via lsp_method (cands=1,
1344+
* conf=0.9000), a strategy the guard keeps — they still assert 1. Only the
1345+
* sabotaged-LSP path degrades to a weak textual guess.
1346+
* Flips back to 1 once py_lsp_cross resolves the receiver on this path. */
1347+
ASSERT_EQ(alpha_edges, 0);
13311348
ASSERT_EQ(beta_edges, 0);
13321349
ASSERT_EQ(legacy_edges, 0);
13331350
PASS();

0 commit comments

Comments
 (0)