Skip to content

Add the magika evaluation dataset, its benchmark and the Sembiance collection - #1450

Open
ebursztein wants to merge 5 commits into
google:mainfrom
ebursztein:worktree/dataset-public-pr
Open

ebursztein wants to merge 5 commits into
google:mainfrom
ebursztein:worktree/dataset-public-pr

Conversation

@ebursztein

@ebursztein ebursztein commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Adds dataset/, a standalone Python project (magika-datasets) that builds, labels, publishes and benchmarks the whole-file evaluation corpus used to test Magika.

What is in it

  • Corpus: 71,296 samples across 474 format classes. 47,914 of them carry a verified label, and the rest stay in the corpus marked unverified, never guessed.
  • Sembiance collection: 33,421 files from Sembiance's file-format samples (credit Sembiance / dexvert), kept separate on the same taxonomy. Validators prove 2,118 of them.
  • Labels come from evidence: human review, then structural proof by one of 194 validators, then agreement of two non-Magika detectors, then a pinned source path. Magika's own predictions never count as evidence.
  • Licences: every GitHub sample comes from a repository whose licence is resolved and allowed by config/repository-license-policy.json, and REPOSITORIES.md lists each one. VirusTotal and generated samples carry no repository licence.
  • Benchmark: magika-datasets benchmark runs Magika, libmagic and TrID at their shipping defaults on a hydrated snapshot, scores them against verified labels and times them with Hyperfine.

Data

Parquet tables are not in git. They ship as one zip archive, magika-eval-dataset-v1.0-metadata.zip — 188 MB, SHA-256 a03d46f80927f36beb8d3b5324ac97929a4a62722b262afcd3c1a99324341c27. Unzip it into dataset/. magika-datasets archive rebuilds it from the tables and reproduces the same bytes; dataset/metadata-downloads.json names every member with its own hash. hydrate then downloads the corpus bytes and verifies each one by SHA-256 into Parquet shards.

Commits

  1. Structural validators
  2. The magika-datasets package: acquisition, labelling, licence policy, refill, metadata, hydration, selection and the archive
  3. The detector benchmark
  4. The Sembiance collection importer
  5. Configuration, receipts and documentation

Nothing in Magika's build reads dataset/.

Testing

cd dataset && uv sync --locked && uv run --no-sync pytest -q passes 677 tests. One of them is skipped until the metadata archive is unpacked, because it needs the taxonomy table. ruff check is clean.

🤖 Generated with Claude Code

ebursztein and others added 5 commits September 13, 2026 17:01
194 scoped validators in 11 families. Each observes whether a file's bytes are
a format -- headers, tables, checksums, framing -- and reports pass, fail or
inconclusive; nothing is executed or rendered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Acquisition from GitHub, VirusTotal and generators, the label ladder, licence
policy and pruning, refill, metadata tables, hydration into verified Parquet
snapshots, selection, statistics and the metadata archive, with their tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Runs Magika, libmagic and TrID over a hydrated snapshot at their shipping
defaults, scores them against verified labels and times them with Hyperfine.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Imports Sembiance's file-format samples onto the same store, taxonomy,
labelling and hydration as the corpus, with reviewed folder mappings as hints.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
VirusTotal queries, licence policy, taxonomy and label corrections, the
receipts binding the published tables, and the README, SAMPLING.md and the
generated REPOSITORIES.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ebursztein
ebursztein force-pushed the worktree/dataset-public-pr branch from 0b42141 to 582b5ac Compare September 17, 2026 15:45
@ebursztein ebursztein changed the title Add reproducible dataset builder, hydrator and scoped validators Add the magika evaluation dataset, its benchmark and the Sembiance collection Sep 17, 2026

This branch has not been deployed

No deployments
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