From 87ff588990bc6caa98fe7cad93d1855fde9330b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 15:52:39 +0000 Subject: [PATCH 1/3] chore(deps): update rtissera/libchdr digest to 8e7b8bd --- package/libchdr/libchdr.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/libchdr/libchdr.mk b/package/libchdr/libchdr.mk index fb697388..f897649d 100644 --- a/package/libchdr/libchdr.mk +++ b/package/libchdr/libchdr.mk @@ -77,7 +77,7 @@ # project() still says 0.3.0, so this still produces libchdr.so.0.3 with # SONAME libchdr.so.0 (re-verified at the 2026-08-24 bump by cross-building # the pinned+patched source and reading the .so's SONAME). -LIBCHDR_VERSION = 970a0ce060c0aa1012b1eebba1433c9a9e8ac8b9 +LIBCHDR_VERSION = 8e7b8bd32bc676b7e5c6b42fe7d2daca986c4a0d LIBCHDR_SITE = $(call github,rtissera,libchdr,$(LIBCHDR_VERSION)) # LICENSE.txt is the standard BSD 3-clause text ("Copyright Romain # Tisserand", the three numbered conditions, the all-caps disclaimer -- From dcdebae7e51adfc4822da8fa621c7a24f5f2fb02 Mon Sep 17 00:00:00 2001 From: "renovate-hash-sync[bot]" Date: Tue, 15 Sep 2026 15:53:02 +0000 Subject: [PATCH 2/3] renovate-hash-sync: refresh companion hash(es) for this PR Recomputed from a freshly-fetched artifact: - driver/firmware/libchdr package pins: sha256sum of the github archive tarball at the new pinned owner/repo/ref (same "locally computed" practice this tree's own .hash file headers already document) - kernel pins (stable 6.18.y and the RT/beta 7.2 line): kernel.org's signed sha256sums.asc for each pin's own vN.x series. An -rc is never refreshed here -- no signed manifest exists for one - ip7z/7zip pins (lzma-sdk, 7zip): sha256sum of the release ASSET for the new version (upstream publishes no checksums at all -- see package/lzma-sdk/lzma-sdk.hash's header), PLUS the files each package's *_LICENSE_FILES names, hashed from that same asset. A changed license file is refreshed AND diffed into the step log with a ::warning:: -- read that diff before merging; it is the only thing standing between an automated hash refresh and a silent relicense - sdcard payload pins (update_all.sh, wifi.sh): sha256 + size of the raw file at the new pinned commit, rewritten in place in scripts/fetch-sdcard-payload.sh - Buildroot pin (BUILDROOT_SHA256, root Makefile): transcribed from buildroot.org's GPG-signed release manifest (buildroot-.tar.gz.sign) -- the same signed file `make buildroot-showsig` prints, never a locally-computed sha256sum of the tarball (that remains forbidden; see the Makefile's own header comment) - azcopy pin: REBUILT, not fetched. Buildroot's own support/download/go-post-process re-ran `go mod vendor` over the newly pinned tag with the Go version the pinned Buildroot tree pins, and the resulting azcopy--go2.tar.gz was hashed -- the only way this value can be derived, since no URL serves that file (see package/azcopy/azcopy.hash's header). LICENSE and NOTICE.txt were re-hashed from the same tarball --- package/libchdr/libchdr.hash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/libchdr/libchdr.hash b/package/libchdr/libchdr.hash index 8990094e..d30a0c81 100644 --- a/package/libchdr/libchdr.hash +++ b/package/libchdr/libchdr.hash @@ -11,7 +11,7 @@ # touch a comment, so a literal here goes stale on the first automatic bump. # Both of these had (they still named the 04a177ee pin, two bumps back), as # did the "verified at pin time (2026-07-17)" date this replaces. -sha256 6b7a04ae29ad497dcae4a0f918b289df7df95eea6dd2deed8c420b2ee2c481cd libchdr-970a0ce060c0aa1012b1eebba1433c9a9e8ac8b9.tar.gz +sha256 04d6c61946c95addb78f4554740283b93249b81d8437e3d8a58ca1899c824dcc libchdr-8e7b8bd32bc676b7e5c6b42fe7d2daca986c4a0d.tar.gz # LICENSE.txt -- the BSD-3-Clause text; see the LIBCHDR_LICENSE comment in # the .mk (the bundled dr_flac's public-domain/MIT-0 statements live inside # include/dr_libs/dr_flac.h itself, no separate file exists to hash) From 2140e78d0540cb47450aaa665394d9f62ebcd8c9 Mon Sep 17 00:00:00 2001 From: "Michael C. Ferguson" Date: Tue, 15 Sep 2026 12:46:37 -0500 Subject: [PATCH 3/3] libchdr: drop 0005 as upstreamed (crc16 slicing-by-4) The Renovate digest bump (87ff588) left patch 0005 targeting the OLD tree, and the build failed closed at Patching (run 34991412000, 0005 hunk #1). Between 970a0ce and 8e7b8bd upstream landed the same slicing-by-4 rewrite of crc16_update() in e24e526be8 ("Fold four bytes per iteration in the hunk CRC", merged via rtissera/libchdr PR #180), making patch 0005 redundant. - 0005 DROPPED, per its own "Drop 0005 when upstream carries it" instruction in libchdr.mk. Upstream's version keeps the three companion tables and the four-bytes-per-iteration loop (with slightly different casts/comments, which is why the hunk failed rather than applying as already-applied). The 0004/0005 numbering gaps are deliberate. - 0001/0003 (WITH_SYSTEM_LZMA unbundling): contexts regenerated against the new tree so they apply at zero offset; content unchanged. 0002 still applies at line 3 (CRLF payload, untouched). Verified against GNU patch with Buildroot's apply-patches.sh flags (-F0 -g0 -p1 -t -N via stdin): all three remaining patches apply at zero fuzz and zero offset to a pristine 8e7b8bd tree. LICENSE.txt is unchanged upstream, so the .hash license line stands; the tarball line was already refreshed by hash-sync (dcdebae). --- ...01-cmake-add-WITH_SYSTEM_LZMA-option.patch | 4 +- ...chd-drop-redundant-deps-lzma-include.patch | 4 +- .../libchdr/0005-chd-crc16-slicing-by-4.patch | 184 ------------------ package/libchdr/libchdr.mk | 47 +++-- 4 files changed, 26 insertions(+), 213 deletions(-) delete mode 100644 package/libchdr/0005-chd-crc16-slicing-by-4.patch diff --git a/package/libchdr/0001-cmake-add-WITH_SYSTEM_LZMA-option.patch b/package/libchdr/0001-cmake-add-WITH_SYSTEM_LZMA-option.patch index b2e9508a..51cc630f 100644 --- a/package/libchdr/0001-cmake-add-WITH_SYSTEM_LZMA-option.patch +++ b/package/libchdr/0001-cmake-add-WITH_SYSTEM_LZMA-option.patch @@ -34,7 +34,7 @@ sent. diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -8,6 +8,7 @@ endif() +@@ -8,6 +8,7 @@ option(INSTALL_STATIC_LIBS "Install static libraries" OFF) option(WITH_SYSTEM_ZLIB "Use system provided zlib library" OFF) option(WITH_SYSTEM_ZSTD "Use system provided zstd library" OFF) @@ -42,7 +42,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt option(CHDR_WANT_RAW_DATA_SECTOR "Output ECC data and sync header" ON) option(CHDR_WANT_SUBCODE "Output CD subchannel data" ON) option(CHDR_VERIFY_BLOCK_CRC "Verify integrity of decoded data" ON) -@@ -42,10 +43,17 @@ include(GNUInstallDirs) +@@ -66,10 +67,17 @@ #-------------------------------------------------- # lzma diff --git a/package/libchdr/0003-chd-drop-redundant-deps-lzma-include.patch b/package/libchdr/0003-chd-drop-redundant-deps-lzma-include.patch index 01f17a87..bbc8f22d 100644 --- a/package/libchdr/0003-chd-drop-redundant-deps-lzma-include.patch +++ b/package/libchdr/0003-chd-drop-redundant-deps-lzma-include.patch @@ -2,7 +2,7 @@ libchdr_chd: drop the redundant vendored LzmaDec.h include Companion to patches 0001/0002, and the last hardcoded deps/ reference on the lzma path. src/libchdr_chd.c includes -"../deps/lzma-26.02/include/LzmaDec.h" a second time at line 76, six +"../deps/lzma-26.02/include/LzmaDec.h" a second time at line 77, six lines after it already pulled in "codec_lzma.h" (which provides LzmaDec.h itself -- system or vendored, correctly selected by patch 0002). Under WITH_SYSTEM_LZMA this duplicate would re-open the vendored @@ -25,7 +25,7 @@ sent. diff --git a/src/libchdr_chd.c b/src/libchdr_chd.c --- a/src/libchdr_chd.c +++ b/src/libchdr_chd.c -@@ -73,8 +73,6 @@ +@@ -74,8 +74,6 @@ #include "../include/libchdr/huffman.h" #include "../include/libchdr/macros.h" diff --git a/package/libchdr/0005-chd-crc16-slicing-by-4.patch b/package/libchdr/0005-chd-crc16-slicing-by-4.patch deleted file mode 100644 index 568d3005..00000000 --- a/package/libchdr/0005-chd-crc16-slicing-by-4.patch +++ /dev/null @@ -1,184 +0,0 @@ -chd: compute crc16 four bytes at a time (slicing-by-4) - -crc16() is byte-at-a-time table lookup and runs on EVERY hunk read -- -hunk_read_compressed() verifies the block CRC on each decompressed hunk -under VERIFY_BLOCK_CRC, which defaults to 1. For CD images that is a -19,584-byte pass per hunk, on top of the codec. - -Slicing-by-4 is the standard transformation: three companion tables, each -derived from the one before it by - - s_tableN[i] = (s_tableN-1[i] << 8) ^ s_table[s_tableN-1[i] >> 8] - -let four input bytes be folded per iteration instead of one. Same -polynomial, same initial value, same result. The tables are static const -(1.5 kB of extra .rodata), so there is no initialiser and no thread-safety -question. It is plain C -- no intrinsics, no runtime dispatch -- so every -target benefits, not just the ones with SIMD. - -Measured on a DE10-Nano (Cortex-A9, ARM32, -O2), 19,584-byte hunks: - - bytewise 299.6 us/hunk 65.4 MB/s - slicing-by-4 127.0 us/hunk 154.2 MB/s 2.36x - -End to end on the same board, decoding a Sonic CD .chd through chd_read(), -comparing whole disc runs: - - audio hunks (cdfl) p50 2,212 -> 1,894 us p90 2,698 -> 2,176 us - data hunks (cdlz) p50 4,483 -> 4,343 us - -Audio gains most because its FLAC base decoder is already fast, so the CRC -is a larger share of the hunk; LZMA-dominated data hunks move less. - -Correctness verified rather than assumed: all 31,984 hunks of the test image -decode with 0 failures and the FNV-1a over every decoded byte is unchanged at -ab0ea6b040de538a. A wrong CRC would fail every hunk, since hunk_read_compressed -returns CHDERR_DECOMPRESSION_ERROR on mismatch. - -Rebase note (2026-08-24, pin fa33041): upstream's CHDR_LOWRAM_MAP work -split crc16() into a continuable crc16_update(crc, data, length) plus a -crc16() wrapper, so the map CRC can be verified chunk by chunk without -materializing the whole map. The slicing loop lands inside crc16_update -unchanged: it is initial-value-agnostic (each step only folds the running -crc through the same tables the bytewise loop uses), so continuation calls -compose exactly as bytewise ones do and the chunked map path gains the same -speedup. Re-verified at rebase time with a host harness: 2000 random -buffers, whole-buffer vs random-split continuation vs the 12-byte -map-entry pattern, all byte-exact against the pristine bytewise -implementation. The DE10-Nano timings above predate the rebase (measured -at pin 6cde534); the loop is unchanged, so they carry. - -Upstream status: candidate for upstreaming, not yet sent. - -diff --git a/src/libchdr_chd.c b/src/libchdr_chd.c ---- a/src/libchdr_chd.c -+++ b/src/libchdr_chd.c -@@ -700,9 +700,127 @@ static uint16_t crc16_update(uint16_t crc, const void *data, uint32_t length) - 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 - }; - -+ /* Slicing-by-4 companions to s_table, each derived from the previous by -+ s_tableN[i] = (s_tableN-1[i] << 8) ^ s_table[s_tableN-1[i] >> 8]. -+ Same polynomial and same result, four bytes per iteration not one. */ -+ static const uint16_t s_table1[256] = -+ { -+ 0x0000, 0x3331, 0x6662, 0x5553, 0xccc4, 0xfff5, 0xaaa6, 0x9997, -+ 0x89a9, 0xba98, 0xefcb, 0xdcfa, 0x456d, 0x765c, 0x230f, 0x103e, -+ 0x0373, 0x3042, 0x6511, 0x5620, 0xcfb7, 0xfc86, 0xa9d5, 0x9ae4, -+ 0x8ada, 0xb9eb, 0xecb8, 0xdf89, 0x461e, 0x752f, 0x207c, 0x134d, -+ 0x06e6, 0x35d7, 0x6084, 0x53b5, 0xca22, 0xf913, 0xac40, 0x9f71, -+ 0x8f4f, 0xbc7e, 0xe92d, 0xda1c, 0x438b, 0x70ba, 0x25e9, 0x16d8, -+ 0x0595, 0x36a4, 0x63f7, 0x50c6, 0xc951, 0xfa60, 0xaf33, 0x9c02, -+ 0x8c3c, 0xbf0d, 0xea5e, 0xd96f, 0x40f8, 0x73c9, 0x269a, 0x15ab, -+ 0x0dcc, 0x3efd, 0x6bae, 0x589f, 0xc108, 0xf239, 0xa76a, 0x945b, -+ 0x8465, 0xb754, 0xe207, 0xd136, 0x48a1, 0x7b90, 0x2ec3, 0x1df2, -+ 0x0ebf, 0x3d8e, 0x68dd, 0x5bec, 0xc27b, 0xf14a, 0xa419, 0x9728, -+ 0x8716, 0xb427, 0xe174, 0xd245, 0x4bd2, 0x78e3, 0x2db0, 0x1e81, -+ 0x0b2a, 0x381b, 0x6d48, 0x5e79, 0xc7ee, 0xf4df, 0xa18c, 0x92bd, -+ 0x8283, 0xb1b2, 0xe4e1, 0xd7d0, 0x4e47, 0x7d76, 0x2825, 0x1b14, -+ 0x0859, 0x3b68, 0x6e3b, 0x5d0a, 0xc49d, 0xf7ac, 0xa2ff, 0x91ce, -+ 0x81f0, 0xb2c1, 0xe792, 0xd4a3, 0x4d34, 0x7e05, 0x2b56, 0x1867, -+ 0x1b98, 0x28a9, 0x7dfa, 0x4ecb, 0xd75c, 0xe46d, 0xb13e, 0x820f, -+ 0x9231, 0xa100, 0xf453, 0xc762, 0x5ef5, 0x6dc4, 0x3897, 0x0ba6, -+ 0x18eb, 0x2bda, 0x7e89, 0x4db8, 0xd42f, 0xe71e, 0xb24d, 0x817c, -+ 0x9142, 0xa273, 0xf720, 0xc411, 0x5d86, 0x6eb7, 0x3be4, 0x08d5, -+ 0x1d7e, 0x2e4f, 0x7b1c, 0x482d, 0xd1ba, 0xe28b, 0xb7d8, 0x84e9, -+ 0x94d7, 0xa7e6, 0xf2b5, 0xc184, 0x5813, 0x6b22, 0x3e71, 0x0d40, -+ 0x1e0d, 0x2d3c, 0x786f, 0x4b5e, 0xd2c9, 0xe1f8, 0xb4ab, 0x879a, -+ 0x97a4, 0xa495, 0xf1c6, 0xc2f7, 0x5b60, 0x6851, 0x3d02, 0x0e33, -+ 0x1654, 0x2565, 0x7036, 0x4307, 0xda90, 0xe9a1, 0xbcf2, 0x8fc3, -+ 0x9ffd, 0xaccc, 0xf99f, 0xcaae, 0x5339, 0x6008, 0x355b, 0x066a, -+ 0x1527, 0x2616, 0x7345, 0x4074, 0xd9e3, 0xead2, 0xbf81, 0x8cb0, -+ 0x9c8e, 0xafbf, 0xfaec, 0xc9dd, 0x504a, 0x637b, 0x3628, 0x0519, -+ 0x10b2, 0x2383, 0x76d0, 0x45e1, 0xdc76, 0xef47, 0xba14, 0x8925, -+ 0x991b, 0xaa2a, 0xff79, 0xcc48, 0x55df, 0x66ee, 0x33bd, 0x008c, -+ 0x13c1, 0x20f0, 0x75a3, 0x4692, 0xdf05, 0xec34, 0xb967, 0x8a56, -+ 0x9a68, 0xa959, 0xfc0a, 0xcf3b, 0x56ac, 0x659d, 0x30ce, 0x03ff -+ }; -+ static const uint16_t s_table2[256] = -+ { -+ 0x0000, 0x3730, 0x6e60, 0x5950, 0xdcc0, 0xebf0, 0xb2a0, 0x8590, -+ 0xa9a1, 0x9e91, 0xc7c1, 0xf0f1, 0x7561, 0x4251, 0x1b01, 0x2c31, -+ 0x4363, 0x7453, 0x2d03, 0x1a33, 0x9fa3, 0xa893, 0xf1c3, 0xc6f3, -+ 0xeac2, 0xddf2, 0x84a2, 0xb392, 0x3602, 0x0132, 0x5862, 0x6f52, -+ 0x86c6, 0xb1f6, 0xe8a6, 0xdf96, 0x5a06, 0x6d36, 0x3466, 0x0356, -+ 0x2f67, 0x1857, 0x4107, 0x7637, 0xf3a7, 0xc497, 0x9dc7, 0xaaf7, -+ 0xc5a5, 0xf295, 0xabc5, 0x9cf5, 0x1965, 0x2e55, 0x7705, 0x4035, -+ 0x6c04, 0x5b34, 0x0264, 0x3554, 0xb0c4, 0x87f4, 0xdea4, 0xe994, -+ 0x1dad, 0x2a9d, 0x73cd, 0x44fd, 0xc16d, 0xf65d, 0xaf0d, 0x983d, -+ 0xb40c, 0x833c, 0xda6c, 0xed5c, 0x68cc, 0x5ffc, 0x06ac, 0x319c, -+ 0x5ece, 0x69fe, 0x30ae, 0x079e, 0x820e, 0xb53e, 0xec6e, 0xdb5e, -+ 0xf76f, 0xc05f, 0x990f, 0xae3f, 0x2baf, 0x1c9f, 0x45cf, 0x72ff, -+ 0x9b6b, 0xac5b, 0xf50b, 0xc23b, 0x47ab, 0x709b, 0x29cb, 0x1efb, -+ 0x32ca, 0x05fa, 0x5caa, 0x6b9a, 0xee0a, 0xd93a, 0x806a, 0xb75a, -+ 0xd808, 0xef38, 0xb668, 0x8158, 0x04c8, 0x33f8, 0x6aa8, 0x5d98, -+ 0x71a9, 0x4699, 0x1fc9, 0x28f9, 0xad69, 0x9a59, 0xc309, 0xf439, -+ 0x3b5a, 0x0c6a, 0x553a, 0x620a, 0xe79a, 0xd0aa, 0x89fa, 0xbeca, -+ 0x92fb, 0xa5cb, 0xfc9b, 0xcbab, 0x4e3b, 0x790b, 0x205b, 0x176b, -+ 0x7839, 0x4f09, 0x1659, 0x2169, 0xa4f9, 0x93c9, 0xca99, 0xfda9, -+ 0xd198, 0xe6a8, 0xbff8, 0x88c8, 0x0d58, 0x3a68, 0x6338, 0x5408, -+ 0xbd9c, 0x8aac, 0xd3fc, 0xe4cc, 0x615c, 0x566c, 0x0f3c, 0x380c, -+ 0x143d, 0x230d, 0x7a5d, 0x4d6d, 0xc8fd, 0xffcd, 0xa69d, 0x91ad, -+ 0xfeff, 0xc9cf, 0x909f, 0xa7af, 0x223f, 0x150f, 0x4c5f, 0x7b6f, -+ 0x575e, 0x606e, 0x393e, 0x0e0e, 0x8b9e, 0xbcae, 0xe5fe, 0xd2ce, -+ 0x26f7, 0x11c7, 0x4897, 0x7fa7, 0xfa37, 0xcd07, 0x9457, 0xa367, -+ 0x8f56, 0xb866, 0xe136, 0xd606, 0x5396, 0x64a6, 0x3df6, 0x0ac6, -+ 0x6594, 0x52a4, 0x0bf4, 0x3cc4, 0xb954, 0x8e64, 0xd734, 0xe004, -+ 0xcc35, 0xfb05, 0xa255, 0x9565, 0x10f5, 0x27c5, 0x7e95, 0x49a5, -+ 0xa031, 0x9701, 0xce51, 0xf961, 0x7cf1, 0x4bc1, 0x1291, 0x25a1, -+ 0x0990, 0x3ea0, 0x67f0, 0x50c0, 0xd550, 0xe260, 0xbb30, 0x8c00, -+ 0xe352, 0xd462, 0x8d32, 0xba02, 0x3f92, 0x08a2, 0x51f2, 0x66c2, -+ 0x4af3, 0x7dc3, 0x2493, 0x13a3, 0x9633, 0xa103, 0xf853, 0xcf63 -+ }; -+ static const uint16_t s_table3[256] = -+ { -+ 0x0000, 0x76b4, 0xed68, 0x9bdc, 0xcaf1, 0xbc45, 0x2799, 0x512d, -+ 0x85c3, 0xf377, 0x68ab, 0x1e1f, 0x4f32, 0x3986, 0xa25a, 0xd4ee, -+ 0x1ba7, 0x6d13, 0xf6cf, 0x807b, 0xd156, 0xa7e2, 0x3c3e, 0x4a8a, -+ 0x9e64, 0xe8d0, 0x730c, 0x05b8, 0x5495, 0x2221, 0xb9fd, 0xcf49, -+ 0x374e, 0x41fa, 0xda26, 0xac92, 0xfdbf, 0x8b0b, 0x10d7, 0x6663, -+ 0xb28d, 0xc439, 0x5fe5, 0x2951, 0x787c, 0x0ec8, 0x9514, 0xe3a0, -+ 0x2ce9, 0x5a5d, 0xc181, 0xb735, 0xe618, 0x90ac, 0x0b70, 0x7dc4, -+ 0xa92a, 0xdf9e, 0x4442, 0x32f6, 0x63db, 0x156f, 0x8eb3, 0xf807, -+ 0x6e9c, 0x1828, 0x83f4, 0xf540, 0xa46d, 0xd2d9, 0x4905, 0x3fb1, -+ 0xeb5f, 0x9deb, 0x0637, 0x7083, 0x21ae, 0x571a, 0xccc6, 0xba72, -+ 0x753b, 0x038f, 0x9853, 0xeee7, 0xbfca, 0xc97e, 0x52a2, 0x2416, -+ 0xf0f8, 0x864c, 0x1d90, 0x6b24, 0x3a09, 0x4cbd, 0xd761, 0xa1d5, -+ 0x59d2, 0x2f66, 0xb4ba, 0xc20e, 0x9323, 0xe597, 0x7e4b, 0x08ff, -+ 0xdc11, 0xaaa5, 0x3179, 0x47cd, 0x16e0, 0x6054, 0xfb88, 0x8d3c, -+ 0x4275, 0x34c1, 0xaf1d, 0xd9a9, 0x8884, 0xfe30, 0x65ec, 0x1358, -+ 0xc7b6, 0xb102, 0x2ade, 0x5c6a, 0x0d47, 0x7bf3, 0xe02f, 0x969b, -+ 0xdd38, 0xab8c, 0x3050, 0x46e4, 0x17c9, 0x617d, 0xfaa1, 0x8c15, -+ 0x58fb, 0x2e4f, 0xb593, 0xc327, 0x920a, 0xe4be, 0x7f62, 0x09d6, -+ 0xc69f, 0xb02b, 0x2bf7, 0x5d43, 0x0c6e, 0x7ada, 0xe106, 0x97b2, -+ 0x435c, 0x35e8, 0xae34, 0xd880, 0x89ad, 0xff19, 0x64c5, 0x1271, -+ 0xea76, 0x9cc2, 0x071e, 0x71aa, 0x2087, 0x5633, 0xcdef, 0xbb5b, -+ 0x6fb5, 0x1901, 0x82dd, 0xf469, 0xa544, 0xd3f0, 0x482c, 0x3e98, -+ 0xf1d1, 0x8765, 0x1cb9, 0x6a0d, 0x3b20, 0x4d94, 0xd648, 0xa0fc, -+ 0x7412, 0x02a6, 0x997a, 0xefce, 0xbee3, 0xc857, 0x538b, 0x253f, -+ 0xb3a4, 0xc510, 0x5ecc, 0x2878, 0x7955, 0x0fe1, 0x943d, 0xe289, -+ 0x3667, 0x40d3, 0xdb0f, 0xadbb, 0xfc96, 0x8a22, 0x11fe, 0x674a, -+ 0xa803, 0xdeb7, 0x456b, 0x33df, 0x62f2, 0x1446, 0x8f9a, 0xf92e, -+ 0x2dc0, 0x5b74, 0xc0a8, 0xb61c, 0xe731, 0x9185, 0x0a59, 0x7ced, -+ 0x84ea, 0xf25e, 0x6982, 0x1f36, 0x4e1b, 0x38af, 0xa373, 0xd5c7, -+ 0x0129, 0x779d, 0xec41, 0x9af5, 0xcbd8, 0xbd6c, 0x26b0, 0x5004, -+ 0x9f4d, 0xe9f9, 0x7225, 0x0491, 0x55bc, 0x2308, 0xb8d4, 0xce60, -+ 0x1a8e, 0x6c3a, 0xf7e6, 0x8152, 0xd07f, 0xa6cb, 0x3d17, 0x4ba3 -+ }; -+ - const uint8_t *src = (uint8_t*)data; - -- /* rip through the source data */ -+ /* rip through the source data four bytes at a time, then any tail */ -+ while (length >= 4) -+ { -+ const uint8_t i0 = (uint8_t)((crc >> 8) ^ src[0]); -+ const uint8_t i1 = (uint8_t)((crc & 0xff) ^ src[1]); -+ -+ crc = s_table3[i0] ^ s_table2[i1] ^ s_table1[src[2]] ^ s_table[src[3]]; -+ src += 4; -+ length -= 4; -+ } - while (length-- != 0) - crc = (crc << 8) ^ s_table[(crc >> 8) ^ *src++]; - return crc; diff --git a/package/libchdr/libchdr.mk b/package/libchdr/libchdr.mk index f897649d..a7b52c20 100644 --- a/package/libchdr/libchdr.mk +++ b/package/libchdr/libchdr.mk @@ -31,21 +31,21 @@ # recover it from git history at this file's 2026-08-24 change if it is # ever needed again. # -# PATCH 0005 is a performance change, not a correctness one. crc16 is -# byte-at-a-time and runs on EVERY hunk read (VERIFY_BLOCK_CRC defaults to 1), -# which for a CD image is a 19,584-byte pass per hunk on top of the codec. -# Slicing-by-4 folds four bytes per iteration from three derived tables; same -# polynomial, same result, 1.5 kB more .rodata, plain C so every target gains. -# Measured on the DE10-Nano: 299.6 -> 127.0 us per hunk (2.36x), and end to end -# through chd_read() the audio hunks of a Sonic CD .chd go p50 2,212 -> 1,894 us -# and p90 2,698 -> 2,176 us. Verified byte-exact: all 31,984 hunks decode with 0 -# failures and an unchanged FNV-1a over every decoded byte. Rebased 2026-08-24 -# onto this pin's crc16_update() split (upstream's CHDR_LOWRAM_MAP work made -# the CRC continuable; the slicing loop is initial-value-agnostic so it drops -# in unchanged -- see the patch's rebase note). Drop 0005 when upstream -# carries it. The gap in the numbering is deliberate, not an error: 0004 was -# dropped as upstreamed (above) and renaming this file would orphan its -# history and every reference to it. +# FORMER PATCH 0005 (crc16 slicing-by-4) WAS DROPPED 2026-09-15, exactly +# as its own instruction said to ("Drop 0005 when upstream carries it"): +# upstream landed the same four-bytes-per-iteration rewrite of +# crc16_update() in commit e24e526be8 ("Fold four bytes per iteration in +# the hunk CRC", merged via rtissera/libchdr PR #180), which this pin +# carries. +# Upstream's version keeps the three companion tables and the slicing +# loop (with slightly different casts and an RV32-oriented comment), so +# the hunk failed to apply rather than applying as already-applied. The +# DE10-Nano timings (299.6 -> 127.0 us/hunk, Sonic CD audio p50 2,212 -> +# 1,894 us) live in that patch's header; recover it from git history at +# this file's 2026-09-15 change if it is ever needed again. The gaps in +# the numbering (0004 and 0005) are deliberate, not an error: both were +# dropped as upstreamed and renaming the remaining 0001-0003 files would +# orphan their history and every reference to them. # # ONE DEP STAYS BUNDLED, DELIBERATELY: the header-only dr_flac decoder # (include/dr_libs/dr_flac.h) is compiled into the library by src/ @@ -64,16 +64,13 @@ # expecting zstd's CMake config package -- which Buildroot's zstd package # (Makefile-installed, ships only libzstd.pc, no *.cmake) does not provide, # so configure FAILS at the tag. The pin (upstream master HEAD at bump time; -# Renovate PR #115, 2026-08-24, previously 6cde534 of 2026-07-17) carries -# everything the old pin did (798a4f7's chd_read_header_core_file_callbacks -# fix included) plus, notably: the dictionary-clamp fix that used to be this -# package's patch 0004 (see above), a vendored LZMA SDK bump 25.01 -> 26.02 -# -- now the SAME version as the system lzma-sdk package this build links -# instead of it -- a vendored miniz bump (also unused here; system zlib), -# and new CHDR_WANT_TESTS / CHDR_LOWRAM_MAP options, both left at their -# defaults (tests build a non-installed benchmark, exactly what the old pin -# built unconditionally; LOWRAM_MAP=OFF is the old pin's behavior). -# Version/ABI are unchanged from the tag: CMake +# this Renovate PR, 2026-09-15, previously 970a0ce) carries everything the +# older pins did (798a4f7's chd_read_header_core_file_callbacks fix, the +# dictionary-clamp fix that used to be patch 0004, vendored LZMA SDK 26.02) +# plus, notably, the crc16 slicing-by-4 that used to be this package's +# patch 0005 (see above). CHDR_WANT_TESTS / CHDR_LOWRAM_MAP stay at their +# defaults (tests build a non-installed benchmark; LOWRAM_MAP=OFF is the +# old pin's behavior). Version/ABI are unchanged from the tag: CMake # project() still says 0.3.0, so this still produces libchdr.so.0.3 with # SONAME libchdr.so.0 (re-verified at the 2026-08-24 bump by cross-building # the pinned+patched source and reading the .so's SONAME).