labels: add deluxe parser (Phase A — master enum identification)

Closes the 'detected but no parser' gap on Deluxe-authored BD-J discs
(com/bydeluxe/ package signature; ~20% of UHD discs in our corpus per
the 2026-05-10 11-disc capture session).

What ships in this commit:

- detect() — registers the parser in the chain (loose pre-check at the
  /BDMV/JAR/ level; real signal in parse via has_path_prefix on
  'com/bydeluxe/').
- Phase A master enum identification — walks every .class's <clinit>
  ldc sequence and matches against framework-stable fingerprints for:
    Language    (70 ldcs starting English/French/Spanish/Dutch)
    Purpose     (8  ldcs starting Normal/Commentary/PiP/Trivia)
    VideoFormat (7  ldcs starting HD/HDR10 Plus/HD Dolby)
    Region      (22 ldcs starting USA_D1/LIC1/LIC2/LIC3 — Disney-only)
    Studio      (6  ldcs starting Disney/Marvel/Pixar — Disney-only)
  All identifications verified out-of-tree on corpus disc-01 (Disney,
  The Amateur) and disc-09 (Warner, Dune Part 1) via the standalone
  POC.
- Phase B structural skeleton (find_codec_enum) — identifies the
  codec enum class by structural signature (>=20 'new' ops, 0 ldcs),
  returns the ordered subclass list. Codec string extraction from
  subclasses is dead-coded pending the follow-up commit.

What does NOT ship yet:

- Phase D (per-stream binding-class decoder). parse() returns None
  intentionally — the master enums alone don't yield StreamLabels
  without the streamTable.put(...) bytecode walker. analyze() will
  show 'deluxe' in parsers_detected with the enum identification in
  tracing logs, so the analyzer reports honestly: 'detected, can't
  emit labels yet' rather than silent failure.

Why ship A without D: A is proven on real corpus discs; D's design
needs ground-truth binding bytecode from at least 2 corpus discs
side-by-side to verify the stack-machine pattern. The Phase A
infrastructure (master enum identification + ordinal->name table)
is what D will consume — landing it now unblocks D's design without
holding back the parser registration.

5 unit tests cover the fingerprint matcher logic + a roster lock that
forces explicit consideration when adding/removing fingerprints.

Precommit green.
This commit is contained in:
MattJackson
2026-05-10 15:22:11 -07:00
parent 4ec75a03f2
commit fdbe469d50
2 changed files with 428 additions and 1 deletions
+7 -1
View File
@@ -11,6 +11,7 @@ pub(crate) mod class_reader;
mod criterion;
mod ctrm;
mod dbp;
mod deluxe;
pub(crate) mod jar;
mod paramount;
mod pixelogic;
@@ -89,7 +90,12 @@ const PARSERS: &[(&str, DetectFn, ParseFn)] = &[
// earlier parsers' fast file-presence detects short-circuit and
// dbp only runs on discs that fell through everything else.
("dbp", dbp::detect, dbp::parse),
// ("deluxe", deluxe::detect, deluxe::parse), // TODO: bytecode parser
// deluxe last for the same reason as dbp: its detect() triggers
// on any top-level .jar (every BD-J disc), and parse() does the
// real `com/bydeluxe/` check. Phase A (master enum identification)
// shipped 2026-05-10; phases B/C/D (per-stream binding decoder)
// pending.
("deluxe", deluxe::detect, deluxe::parse),
];
/// Search disc for config files, extract labels, apply to streams.