# --- P3. ROUND 16 CLOSE CONDITION, CLAUSE 2: -H WITH DE-EMPHASIS -----------
# Round 16's close condition is fixed at their lap 1 under S-13 and cannot grow.
# Clause 2 is *"`-H` together with de-emphasis produces correct de-emphasised
# audio"*, and this is the only clause no fixture on either side can reach.
#
# WHY IT NEEDS A RIG AND WHY IT NEEDS BOTH FLAGS. Their held item 2 was a filter
# string built as a ternary CASCADE, so `hdcd` matched first and `aemphasis` was
# never reached: `-H`, `-H -W` and `-H -E` produced BYTE-IDENTICAL audio, both
# the disable and the force flag inert. The log still printed
# `(deemphasis applied)` and the cue still omitted `FLAGS PRE`, because both read
# the SETTING rather than the audio — so **audio, log and cue were
# self-consistently wrong** and checking any one against another found agreement.
# That is why the grade below reads no SETTING the log echoes (`deemphasis
# applied`, `FLAGS PRE`): only two MEASUREMENTS, the read's CRC and the
# delivered audio's loudness.
#
# THE SEPARATING INPUT IS BOTH FLAGS AT ONCE, which their suite had never used.
# With only one of the two set, selecting and composing are byte-identical, so a
# single run proves nothing whichever way it comes out.
#
# `-E` FORCES DE-EMPHASIS, so this works on ANY disc — it does not need a
# pre-emphasised one, and forcing it is the same graph the TOC flag takes (their
# lap 1 §0 note 1). If the rig disc happens to carry pre-emphasis, plain `-H` is
# the stronger evidence and worth adding; on an ordinary disc `-H -E` against
# `-H -W` is the same code path and not a weaker substitute.
#
# BOUNDED ON PURPOSE. `-l 1` is one track each, so this costs minutes rather than
# a second full rip, and the `cyanrip` verb's own timeout bounds a hang exactly as
# it does in P2. `-s (offset)` is this drive's offset, set in section B; without it
# cyanrip refuses for want of one, which is P2's subject and not this one.
# `-D` takes a RELATIVE naming scheme — confirmed from their source at the pin,
# `cyanrip_main.c:1603`, `folder_scheme`, *"Directory naming scheme"* — so these
# two land beside the run's other output rather than anywhere absolute.
#
# THIS SECTION DECIDES THE CLAUSE, with `expect-deemphasis-pair` after the two
# arms, and until 2026-11-03 this comment said it could not. Two values, read
# from each arm's own log, and neither alone settles it:
#
#   * THE CHECKSUMS ARE TAKEN ON THE READ, before the filter graph: EAC CRC32
#     and both AccurateRip sums (`crip_process_checksums` at
#     `cyanrip@239adda:src/cyanrip_main.c:1680`, before
#     `cyanrip_send_pcm_to_encoders` at `:1685`). So the two arms MUST print the
#     same CRC whatever de-emphasis did. Equal CRCs say both arms read the same
#     samples, which is what makes a difference after the filter attributable to
#     it.
#   * THE LOUDNESS IS MEASURED ON THE DELIVERED AUDIO, after de-emphasis, since
#     the fork's .20 (`measure_frame`, `cyanrip@239adda:src/cyanrip_encode.c:818`,
#     fed the filter graph's output at `:909`; absent at .19's `174a134`). The
#     2026-09-22 session's P3 is what found it measured before the filter.
#
# So the grade is: every CRC agrees AND the integrated loudness differs by at
# least 0.3 LU (three times the 0.1 LU the log prints; identical delivered audio
# prints the same figure twice). The 2026-11-03 Full run on .28 read B0D122E7 for
# both arms and -20.7 LUFS forced against -19.9 disabled: 0.8 LU. A missing log,
# CRC or loudness line, or a build that measures before the filter, is BLOCKED
# (not determined), never a pass. The fork confirmed the measurement point
# (their round 37 lap 7 S4 (d), answering our lap 6 S12 (d)): loudness on what
# the encoders receive, after the filter, since .20, the checksums on the read
# buffer; the grade's answer names it.
#
# WHAT THIS COMMENT USED TO SAY, AND WHY IT WAS WRONG. Before 2026-09-11 it said
# the two arms' printed checksums MUST DIFFER, identical ones meaning the fork's
# `b866900` cascade defect was still present. They are taken before the filter,
# so they agree on every run: that rule reported a defect against the fork on a
# run where the filter worked. Then it said nothing here could decide the clause,
# which stopped being true with the fork's .20 and is what the verb now does.
#
# NEITHER OF THE TWO NEAREST READINGS WORKS, which is why the verb reads these
# two values and nothing else. `md5sum *.flac` differs for byte-identical audio,
# because a FLAC carries a creation timestamp: a false pass, from an input that
# cannot confirm. The printed CRCs agree whatever the filter did: a false
# failure, from an input that cannot refute. The fork's former round 16 rig
# script, retired in their round 38, compared decoded samples (`ffmpeg -f md5`) and
# was the stronger evidence where it was run.
#
# EVERY LOG OF A RUN NAMES ITS CALLER AND HAS A RECORD (the fork's round 32
# lap 9 S9, their data register's X8). These two rips call cyanrip directly, so
# on 2026-10-13 their logs read `Consumer: not identified (no --consumer
# given)` and they wrote no `--diagnostics` record, unlike every app rip.
# `(consumer)` and `(diagnostics)` expand to the words an app rip sends, from
# the functions its argv builder calls (`expand_identity`): `--consumer
# platterpus/<this version>` on a build known to accept it, and `--diagnostics
# cyanrip-diagnostics-<stamp>.json`, written in the rips folder where the
# session bundle collects every record.

log --- P3. R16 CC2: -H -E (forced de-emphasis) ---
run-size full
cyanrip -N -d (device) -s (offset) -l 1 -H -E -D r16deemphon (consumer) (diagnostics)
expect-exit 0
snapshot afterdeemphon

log --- P3. R16 CC2: -H -W (de-emphasis disabled), the control ---
run-size full
cyanrip -N -d (device) -s (offset) -l 1 -H -W -D r16deemphoff (consumer) (diagnostics)
expect-exit 0
snapshot afterdeemphoff
expect-deemphasis-pair r16deemphon r16deemphoff

