Skip to content

feat: expose the conformance corpus from the crate - #13

Merged
spacedevin merged 3 commits into
mainfrom
feat/crate-exposes-corpus
Aug 4, 2026
Merged

feat: expose the conformance corpus from the crate#13
spacedevin merged 3 commits into
mainfrom
feat/crate-exposes-corpus

Conversation

@spacedevin

Copy link
Copy Markdown
Owner

profiles.json declares which cases a restricted implementation may reject — tish-gba bakes to two sound chips and legitimately rejects most of the language.

Nothing verified that declaration. The runner only checks each case is accounted for in a profile, not that the implementation behaves that way. A profile could claim a subset it didn't actually have, and the corpus would still pass.

The corpus ships inside the crate, but a consumer cannot read a dependency's data files — so it was unreachable from the one place that needed it.

Now embedded via include_str! and exposed:

for case in deckfile::corpus::cases() {
    // case.name, case.source, case.expected
}
deckfile::corpus::profiles()   // profiles.json verbatim

so a subset implementation can run the same inputs and prove it accepts everything it doesn't declare it rejects.

Generated alongside the rest of the crate, so the embedded copy can't drift from the corpus it came from.

Unblocks the last item of the original plan: tish-gba running the shared corpus against its gba profile.

profiles.json declares which cases a restricted implementation may reject —
tish-gba bakes to two sound chips and legitimately rejects most of the language.
Nothing verified that declaration. The runner here only checks that every case
is ACCOUNTED FOR in a profile, not that the implementation actually behaves that
way, so a profile could claim a subset it did not have.

The corpus ships inside the crate but a consumer cannot read a dependency's data
files, so it was unreachable from the one place that needed it. Now it is
embedded via include_str! and exposed as `deckfile::corpus::cases()` and
`profiles()`, so a subset implementation can run the same inputs and prove it
accepts everything it does not declare it rejects.

Generated alongside the rest of the crate, so the embedded copy cannot drift
from the corpus it came from.
… assert

The gba profile listed 001, 002 and 004 under mustAccept. All three contain
constructs the bake rejects by design — `scale`, `remove_track`, `transpose` —
so the profile claimed a subset it did not have. Nothing noticed, because until
now nothing ran the profile against the implementation.

Moved those to mayReject with the actual reason, and added 012-gba-subset: a
song built only from what the GBA bake supports, so mustAccept asserts something
real instead of being empty. An empty mustAccept would make the test vacuous —
it would pass no matter how far the subset shrank.

The sharp-name parsing that 001 pins is still covered on the GBA side by 012.
3b87e8f described this change but did not contain it: a `git checkout` cleaning
up after a negative test reverted profiles.json between the edit and the commit,
so the message claimed a fix the content did not have. CI caught it —
012-gba-subset was unaccounted for in any profile.

The correction itself is unchanged: 001, 002 and 004 move to mayReject because
each uses a construct the GBA bake rejects by design (`scale`, `remove_track`,
`transpose`), and mustAccept becomes 012-gba-subset so it asserts something real
rather than being empty.
@spacedevin
spacedevin merged commit c2084bd into main Aug 4, 2026
5 checks passed
@spacedevin
spacedevin deleted the feat/crate-exposes-corpus branch August 4, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant