67aa1f64b585
revert CHUNK_SIZE 1300→1024 and CODE_SIZE 72→80 — reliability over page count; keep 6×6 grid + size-agnostic decoder
- time
- 2026-05-17 17:58 UTC · 5 months ago
- machine
- koh2
- parent
- 1856fba33466
↓ peach-browser-67aa1f64.tar.gzatlas at this save
files changed2 files
src/popup/codex/pdf.ts+7 −5src/shared/codex-types.ts+11 −8src/popup/codex/pdf.ts+7 −5
@@ -34,13 +34,15 @@3434 const HEADER_HEIGHT = 44;3535 const HEADER_HAIRLINE = 0.5;3636 37-// 6×6 = 36 codes per page. CODE_SIZE chosen so the 6-row stack clears the38-// footer with ~90pt of breathing room after labels; the column-gap formula39-// adapts automatically to CODES_PER_ROW.40-const CODE_SIZE = 72;37+// 6×6 = 36 codes per page. CODE_SIZE held at 80pt to preserve the proven38+// ~0.24mm-per-module print density; the 6-row stack clears the footer with39+// ~42pt of breathing room below the last label. Shrinking CODE_SIZE to gain40+// page-count would erode print→scan reliability — explicitly not the41+// tradeoff this surface should make.42+const CODE_SIZE = 80;4143 const COL_GAP =4244 (PAGE_WIDTH - 2 * MARGIN - CODES_PER_ROW * CODE_SIZE) / (CODES_PER_ROW - 1);43-const ROW_GAP = 12;45+const ROW_GAP = 18;4446 4547 const FOOTER_HEIGHT = 32;4648 const FOOTER_HAIRLINE = 0.5;src/shared/codex-types.ts+11 −8
@@ -154,16 +154,19 @@154154 /**155155 * Bytes of binary data per chunk. Each chunk becomes one Aztec code.156156 *157- * Empirical cap at AZTEC_ECC_PERCENT=25 is ~1386 bytes (envelope ~1945 chars)158- * — beyond that bwip-js reports `aztecNoValidSymbol: Maximum length exceeded`.159- * 1300 leaves headroom for envelope-overhead drift (larger index/total fields160- * as page counts grow). DO NOT raise without re-probing bwip-js: encode a161- * full-entropy envelope and confirm it still renders.157+ * Sized for scan reliability over page-count: a 1024-byte chunk produces a158+ * ~1450-char envelope and a ~115-module Aztec symbol, which at the printed159+ * CODE_SIZE=80pt yields ~0.24mm modules — the proven density that decodes160+ * reliably from cheap laser prints, old phone cameras, and folded paper.161+ * The empirical bwip-js ceiling at eclevel=25 is ~1386 bytes, but pushing162+ * close to that shrinks per-module physical size and erodes margin in the163+ * print→scan loop. This is a disaster-recovery surface; reliability wins.162164 *163- * Old Codexes printed with a smaller chunk size still restore — the erasure164- * decoder derives shard size from the scanned chunks, not from this constant.165+ * Old Codexes printed with a different chunk size still restore — the166+ * erasure decoder derives shard size from the scanned chunks, not from167+ * this constant.165168 */166-export const CHUNK_SIZE = 1300;169+export const CHUNK_SIZE = 1024;167170 168171 /**169172 * Number of parity shards. With 2 parity shards, the Codex survives the loss