# HVC error-resilience list `hvc_err_v1`

Clean streams + one error per case; apply with `tools/err_apply.py`, run a decoder over the list with `tools/err_run.py`.
Bit 0 = MSB of the byte. `region`: header = NAL header, slice segment header incl. entry points and byte alignment, VPS / SPS / PPS, SEI and emulation prevention bytes inside headers; payload = slice data split into tile substreams by the entry points; container (not sampled) = start codes and filler NAL units. Errors are meant for the stream after decryption.

Usage: `python3 tools/err_run.py --list errors/hvc_err_v1.csv --cmd "mydec {in} {out}" --label mydec`; the result CSV has the same `id` as the list. Without `--cmd` the reference decoder is used (HM TAppDecoder).

**Decoder output.** `{out}` must receive raw planar 4:2:0 frames in display order, exactly one frame size per frame (8-bit samples, or 16-bit little-endian samples for 10-bit streams; odd sizes round the chroma planes up). A decoder that writes to stdout is used without `{out}` in the template. Frames are compared by md5 with the clean decode.

**Outcomes.** `CRASH` = killed by a signal other than SIGABRT (segfault, bus error...); `ABORT` = SIGABRT (assert / abort() on bad data - HM and JM do this); `TIMEOUT` = slower than max(--timeout, 4x the clean decode) and killed; `ERROR` = exit code != 0; `DECODED` = exit 0, with frames_mismatch / first_bad_frame / recovered_at (output index from which all frames equal the clean tail) / frames_missing. A crash inside a wrapper script shows up as ERROR with exit code 128+N. `ref_hang_confirmed` = the reference decoder still hung with a 600 s limit. Decoders run with an 8 GB address-space limit (ERR_DEC_MEM_GB): a decoder that tries to allocate more on a damaged header fails (ERROR / ABORT / CRASH) instead of exhausting the machine.

**Notes.** A payload `drop` removes a whole slice segment NAL unit including its header (`part` = obu), or a whole access unit (`part` = tu). `truncate` usually decodes with frames missing. Header bits the reference trace does not name are labelled `unknown:after=<previous field>`. `damaged_symbol`: first line of the HM symbol trace (SIG / INTRA_MODE / MPM_CAND / MDCS, CU position) that differs; HM does not trace every syntax element.

**2500 cases**

| stream | header | payload |
|---|---|---|
| `ERR/HVC/ERR_BoxingPractice/ERR_BoxingPractice_5120x1024_59p94p_10b_Main10_cbr10M_L5.1_buf44M_10.00Mbps.265` | 250 | 250 |
| `ERR/HVC/ERR_Crosswalk/ERR_Crosswalk_5120x1024_59p94p_10b_Main10_cbr10M_L5.1_buf44M_10.03Mbps.265` | 250 | 250 |
| `ERR/HVC/ERR_CrosswalkSlices/ERR_CrosswalkSlices_5120x1024_59p94p_10b_Main10_cbr10M_L5.1_buf44M_13.41Mbps.265` | 250 | 250 |
| `ERR/HVC/ERR_Long/ERR_Long_854x480_60p_10b_Main10_cbr2.5M_L3.1_buf11M_2.51Mbps.265` | 250 | 250 |
| `ERR/HVC/ERR_LongZeros/ERR_LongZeros_854x480_60p_10b_Main10_cbr2.5M_L3.1_buf11M_2.51Mbps.265` | 250 | 250 |

| kind | cases |
|---|---|
| bitflip | 1750 |
| burst | 250 |
| truncate | 250 |
| drop | 250 |

Reference decoder (HM TAppDecoder) outcomes:

| outcome | cases |
|---|---|
| ABORT | 2133 |
| DECODED | 312 |
| CRASH | 55 |

HM aborts (SIGABRT, `ABORT`) on most damaged streams instead of concealing, so its outcomes mainly say *that* the damage was detected.
