Skip to content

Commit 8afc17a

Browse files
michaelkirkCopilot
andauthored
chore(docs): document synthetics directory structure (#1393)
I'm not entirely sure this is correct, but I thought this would be more useful to the project than just asking in slack. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 457fbef commit 8afc17a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

test/synthetic/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Synthetic MLT Test Fixtures
2+
3+
To verify encoder and decoder implementations across languages, this directory
4+
contains interesting `.mlt` tiles along with their expected logical
5+
representation as JSON.
6+
7+
## Encoding
8+
9+
### `0x01/` — Java reference
10+
11+
Generated by `SyntheticMltGenerator.java`. These are the canonical files; the
12+
Rust encoder verifies byte-for-byte against them where possible.
13+
14+
### `0x01-rust/` — Rust-only output
15+
16+
Generated by the `mlt-synthetics` crate. Files land here when the Rust encoder
17+
produces valid output that differs from Java's bytes. MLT is complex enough
18+
that there are often multiple reasonable ways to encode.
19+
20+
## Decoding
21+
22+
Any correct decoder should produce identical logical output (json) from the
23+
same `.mlt`, regardless of which encoder wrote it. So Java and TypeScript
24+
decoding a file from `0x01-rust/` should produce the same `.json` as Rust did.
25+
26+
## Where to add a new synthetic
27+
28+
- **`0x01/`** — Java can encode it. Add to `SyntheticMltGenerator.java`.
29+
- **`0x01-rust/`** — Java can't or won't produce it. Add to `mlt-synthetics/src/main.rs` with a
30+
`-rust` suffix in the name (the tool strips it when writing the file).

0 commit comments

Comments
 (0)