Summary
A statement gate combining a scalar comparison with a ranged one via &&
ignores the scalar conjunct entirely: iterations are admitted as if only the
ranged part existed. Both operand orders reproduce, and both scalar and
collector destinations are affected.
Reproduce
x = -1
i = 0:3
c = [9]
c = x > 0 && i < 5 [i]
c
Expected [] (nothing admitted, since x > 0 is false; a ranged-gate
collector still commits — compare c = i < 0 [i], which correctly yields
[]). Actual:
Scalar destination, same gate:
x = -1
i = 0:3
s = 42
s = x > 0 && i < 5 i + 7
"-s"
Expected 42 (preserved). Actual 9 — every iteration was admitted and the
last one committed.
Reversing the operand order (i < 5 && x > 0) makes no difference.
Scope
Pre-existing: reproduces identically on 9fca83a, before the current branch.
Pure ranged gates (i < 0) and pure scalar gates (1 > 2) both behave
correctly; only the mixed && form drops its scalar side. Found while
verifying dead-store classification for gated collectors in PR #65 — the
write-commit behavior (which is all that classification needs) is unaffected,
but the committed content is wrong.
Summary
A statement gate combining a scalar comparison with a ranged one via
&&ignores the scalar conjunct entirely: iterations are admitted as if only the
ranged part existed. Both operand orders reproduce, and both scalar and
collector destinations are affected.
Reproduce
Expected
[](nothing admitted, sincex > 0is false; a ranged-gatecollector still commits — compare
c = i < 0 [i], which correctly yields[]). Actual:Scalar destination, same gate:
Expected
42(preserved). Actual9— every iteration was admitted and thelast one committed.
Reversing the operand order (
i < 5 && x > 0) makes no difference.Scope
Pre-existing: reproduces identically on
9fca83a, before the current branch.Pure ranged gates (
i < 0) and pure scalar gates (1 > 2) both behavecorrectly; only the mixed
&&form drops its scalar side. Found whileverifying dead-store classification for gated collectors in PR #65 — the
write-commit behavior (which is all that classification needs) is unaffected,
but the committed content is wrong.