Erratum (2026-12-02). This post presents the 1.5.4 RG09 change "a local assigned the same expression is compared as that expression" as part of a fix. That change introduced a false positive of its own. It substituted a local's initializer without asking whether state could change in between, so a snapshot taken before a transaction and compared with the state after it
let market_before = env.svm.get_account(&env.market).unwrap();
let result = env.send(/* deposit that must fail */);
assert_eq!(env.svm.get_account(&env.market).unwrap(), market_before);was reported as "this assertion cannot fail". It can: that is exactly the check that a rejected transaction left the market untouched. On one public Solana repository the false positive produced 669 of the 693 RG09 findings on a 45-source corpus (measured on the pre-fix source tree, not on a release binary).
Releases 1.5.4, 1.5.5 and 1.5.6 have this false positive. It is fixed in 1.5.7: a local is substituted only when its initializer is a constant, or when no call other than the initializer's own and the assertion's own sits between the binding and the assertion; when the binding cannot be found, nothing is substituted. Property tests insert a state-changing call between binding and assertion and require RG09 to go silent. The full account is in "Testing the tester: what deeper testing found in my PoC checker".
Separately, the false negative described below under "What 1.5.4 does not prove" was fixed in 1.5.6, as the "Since then" section already says.
realism-gate reads a proof-of-concept exploit test without running it, and reports patterns that make the PoC prove less than it claims: an assertion that cannot fail, an impact with no before-value, an exploit effect the test wrote into state itself. It is a static checker, so the two ways it can be wrong are the usual two: it can flag a sound PoC (a false positive), or stay silent on a broken one (a false negative).
This week it was wrong in the first way three times, on real Solana PoCs. realism-gate 1.5.4 fixes all three. One of the fixes introduced a new case of the second kind. It is described in the section on what 1.5.4 does not prove, and fixed in 1.5.6.
The first one is a single line:
expect(1).toBe(0); // if we don't get an error, the transaction was not reverted
RG09 is the rule for "this assertion cannot fail". It flagged this line. The rule treated any two constants as a tautology and never evaluated the comparison: 1 and 0 are both values the test wrote, so it stopped there.
The question RG09 asks is narrow: can this assertion fail? Not is this a good test? For constants the answer is a truth table:
Assertion | Outcome | RG09 in 1.5.4 |
|---|---|---|
| always passes | flagged |
| always passes | flagged |
| always fails if reached | silent |
The third row is not a tautology. It is a sentinel: it means "this line should be unreachable". Whether it makes a good test depends on what comes before it, and that is a different defect from the one RG09 is about.
A sentinel can still be weak. When it sits inside try { … } catch (e) { … }, a broad catch can swallow the assertion's own error and the test passes for the wrong reason. In Jest, await expect(tx).rejects.toThrow() says the same thing without that trap. realism-gate does not yet flag this pattern. It is a separate rule, not something RG09 should guess at.
1.5.4 evaluates the comparison. A named constant is resolved through its single assignment where the value is known, and a local assigned the same expression is compared as that expression.
The second one is a missing before-value that was not missing:
const before = await provider.connection.getBalance(who);
// ...
const after = await provider.connection.getBalance(who);
expect(after).toBeGreaterThan(before);
RG10 says "the impact is measured without a before-value". The read tracker walked each assignment shallowly and skipped a call at the top level of the assignment. The baseline existed; the model could not see it. 1.5.4 records a measurement read in an assignment, so RG10 fires only when there really is no before-value.
The third one is the hardest, because it is a judgment call (simplified; send and withdraw_ix are the test's own helpers):
svm.set_account(output, Account { lamports: 1, data: vec![0; 64], owner: program::ID, ..Default::default() })?;
send(&mut svm, withdraw_ix(&attacker.pubkey()), &[&attacker]);
The test builds a program-owned account as a fixture. The program then writes the effect the assertion reads. RG04 called the setup write a fabricated exploit result. RG06 did the same for a victim's funded balance.
RG04 now reports only an exploit-phase write of protocol state that a later assertion reads. RG06 ignores a balance whose token owner is a user or victim, and a one-lamport fixture written in setup. A protocol-owned token balance is still reported in setup: a fabricated vault balance is exactly the cheat the rule is for.
To tell setup from exploit, 1.5.4 also uses the transaction phase from realism-gate's model of the test, plus one heuristic: a step whose own name says init, create, fund or update config is setup.
It introduces a false negative. The setup-word heuristic reads the instruction name. Take my own RG10 test fixture for a missing before-value (the attacker's balance is read only after the attack) and rename the exploit instruction from withdraw to initializeWithdraw. realism-gate 1.4.0 reports RG10 on it, and 1.5.4 reports nothing:
$ realism-gate check rg10_ix.ts # 1.4.0
warn RG10 no-baseline rg10_ix.ts:19:5 vault::drains the vault
RESULT PASS (fails on error and above)
$ realism-gate check rg10_ix.ts # 1.5.4
RESULT PASS (fails on error and above)
(RESULT PASS is expected in both runs: the build fails only on error, and RG10 is not at that level.)
Renaming the it(...) title does not suppress it, and RG04 still fires on its own fixture when the exploit call is renamed. So this is not a free switch for a PoC author: the instruction names come from the program's IDL. It does mean that a real exploit through an instruction such as initialize_* can go unreported by RG10. I have not measured how often that happens.
It does not prove the rules are precise. It adds no rule, flag, default or severity. It fixes three false-positive classes on the PoCs that exposed them.
"True positives unchanged" is narrower than it sounds. The pre-registered binding tests (tests/f1_binding.rs, 26 tests written before the evaluation data, which pin the outcomes the rules are not allowed to change) still pass untouched. Three fixture expectations (class3, class4 and the inline-allow fixture) were narrowed on purpose to the new meaning of "setup write". RG01 (attacker holds a privilege) and RG03 (deployer is attacker) are deliberately unchanged. One human label disagrees with them, and changing a rule against the binding tests is a rule decision, not a bug fix.
Everything here is public in PR #58:
seven new clean-case fixtures, one for each false-positive shape above, which must produce no finding;
two regression fixtures that record the RG01 disagreement instead of coding it away;
fuzz seeds for the new shapes;
a property test that draws 30 random integer pairs per run and requires RG09 to flag exactly one of
assert_eq!(a, b)andassert_ne!(a, b). The old shortcut flagged both.
The full suite, clippy with -D warnings and rustfmt --check pass on the release commit.
1.5.5 followed a day later. It moves the phase logic, including the setup-word fallback, into one place in the model, and its golden output is byte-identical to 1.5.4's. I checked the false negative against it while writing this, and the answer is not "fixed":
Test shape | 1.4.0 | 1.5.4 | 1.5.5 | 1.5.6 |
|---|---|---|---|---|
one call, | RG10 | silent | RG10 | RG10 |
a victim | RG10 | RG10 | silent | RG10 |
the same with | RG10 | RG10 | RG10 | RG10 |
To reproduce, start from tests/fixtures/bad/RG10_no_baseline.ts in the repository, rename methods.withdraw( to methods.initializeWithdraw(, and for the second row add await program.methods.deposit(new BN(500)).accounts({ owner: provider.wallet.publicKey }).rpc(); as the first line of the test body.
1.5.5 reports the one-call file again, but not because the cause was fixed. --dump-model shows it still marks initialize_withdraw as setup; with no exploit step left, a fallback the rules use for tests with no exploit step at all takes over. Add an ordinary setup call before the exploit and that fallback no longer applies, so 1.5.5 goes silent where 1.5.4 did not. The cause is the same in both versions: the setup-word rule could demote the attack itself. A byte-identical golden manifest was not enough to show that the two versions behave the same.
Fixed in 1.5.6. The setup-word rule now demotes a transaction only when an exploit transaction follows it, so the last transaction of the attack is never reclassified by its name. Both shapes above are regression fixtures that RG10 must fire on, and every other golden case is byte-identical. Release notes: https://github.com/KhomDev/realism-gate/releases/tag/v1.5.6
One limitation stays, and the 1.5.6 changelog names it: since 1.5.4, a state write placed right after a step named fund_* counts as setup, so RG04 does not report it, even when it is the cheat. 1.5.4 and 1.5.5 sometimes reported it anyway, but only through the same accidental fallback. Closing that gap is a rule decision for RG04, not a phase bug.
A patch is the honest shape for this. The tool was wrong in three specific ways; 1.5.4 made it less wrong in those three and newly wrong in a fourth, and writing this up is what found the fourth. 1.5.6 fixes it, with the failing shapes kept as tests. The next step is the harder one: a second reader and a fresh corpus, not a louder claim.
cargo binstall realism-gate
Release notes: https://github.com/KhomDev/realism-gate/releases/tag/v1.5.4

