What the VAST shards found

VAST found a real bug this week. Not a dramatic one. The good kind: small, reproducible, and annoying enough that a human probably would not have written the test by hand.

One generated program kept doubling a string until it crossed VAST's safety limit. The AST path said "string overflow." The IR path found the same problem but filed it under the wrong kind of error. The JVM path did not stop at the same boundary. Three routes through the compiler, three slightly different answers.

If you are new to the system, start with the VAST overview, the differential testing guide, and the older story about when VAST found a nullable bytecode bug.

What is a VAST shard?

A VAST shard is a small, repeatable slice of a much bigger search.

Instead of saying "run random compiler tests for an hour" and then digging through a huge log, VAST splits the work into named lanes and seed ranges. A shard has a profile, a seed, and a count:

lane: vast-ir-check
profile: types
seed: 416168779882453002
count: 30

That means: generate 30 programs from the types profile, start at that seed, and run the IR translation checks.

That sounds dry, but it matters. If a shard finds something, the same shard can be run again. If one program inside it fails, that exact seed can be run by itself. A big search turns into a small debugging loop.

What the shard found

The failing program was not app code. It was a weird little compiler test, which is the point.

In plain English, it did this:

StageWhat happened
StartBegin with the string "b"
Inner loopDouble it with "b" + "b"-shaped work
Outer loopRepeat that doubling enough times that the string becomes huge
EndTry to return a number afterward

The line that mattered was effectively:

x = x + x

That line looks harmless when x is short. Keep doing it, though, and the length jumps fast:

StepApproximate length
Start1
After 10 doublings1,024
After 20 doublings1,048,576

VAST has a guard for this. It does not need to allocate massive strings just to test compiler behaviour. Once a generated string crosses the VAST limit, the expected result is a controlled runtime error:

runtime_error(STRING_OVERFLOW)

The generated program crossed that boundary.

Why the mismatch mattered

VAST runs generated programs through multiple independent paths.

PathWhat it checks
AST interpreterThe direct meaning of the source program
IR interpreterThe lowered intermediate form
JVM pathOptimized bytecode running on the JVM

For this seed, the paths did not agree.

The AST interpreter said:

runtime_error(STRING_OVERFLOW)

The IR interpreter hit the same problem but reported it as a compile-style error. The JVM path could keep going until Java itself ran out of heap, or in some runs make the surrounding program look like it returned normally.

That is enough to fail the test. The program is artificial, sure. It is still valid input for the compiler, and all paths are supposed to describe the same language behaviour.

What was actually wrong

There were two issues.

First, the IR interpreter already had the string-size guard, but it did not map that guard into the same STRING_OVERFLOW category as the AST interpreter. It was the right event with the wrong label.

Second, the VAST JVM path did not enforce the same VAST string limit during string concatenation. Normal compiled Vary programs should use ordinary string behaviour. Inside VAST, though, the JVM path needs the same safety boundary as the interpreters so the comparison is fair.

The fix was narrow. When the VAST JVM executor enables a string limit, generated bytecode calls a checked string concatenation helper. Regular code generation keeps its normal path. VAST gets a controlled result instead of a heap failure or a misleading success.

Why the shard helped

The best part was not that VAST found a bug. The best part was that the failure came with coordinates.

There was no guessing which random program failed. The shard gave us the lane, profile, and seed. After that, the work was fairly mechanical:

StepResult
Run the shardFind the failing seed
Run the exact seedReproduce the mismatch in seconds
Save the seed as a testKeep the bug from coming back
Fix the path disagreementMake AST, IR, and JVM agree
Re-run the shardConfirm the shard is clean

That is a much better loop than "the nightly found something somewhere."

The phrase "VAST shard" fits because it gives the right mental model. This is not one giant random run that everyone hopes will be readable later. It is many small, named pieces of search. Each piece can be replayed, reduced, and promoted into a permanent test.

Why we care

This is the kind of compiler failure worth caring about.

The source program was valid. The operation was simple. Nothing looked exotic until a few facts lined up:

FactWhy it mattered
Strings grow exponentially when doubledThe program reached the overflow guard quickly
VAST compares multiple execution pathsOne wrong path could not hide behind a green result
The shard had a deterministic seedThe failure was reproducible
The failing seed became a unit testThe fix is now locked in

This is what we want from compiler testing. Not one perfect test. A loop that finds surprises and then turns each surprise into a boring regression test.

VAST shards give us that loop. They search broadly, fail with coordinates, and leave behind small examples we can keep.

The lesson

The bug was not "strings are hard." The bug was "three implementations of the same language rule drifted apart."

VAST caught the drift. The shard made it reproducible. The seed made it testable. The fix made AST, IR, and JVM execution agree again.

For more on the pieces behind this, see VAST reduction, VAST CI integration, and VAST coverage and confidence.