Skip to content

Lossless Verification

GCF guarantees decode(encode(value)) == value for every structured value. This page documents how that guarantee is verified.

The numbers

FormatRound-tripsFailures
JSON21,250,000,0000
YAML21,000,000,0000
MessagePack584,000,0000
CSV335,000,0000
TOML100,000,0000
Total43,270,000,000+0

43 billion+ random structured values generated, serialized through each format, parsed back, encoded as GCF, decoded from GCF, and compared to the original. Zero mismatches.

What this proves

GCF's grammar expresses any structured data regardless of source format. The encoding operates on structured values (objects, arrays, strings, numbers, booleans, null), not on JSON syntax. Whether your data originates as JSON, YAML, TOML, CSV, MessagePack, or any other format that deserializes to these primitives, GCF encodes it losslessly.

The 5 formats tested are proof points. The capability is universal: any format that produces objects and arrays round-trips through GCF.

Per-language verification

Six language implementations, all passing the same 204 conformance fixtures:

LanguagePackageConformanceRound-trip fuzz
Rustgcf204/20443B+ multi-format (definitive suite)
Gogcf-go204/2041B+ (native Go fuzzing)
TypeScript@blackwell-systems/gcf204/204Conformance-based
Pythongcf-python204/204Conformance-based
Swiftgcf-swift204/204Conformance-based
Kotlingcf-kotlin204/204Conformance-based

Cross-language matrix

Every implementation can encode data that every other implementation decodes correctly. The 6x6 encode/decode matrix is fully verified: encode in Go, decode in Python. Encode in Rust, decode in Swift. Every combination passes.

How the fuzz testing works

Each test generates random structured values using a seeded PRNG, ensuring reproducibility. The round-trip is:

1. Generate random value (objects, arrays, scalars, nested to depth 3-4)
2. Serialize to format X (JSON, YAML, TOML, CSV, or MessagePack)
3. Parse back from format X (normalize types)
4. Encode as GCF via encode_generic()
5. Decode from GCF via decode_generic()
6. Deep-compare decoded value to step 3 output
7. Any mismatch = test failure (zero tolerance)

The value generator produces:

  • Null, booleans, integers, floats, strings
  • Objects with 0-6 keys (alphanumeric keys with underscores, hyphens, dots)
  • Arrays with 0-8 elements
  • Nesting to depth 3-4
  • Strings with spaces, punctuation, unicode-safe characters

Each seed produces a unique value. Seeds are sequential (0, 1, 2, ..., N). The tests are fully deterministic and reproducible.

Reproduce it

bash
git clone https://github.com/blackwell-systems/gcf-rust
cd gcf-rust

# JSON 10B (parallel, ~56 min on 14-core machine)
cargo test --release json_10b -- --nocapture

# YAML 10B (parallel, ~3 hours)
cargo test --release yaml_10b -- --nocapture

# MessagePack + YAML + CSV (334M each)
cargo test --release multiformat -- --nocapture

# TOML 100M
cargo test --release toml_100m -- --nocapture

All tests use Rayon for parallel execution across all available cores. Progress logs to stderr with rate and ETA. The Rust implementation is the definitive fuzz suite: 2.94M round-trips/second on JSON, 307K/s on YAML, at release optimization.

Conformance fixtures

204 fixtures in tests/conformance/ covering:

CategoryCountWhat it tests
arraysVariousEmpty, primitive, mixed-type arrays
attachmentsVariousInline schemas, shared schemas, nested objects
containersVariousObject/array container selection
decodeVariousDecoder edge cases
errors-v2VariousInvalid input rejection
flattenVariousNested-object flattening (> path columns)
graph-decodeVariousGraph profile decoding
graph-deltaVariousDelta encoding/decoding
graph-encodeVariousGraph profile encoding
graph-pack-rootVariousContent-addressed identity
graph-sessionVariousSession deduplication
generic-deltaVariousGeneric-profile keyed delta encoding
generic-delta-sessionVariousGeneric-profile delta across a session
generic-pack-rootVariousGeneric-profile content-addressed identity
inline-schemaVariousInline attachment schemas
keysVariousBare keys, quoted keys, special characters
numbersVariousInteger, float, negative, scientific notation
rootsVariousRoot-level values
scalarVariousAll scalar types and edge cases
streaming-v2VariousDeferred counts, summary trailers
whitespaceVariousIndentation, trailing whitespace

Every implementation must pass every fixture. New fixtures are added when edge cases are discovered (e.g., special-character field names added during multi-format fuzz testing).

Log files

All fuzz run logs are archived in eval/results/multiformat/. Every claimed number has a corresponding log file.

JSON (21.25B total):

  • rust-json10B-parallel-2026-06-19.log (10B, 2.79M/s, parallel)
  • rust-json10B-parallel-2026-06-14.log (10B, 2.94M/s, parallel)
  • rust-json1B-extra-2026-06-14.log (1B, 2.52M/s, parallel)
  • rust-rerun-json250M-msgpack250M-2026-06-14.log (250M JSON + 250M MessagePack)

YAML (21B total):

  • rust-yaml10B-parallel-2026-06-14.log (10B, 258K/s, parallel, 10.7 hours)
  • rust-yaml10B-parallel-2026-07-13.log (10B, 258K/s, parallel, 10.78 hours)
  • rust-yaml665M-2026-06-14.log (665M, seed offset 334M-999M)
  • rust-msgpack334M-yaml334M-csv334M-2026-06-13.log (334M YAML portion)

MessagePack (584M total):

  • rust-msgpack334M-yaml334M-csv334M-2026-06-13.log (334M MessagePack portion)
  • rust-rerun-json250M-msgpack250M-2026-06-14.log (250M MessagePack portion)

CSV (335M total):

  • rust-msgpack334M-yaml334M-csv334M-2026-06-13.log (334M CSV portion)
  • rust-rerun-csv1M-2026-06-14.log (1M, seed offset 334M)

TOML (100M total):

  • rust-toml100M-2026-06-14.log (100M)

Extended validation: 17 formats

Beyond the 43 billion round-trips across 5 formats, we validated GCF against 12 additional serialization formats using the Format Mega-Gauntlet. This test converts data through all 17 formats in sequence with GCF as the bridge between each:

JSON → XML → MessagePack → YAML → BSON → TOML → CBOR → Protobuf → 
CSV → JSON5 → Avro → Arrow → Parquet → Pickle → INI → NDJSON → Plist → JSON

15 conversions. 17 formats. The final JSON exactly matches the original.

Format categories validated:

CategoryFormats
TextJSON, YAML, TOML, XML, CSV, INI, JSON5, NDJSON
BinaryMessagePack, BSON, CBOR, Pickle, Plist
Schema-basedProtocol Buffers, Apache Avro
ColumnarApache Arrow, Apache Parquet

This proves GCF's codec is trustworthy regardless of where your data originated. Whether it came from a Protobuf microservice, a Parquet data lake, or a YAML config file, you can safely encode it as GCF (for LLM consumption or wire transmission) and decode it back without data loss.

Run it yourself:

bash
cd gcf/examples
pip install msgpack pyyaml pymongo tomli tomli_w cbor2 json5 protobuf avro-python3 pyarrow
protoc --python_out=. test_data.proto
python3 mega-gauntlet.py

Edge cases verified

The fuzz testing has specifically verified:

  • Null values in all positions (root, object field, array element, tabular cell)
  • Empty strings vs null vs absent (distinct encodings: "", -, ~)
  • Boolean strings ("true", "false" as string values, not parsed as booleans)
  • Numeric strings ("42" as string, not parsed as number)
  • Special characters in keys (%, !, @, #, quoted in field declarations)
  • Deeply nested objects (depth 3-4, objects within arrays within objects)
  • Empty containers (empty arrays, empty objects)
  • Float precision (round-trip preserves values within JSON's double-precision range)
  • Large integers (up to 2^53 - 1, JavaScript's MAX_SAFE_INTEGER)
  • Unicode (multi-byte characters in keys and values)

Truncation tolerance and completeness validation

The lossless guarantee above covers complete documents: a well-formed GCF payload always decodes back to the original value. A separate question is what happens to an incomplete document, one truncated mid-stream by a dropped connection, a cut-off model response, or a filled buffer.

GCF's generic (tabular) profile is tolerant of truncation by design. Because the format is line-oriented and each row is self-contained, a decoder can make sense of the rows it did receive even if the stream is cut short. This is the same property that enables input-side streaming (encoding unknown-length data, decoding rows as they arrive). It is a deliberate capability, not a defect.

The tradeoff is that GCF does not, by default, reject a truncated document the way JSON does. JSON's rejection of truncated input is a side effect of its mandatory closing delimiters: a document cut before its final } (or ], or closing ") is syntactically invalid, so the parser fails. That "fail-closed on truncation" behavior is grammatical luck, not an integrity mechanism, and it is not guaranteed (a cut landing exactly on a complete boundary parses cleanly). GCF trades those redundant closing tokens for compactness and streaming, so a truncated tabular stream still decodes.

This is not a leak. A truncated GCF document does not expose or corrupt attacker-controlled values; the format's field boundaries hold regardless (see the format-level security tests in gcf-go/security_test.go). Truncation tolerance is purely a question of whether a partial stream fails loudly or decodes what it has.

Validating completeness when it matters

For security- or integrity-sensitive inputs, completeness should be validated at the layer that owns integrity, which is stronger than any in-band marker:

  • Transport: TLS provides stream integrity; HTTP Content-Length / chunked framing signals a truncated body.
  • Message: a checksum or HMAC over the payload detects truncation and tampering.
  • Streaming trailer: the ##! summary counts=N trailer (see Streaming Encoding) lets a consumer verify it received all expected rows; its absence on a stream that should have one indicates truncation.

A future opt-in decoder-side strict mode (see the roadmap) will let consumers that want JSON-style fail-closed behavior enforce completeness at decode time, without changing the wire format or the default token count.

100% comprehension. 71% fewer tokens. 2,500+ LLM evaluations.