djvu-rs 0.28.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. djvu_rs-0.28.0/.codex/config.toml +8 -0
  2. djvu_rs-0.28.0/.config/nextest.toml +16 -0
  3. djvu_rs-0.28.0/.githooks/pre-commit +15 -0
  4. djvu_rs-0.28.0/.githooks/pre-push +5 -0
  5. djvu_rs-0.28.0/.github/ISSUE_TEMPLATE/bug_report.md +34 -0
  6. djvu_rs-0.28.0/.github/ISSUE_TEMPLATE/feature_request.md +29 -0
  7. djvu_rs-0.28.0/.github/pull_request_template.md +21 -0
  8. djvu_rs-0.28.0/.github/workflows/api-stability.yml +170 -0
  9. djvu_rs-0.28.0/.github/workflows/bench-dashboard.yml +110 -0
  10. djvu_rs-0.28.0/.github/workflows/bench.yml +554 -0
  11. djvu_rs-0.28.0/.github/workflows/ci.yml +437 -0
  12. djvu_rs-0.28.0/.github/workflows/diff.yml +112 -0
  13. djvu_rs-0.28.0/.github/workflows/fuzz.yml +87 -0
  14. djvu_rs-0.28.0/.github/workflows/publish-packages.yml +473 -0
  15. djvu_rs-0.28.0/.github/workflows/publish.yml +159 -0
  16. djvu_rs-0.28.0/.github/workflows/quality.yml +117 -0
  17. djvu_rs-0.28.0/.github/workflows/release-please.yml +89 -0
  18. djvu_rs-0.28.0/.github/workflows/sanitizers.yml +103 -0
  19. djvu_rs-0.28.0/.gitignore +63 -0
  20. djvu_rs-0.28.0/.release-please-manifest.json +3 -0
  21. djvu_rs-0.28.0/AGENTS.md +7 -0
  22. djvu_rs-0.28.0/CHANGELOG.md +1210 -0
  23. djvu_rs-0.28.0/CLAUDE.md +28 -0
  24. djvu_rs-0.28.0/CONTEXT.md +45 -0
  25. djvu_rs-0.28.0/CONTRIBUTING.md +156 -0
  26. djvu_rs-0.28.0/Cargo.lock +2911 -0
  27. djvu_rs-0.28.0/Cargo.toml +288 -0
  28. djvu_rs-0.28.0/EXPERIMENTS_INDEX.md +448 -0
  29. djvu_rs-0.28.0/LICENSE +21 -0
  30. djvu_rs-0.28.0/Makefile +37 -0
  31. djvu_rs-0.28.0/PERF_EXPERIMENTS.md +13379 -0
  32. djvu_rs-0.28.0/PKG-INFO +99 -0
  33. djvu_rs-0.28.0/README.md +803 -0
  34. djvu_rs-0.28.0/RELEASING.md +101 -0
  35. djvu_rs-0.28.0/SECURITY.md +69 -0
  36. djvu_rs-0.28.0/SOURCES.md +30 -0
  37. djvu_rs-0.28.0/_pr_assets/fg_bicubic_colorbook_p0_2.4x_bicubic.png +0 -0
  38. djvu_rs-0.28.0/_pr_assets/fg_bicubic_colorbook_p0_2.4x_bilinear.png +0 -0
  39. djvu_rs-0.28.0/_pr_assets/fg_bicubic_colorbook_p0_2x_bicubic.png +0 -0
  40. djvu_rs-0.28.0/_pr_assets/fg_bicubic_colorbook_p0_2x_bilinear.png +0 -0
  41. djvu_rs-0.28.0/_pr_assets/fg_bicubic_colorbook_p1_2x_bicubic.png +0 -0
  42. djvu_rs-0.28.0/_pr_assets/fg_bicubic_colorbook_p1_2x_bilinear.png +0 -0
  43. djvu_rs-0.28.0/_pr_assets/mask_aa_2x_aa.png +0 -0
  44. djvu_rs-0.28.0/_pr_assets/mask_aa_2x_nearest.png +0 -0
  45. djvu_rs-0.28.0/_pr_assets/mask_aa_4x_aa.png +0 -0
  46. djvu_rs-0.28.0/_pr_assets/mask_aa_4x_nearest.png +0 -0
  47. djvu_rs-0.28.0/_pr_assets/synthetic_exact_crop.png +0 -0
  48. djvu_rs-0.28.0/_pr_assets/synthetic_mediancut32_crop.png +0 -0
  49. djvu_rs-0.28.0/_pr_assets/synthetic_mediancut6_crop.png +0 -0
  50. djvu_rs-0.28.0/_pr_assets/synthetic_source_crop.png +0 -0
  51. djvu_rs-0.28.0/cbindgen.toml +13 -0
  52. djvu_rs-0.28.0/conformance/accepted_differences.json +32 -0
  53. djvu_rs-0.28.0/conformance/corpus.json +20 -0
  54. djvu_rs-0.28.0/crates/djvu-bitmap/Cargo.toml +17 -0
  55. djvu_rs-0.28.0/crates/djvu-bitmap/README.md +9 -0
  56. djvu_rs-0.28.0/crates/djvu-bitmap/src/lib.rs +361 -0
  57. djvu_rs-0.28.0/crates/djvu-bzz/Cargo.toml +23 -0
  58. djvu_rs-0.28.0/crates/djvu-bzz/README.md +14 -0
  59. djvu_rs-0.28.0/crates/djvu-bzz/src/decode.rs +630 -0
  60. djvu_rs-0.28.0/crates/djvu-bzz/src/encode.rs +565 -0
  61. djvu_rs-0.28.0/crates/djvu-bzz/src/lib.rs +60 -0
  62. djvu_rs-0.28.0/crates/djvu-iff/Cargo.toml +20 -0
  63. djvu_rs-0.28.0/crates/djvu-iff/README.md +9 -0
  64. djvu_rs-0.28.0/crates/djvu-iff/src/lib.rs +1655 -0
  65. djvu_rs-0.28.0/crates/djvu-iw44/Cargo.toml +32 -0
  66. djvu_rs-0.28.0/crates/djvu-iw44/README.md +9 -0
  67. djvu_rs-0.28.0/crates/djvu-iw44/src/encode.rs +2889 -0
  68. djvu_rs-0.28.0/crates/djvu-iw44/src/lib.rs +4755 -0
  69. djvu_rs-0.28.0/crates/djvu-jb2/Cargo.toml +33 -0
  70. djvu_rs-0.28.0/crates/djvu-jb2/README.md +9 -0
  71. djvu_rs-0.28.0/crates/djvu-jb2/src/encode.rs +3665 -0
  72. djvu_rs-0.28.0/crates/djvu-jb2/src/lib.rs +2582 -0
  73. djvu_rs-0.28.0/crates/djvu-jb2/tests/dos_bounds.rs +19 -0
  74. djvu_rs-0.28.0/crates/djvu-jb2/tests/fixtures/page_cap_timeout.bin +0 -0
  75. djvu_rs-0.28.0/crates/djvu-pixmap/Cargo.toml +17 -0
  76. djvu_rs-0.28.0/crates/djvu-pixmap/README.md +9 -0
  77. djvu_rs-0.28.0/crates/djvu-pixmap/src/lib.rs +365 -0
  78. djvu_rs-0.28.0/crates/djvu-zp/Cargo.toml +22 -0
  79. djvu_rs-0.28.0/crates/djvu-zp/README.md +56 -0
  80. djvu_rs-0.28.0/crates/djvu-zp/src/encoder.rs +403 -0
  81. djvu_rs-0.28.0/crates/djvu-zp/src/lib.rs +362 -0
  82. djvu_rs-0.28.0/crates/djvu-zp/src/tables.rs +154 -0
  83. djvu_rs-0.28.0/deny.toml +45 -0
  84. djvu_rs-0.28.0/djvu-py/Cargo.toml +20 -0
  85. djvu_rs-0.28.0/djvu-py/Makefile +26 -0
  86. djvu_rs-0.28.0/djvu-py/README.md +69 -0
  87. djvu_rs-0.28.0/djvu-py/src/lib.rs +453 -0
  88. djvu_rs-0.28.0/djvu-py/tests/conftest.py +52 -0
  89. djvu_rs-0.28.0/djvu-py/tests/test_buffer_protocol.py +151 -0
  90. djvu_rs-0.28.0/djvu-py/tests/test_document.py +102 -0
  91. djvu_rs-0.28.0/djvu-py/tests/test_gil.py +68 -0
  92. djvu_rs-0.28.0/djvu-py/tests/test_region_progressive.py +46 -0
  93. djvu_rs-0.28.0/djvu-py/tests/test_render.py +76 -0
  94. djvu_rs-0.28.0/djvu-py/tests/test_text.py +29 -0
  95. djvu_rs-0.28.0/docs/api-compatibility.md +262 -0
  96. djvu_rs-0.28.0/docs/conformance.md +59 -0
  97. djvu_rs-0.28.0/docs/editor.md +53 -0
  98. djvu_rs-0.28.0/docs/encoder-ingestion.md +92 -0
  99. djvu_rs-0.28.0/docs/encoder-parity.md +88 -0
  100. djvu_rs-0.28.0/docs/feature-matrix.md +94 -0
  101. djvu_rs-0.28.0/docs/indirect-djvm-mutation.md +173 -0
  102. djvu_rs-0.28.0/docs/indirect-djvm-resolver.md +46 -0
  103. djvu_rs-0.28.0/docs/jb2-size-gap-plan.md +110 -0
  104. djvu_rs-0.28.0/docs/neural-ocr-design.md +151 -0
  105. djvu_rs-0.28.0/docs/ocr-backend-seam.md +98 -0
  106. djvu_rs-0.28.0/docs/ocr-model-manifest.toml +94 -0
  107. djvu_rs-0.28.0/docs/ocr-model-metrics.md +43 -0
  108. djvu_rs-0.28.0/docs/optimizer.md +31 -0
  109. djvu_rs-0.28.0/docs/packaging.md +142 -0
  110. djvu_rs-0.28.0/docs/tile-rendering.md +230 -0
  111. djvu_rs-0.28.0/docs/writer-coverage.md +30 -0
  112. djvu_rs-0.28.0/examples/alloc_profile.rs +111 -0
  113. djvu_rs-0.28.0/examples/async_http_first_page.rs +310 -0
  114. djvu_rs-0.28.0/examples/async_lazy_first_page.rs +192 -0
  115. djvu_rs-0.28.0/examples/block_classify_probe.rs +207 -0
  116. djvu_rs-0.28.0/examples/bzz_encode_diag.rs +215 -0
  117. djvu_rs-0.28.0/examples/c5_compress_bench.rs +175 -0
  118. djvu_rs-0.28.0/examples/callgrind_workload.rs +54 -0
  119. djvu_rs-0.28.0/examples/cold_open_bench.rs +368 -0
  120. djvu_rs-0.28.0/examples/conformance_semantic.rs +551 -0
  121. djvu_rs-0.28.0/examples/corpus_tier2_baseline.rs +248 -0
  122. djvu_rs-0.28.0/examples/deskew_probe.rs +193 -0
  123. djvu_rs-0.28.0/examples/diagnose_iw44_quality.rs +300 -0
  124. djvu_rs-0.28.0/examples/diff_djvulibre.rs +350 -0
  125. djvu_rs-0.28.0/examples/diff_fuzz.rs +1633 -0
  126. djvu_rs-0.28.0/examples/encode_quality_djbz.rs +436 -0
  127. djvu_rs-0.28.0/examples/encode_quality_iw44.rs +195 -0
  128. djvu_rs-0.28.0/examples/encode_quality_jb2.rs +394 -0
  129. djvu_rs-0.28.0/examples/encoder_parity_scorecard.rs +1057 -0
  130. djvu_rs-0.28.0/examples/extract_text.rs +19 -0
  131. djvu_rs-0.28.0/examples/ffi/render.c +92 -0
  132. djvu_rs-0.28.0/examples/fg_bicubic_quality.rs +278 -0
  133. djvu_rs-0.28.0/examples/fgbz_mediancut_harness.rs +340 -0
  134. djvu_rs-0.28.0/examples/generation_loss.rs +102 -0
  135. djvu_rs-0.28.0/examples/incremental_save_probe.rs +126 -0
  136. djvu_rs-0.28.0/examples/info.rs +21 -0
  137. djvu_rs-0.28.0/examples/interop_encode.rs +290 -0
  138. djvu_rs-0.28.0/examples/interop_pixdiff.rs +136 -0
  139. djvu_rs-0.28.0/examples/iw44_band_probe.rs +223 -0
  140. djvu_rs-0.28.0/examples/iw44_checkpoint_probe.rs +150 -0
  141. djvu_rs-0.28.0/examples/iw44_chunking_lever.rs +248 -0
  142. djvu_rs-0.28.0/examples/iw44_chunking_sweep.rs +156 -0
  143. djvu_rs-0.28.0/examples/iw44_forward_transform_probe.rs +181 -0
  144. djvu_rs-0.28.0/examples/jb2_crosssize_b1probe.rs +43 -0
  145. djvu_rs-0.28.0/examples/jb2_despeckle.rs +125 -0
  146. djvu_rs-0.28.0/examples/jb2_lossy_b0.rs +102 -0
  147. djvu_rs-0.28.0/examples/jb2_same_size_a0.rs +62 -0
  148. djvu_rs-0.28.0/examples/jb2_same_size_a2.rs +68 -0
  149. djvu_rs-0.28.0/examples/jb2_same_size_a3_auto.rs +77 -0
  150. djvu_rs-0.28.0/examples/jb2_same_size_a3_density_sweep.rs +44 -0
  151. djvu_rs-0.28.0/examples/jbig2_mask_size_probe.rs +209 -0
  152. djvu_rs-0.28.0/examples/mask_aa_crops.rs +142 -0
  153. djvu_rs-0.28.0/examples/mask_aa_quality.rs +167 -0
  154. djvu_rs-0.28.0/examples/ocr_input_ab.rs +162 -0
  155. djvu_rs-0.28.0/examples/ocr_preset_grid.rs +131 -0
  156. djvu_rs-0.28.0/examples/ocr_qa.rs +492 -0
  157. djvu_rs-0.28.0/examples/ocr_word_dup_probe.rs +329 -0
  158. djvu_rs-0.28.0/examples/pdf_dct_probe.rs +139 -0
  159. djvu_rs-0.28.0/examples/pdf_fg_color_probe.rs +181 -0
  160. djvu_rs-0.28.0/examples/pdf_g4_export.rs +57 -0
  161. djvu_rs-0.28.0/examples/pdf_g4_probe.rs +80 -0
  162. djvu_rs-0.28.0/examples/pdf_memory_probe.rs +128 -0
  163. djvu_rs-0.28.0/examples/pdf_mrc_probe.rs +153 -0
  164. djvu_rs-0.28.0/examples/pgo_train.rs +110 -0
  165. djvu_rs-0.28.0/examples/probe_tiff_streaming_memory.rs +84 -0
  166. djvu_rs-0.28.0/examples/profile_iw44.rs +55 -0
  167. djvu_rs-0.28.0/examples/profile_iw44_encode.rs +50 -0
  168. djvu_rs-0.28.0/examples/quality_harness.rs +246 -0
  169. djvu_rs-0.28.0/examples/render_page.rs +27 -0
  170. djvu_rs-0.28.0/examples/support/mod.rs +138 -0
  171. djvu_rs-0.28.0/examples/th44_grid_probe.rs +67 -0
  172. djvu_rs-0.28.0/examples/thumbnail_grid_quality.rs +152 -0
  173. djvu_rs-0.28.0/examples/txtz_ocr_demo.rs +199 -0
  174. djvu_rs-0.28.0/examples/wasm/README.md +150 -0
  175. djvu_rs-0.28.0/examples/wasm/bench_batch.html +63 -0
  176. djvu_rs-0.28.0/examples/wasm/bench_lazy_open.html +97 -0
  177. djvu_rs-0.28.0/examples/wasm/bench_open.html +51 -0
  178. djvu_rs-0.28.0/examples/wasm/bench_zero_copy.html +81 -0
  179. djvu_rs-0.28.0/examples/wasm/index.html +140 -0
  180. djvu_rs-0.28.0/examples/wasm/range_lazy.md +99 -0
  181. djvu_rs-0.28.0/examples/wasm/serve_lazy_bench.py +114 -0
  182. djvu_rs-0.28.0/lcov.info +10467 -0
  183. djvu_rs-0.28.0/oss-fuzz/Dockerfile +13 -0
  184. djvu_rs-0.28.0/oss-fuzz/README.md +50 -0
  185. djvu_rs-0.28.0/oss-fuzz/build.sh +24 -0
  186. djvu_rs-0.28.0/oss-fuzz/project.yaml +13 -0
  187. djvu_rs-0.28.0/plans/README.md +66 -0
  188. djvu_rs-0.28.0/pyproject.toml +47 -0
  189. djvu_rs-0.28.0/release-please-config.json +11 -0
  190. djvu_rs-0.28.0/src/annotation.rs +812 -0
  191. djvu_rs-0.28.0/src/bin/djvu.rs +2164 -0
  192. djvu_rs-0.28.0/src/bitmap.rs +6 -0
  193. djvu_rs-0.28.0/src/bzz.rs +10 -0
  194. djvu_rs-0.28.0/src/bzz_encode.rs +6 -0
  195. djvu_rs-0.28.0/src/cbz.rs +409 -0
  196. djvu_rs-0.28.0/src/chunk_encode.rs +403 -0
  197. djvu_rs-0.28.0/src/component_graph.rs +701 -0
  198. djvu_rs-0.28.0/src/dirm.rs +459 -0
  199. djvu_rs-0.28.0/src/djvm.rs +2336 -0
  200. djvu_rs-0.28.0/src/djvu_async.rs +1271 -0
  201. djvu_rs-0.28.0/src/djvu_document.rs +4104 -0
  202. djvu_rs-0.28.0/src/djvu_encode.rs +2338 -0
  203. djvu_rs-0.28.0/src/djvu_mut.rs +3200 -0
  204. djvu_rs-0.28.0/src/djvu_render.rs +8093 -0
  205. djvu_rs-0.28.0/src/djvu_tile.rs +1381 -0
  206. djvu_rs-0.28.0/src/editor.rs +459 -0
  207. djvu_rs-0.28.0/src/epub.rs +1053 -0
  208. djvu_rs-0.28.0/src/error.rs +76 -0
  209. djvu_rs-0.28.0/src/export_async.rs +355 -0
  210. djvu_rs-0.28.0/src/export_common.rs +503 -0
  211. djvu_rs-0.28.0/src/export_control.rs +28 -0
  212. djvu_rs-0.28.0/src/export_test_support.rs +97 -0
  213. djvu_rs-0.28.0/src/ffi.rs +361 -0
  214. djvu_rs-0.28.0/src/fgbz.rs +145 -0
  215. djvu_rs-0.28.0/src/fgbz_encode.rs +306 -0
  216. djvu_rs-0.28.0/src/foreign.rs +222 -0
  217. djvu_rs-0.28.0/src/iff.rs +6 -0
  218. djvu_rs-0.28.0/src/image_compat.rs +365 -0
  219. djvu_rs-0.28.0/src/info.rs +382 -0
  220. djvu_rs-0.28.0/src/ingest.rs +65 -0
  221. djvu_rs-0.28.0/src/iw44.rs +7 -0
  222. djvu_rs-0.28.0/src/iw44_encode.rs +11 -0
  223. djvu_rs-0.28.0/src/jb2.rs +6 -0
  224. djvu_rs-0.28.0/src/jb2_encode.rs +821 -0
  225. djvu_rs-0.28.0/src/lenient_text.rs +179 -0
  226. djvu_rs-0.28.0/src/lib.rs +1308 -0
  227. djvu_rs-0.28.0/src/metadata.rs +384 -0
  228. djvu_rs-0.28.0/src/navm_encode.rs +221 -0
  229. djvu_rs-0.28.0/src/ocr.rs +125 -0
  230. djvu_rs-0.28.0/src/ocr_neural.rs +71 -0
  231. djvu_rs-0.28.0/src/ocr_onnx/corpus.rs +211 -0
  232. djvu_rs-0.28.0/src/ocr_onnx/detect.rs +439 -0
  233. djvu_rs-0.28.0/src/ocr_onnx/manifest.rs +398 -0
  234. djvu_rs-0.28.0/src/ocr_onnx/metrics.rs +191 -0
  235. djvu_rs-0.28.0/src/ocr_onnx/pipeline.rs +335 -0
  236. djvu_rs-0.28.0/src/ocr_onnx/preprocess.rs +236 -0
  237. djvu_rs-0.28.0/src/ocr_onnx/recognize.rs +545 -0
  238. djvu_rs-0.28.0/src/ocr_onnx.rs +174 -0
  239. djvu_rs-0.28.0/src/ocr_tesseract.rs +396 -0
  240. djvu_rs-0.28.0/src/optimizer.rs +469 -0
  241. djvu_rs-0.28.0/src/pdf.rs +2669 -0
  242. djvu_rs-0.28.0/src/pixmap.rs +285 -0
  243. djvu_rs-0.28.0/src/png_io.rs +960 -0
  244. djvu_rs-0.28.0/src/quality.rs +637 -0
  245. djvu_rs-0.28.0/src/resource_limits.rs +148 -0
  246. djvu_rs-0.28.0/src/segment.rs +1408 -0
  247. djvu_rs-0.28.0/src/semantic_diff.rs +471 -0
  248. djvu_rs-0.28.0/src/sexp.rs +276 -0
  249. djvu_rs-0.28.0/src/smmr.rs +1580 -0
  250. djvu_rs-0.28.0/src/text.rs +1221 -0
  251. djvu_rs-0.28.0/src/text_encode.rs +347 -0
  252. djvu_rs-0.28.0/src/text_serialize.rs +970 -0
  253. djvu_rs-0.28.0/src/thumbnail.rs +245 -0
  254. djvu_rs-0.28.0/src/tiff_export.rs +1348 -0
  255. djvu_rs-0.28.0/src/validate.rs +1701 -0
  256. djvu_rs-0.28.0/src/wasm.rs +979 -0
  257. djvu_rs-0.28.0/tarpaulin-report.json +1 -0
  258. djvu_rs-0.28.0/tests/cli_diff.rs +82 -0
  259. djvu_rs-0.28.0/tests/cli_encode.rs +599 -0
  260. djvu_rs-0.28.0/tests/cli_encode_image_formats.rs +369 -0
  261. djvu_rs-0.28.0/tests/cli_info.rs +120 -0
  262. djvu_rs-0.28.0/tests/cli_inspect.rs +113 -0
  263. djvu_rs-0.28.0/tests/cli_merge_split_bzz.rs +199 -0
  264. djvu_rs-0.28.0/tests/cli_ocr.rs +94 -0
  265. djvu_rs-0.28.0/tests/cli_render.rs +184 -0
  266. djvu_rs-0.28.0/tests/cli_render_format.rs +193 -0
  267. djvu_rs-0.28.0/tests/cli_render_layers.rs +195 -0
  268. djvu_rs-0.28.0/tests/cli_text.rs +123 -0
  269. djvu_rs-0.28.0/tests/cli_validate.rs +207 -0
  270. djvu_rs-0.28.0/tests/codec_bzz.rs +121 -0
  271. djvu_rs-0.28.0/tests/codec_jb2_iw44.rs +194 -0
  272. djvu_rs-0.28.0/tests/diff_tolerance.md +129 -0
  273. djvu_rs-0.28.0/tests/document_and_render.rs +936 -0
  274. djvu_rs-0.28.0/tests/editor.rs +240 -0
  275. djvu_rs-0.28.0/tests/encode_size_regression.rs +117 -0
  276. djvu_rs-0.28.0/tests/encoder_ingestion.rs +578 -0
  277. djvu_rs-0.28.0/tests/epub_conversion.rs +215 -0
  278. djvu_rs-0.28.0/tests/ffi.rs +139 -0
  279. djvu_rs-0.28.0/tests/generate_golden.sh +136 -0
  280. djvu_rs-0.28.0/tests/iff_emission_guard.rs +81 -0
  281. djvu_rs-0.28.0/tests/image_decoder.rs +177 -0
  282. djvu_rs-0.28.0/tests/indirect_resolver.rs +80 -0
  283. djvu_rs-0.28.0/tests/iw44_rate_target.rs +256 -0
  284. djvu_rs-0.28.0/tests/metadata_roundtrip.rs +274 -0
  285. djvu_rs-0.28.0/tests/ocr_tesseract.rs +153 -0
  286. djvu_rs-0.28.0/tests/optimizer.rs +194 -0
  287. djvu_rs-0.28.0/tests/panic_free_corpus.rs +100 -0
  288. djvu_rs-0.28.0/tests/pdf_conversion.rs +267 -0
  289. djvu_rs-0.28.0/tests/phase4_annotations.rs +208 -0
  290. djvu_rs-0.28.0/tests/phase4_text.rs +307 -0
  291. djvu_rs-0.28.0/tests/proptest_codecs.rs +576 -0
  292. djvu_rs-0.28.0/tests/readme_sync.rs +161 -0
  293. djvu_rs-0.28.0/tests/send_sync_contract.rs +81 -0
  294. djvu_rs-0.28.0/tests/serde_roundtrip.rs +338 -0
  295. djvu_rs-0.28.0/tests/text_serialize.rs +156 -0
@@ -0,0 +1,8 @@
1
+ [shell_environment_policy]
2
+ inherit = "core"
3
+
4
+ [shell_environment_policy.set]
5
+ CLAUDE_CODE_DISABLE_1M_CONTEXT = "1"
6
+ CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING = "1"
7
+ CLAUDE_CODE_DISABLE_AUTO_MEMORY = "1"
8
+ CLAUDE_CODE_SUBAGENT_MODEL = "sonnet"
@@ -0,0 +1,16 @@
1
+ # cargo-nextest configuration
2
+ # https://nexte.st/docs/configuration
3
+
4
+ [profile.default]
5
+ # Mark tests that run longer than 60 s as "slow" (informational only)
6
+ slow-timeout = "60s"
7
+
8
+ [profile.ci]
9
+ slow-timeout = "60s"
10
+ # Retry flaky tests once before failing
11
+ retries = 1
12
+
13
+ # PDF export and large IW44 decode tests are legitimately slow — allow up to 5 min
14
+ [[profile.ci.overrides]]
15
+ filter = 'binary(pdf_conversion) or test(iw44_new_decode_big)'
16
+ slow-timeout = "120s"
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env bash
2
+ # Pre-commit checks — mirrors the CI lint/build steps.
3
+ # Install once: git config core.hooksPath .githooks
4
+ set -euo pipefail
5
+
6
+ echo "→ cargo fmt --check"
7
+ cargo fmt --check
8
+
9
+ echo "→ cargo clippy"
10
+ cargo clippy --quiet -- -D warnings
11
+
12
+ echo "→ no_std build"
13
+ cargo build --no-default-features --quiet
14
+
15
+ echo "✓ pre-commit passed"
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ # Mirror of the deterministic CI gates; blocks a push that would red the CI.
3
+ # Enable once: make hooks (sets core.hooksPath=.githooks)
4
+ # Bypass once: git push --no-verify
5
+ exec "$(git rev-parse --show-toplevel)/scripts/check.sh"
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something panics, returns wrong output, or fails to compile
4
+ labels: bug
5
+ ---
6
+
7
+ ## Environment
8
+
9
+ - djvu-rs version:
10
+ - Rust version (`rustc --version`):
11
+ - OS:
12
+
13
+ ## What happened
14
+
15
+ <!-- Describe what went wrong. -->
16
+
17
+ ## Reproducer
18
+
19
+ <!-- Paste a minimal failing test, or attach the DjVu file if it can be shared publicly. -->
20
+
21
+ ```rust
22
+ #[test]
23
+ fn repro() {
24
+ // ...
25
+ }
26
+ ```
27
+
28
+ ## Expected behavior
29
+
30
+ ## Actual behavior / error output
31
+
32
+ ```
33
+ // paste panic message, error, or wrong output here
34
+ ```
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: Feature request
3
+ about: Propose a new codec, API, or CLI subcommand
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## Summary
8
+
9
+ <!-- One sentence: what do you want added? -->
10
+
11
+ ## Motivation
12
+
13
+ <!-- What problem does this solve? Who needs it? -->
14
+
15
+ ## Proposed API / CLI
16
+
17
+ <!-- Show a code snippet or CLI invocation of how it would look. -->
18
+
19
+ ```rust
20
+ // example
21
+ ```
22
+
23
+ ## Alternatives considered
24
+
25
+ <!-- Any other approaches you thought about? -->
26
+
27
+ ## Spec reference
28
+
29
+ <!-- If this is a codec feature, link to the relevant DjVu v3 spec section. -->
@@ -0,0 +1,21 @@
1
+ ## Summary
2
+
3
+ <!-- What does this PR do? One paragraph is enough. -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] `cargo fmt --check` passes
8
+ - [ ] `cargo clippy -- -D warnings` passes
9
+ - [ ] `cargo test` passes (unit + integration + doctests)
10
+ - [ ] `cargo build --no-default-features` passes (no_std check)
11
+ - [ ] New public items have `///` doc comments
12
+ - [ ] Tests added for new behavior
13
+ - [ ] No `unwrap()` / `expect()` / `panic!` in library code
14
+
15
+ ## Performance impact
16
+
17
+ <!-- If the change touches a codec or render path, paste before/after `cargo bench` numbers. -->
18
+
19
+ ## Related issue
20
+
21
+ <!-- Closes #N -->
@@ -0,0 +1,170 @@
1
+ name: API stability
2
+
3
+ # Enforces the compatibility contract in docs/api-compatibility.md (#695):
4
+ # - unintended breakage of the stable public API surface (cargo-semver-checks)
5
+ # - the documented feature combinations and targets all build
6
+ # - the Send/Sync + panic-free contracts hold under the async feature
7
+ #
8
+ # These are kept in a dedicated workflow (not ci.yml) so the API-policy gates
9
+ # evolve independently of the core fmt/clippy/test pipeline.
10
+
11
+ on:
12
+ push:
13
+ branches: [main]
14
+ pull_request:
15
+ workflow_dispatch:
16
+
17
+ concurrency:
18
+ group: ${{ github.workflow }}-${{ github.ref }}
19
+ cancel-in-progress: true
20
+
21
+ env:
22
+ CARGO_TERM_COLOR: always
23
+ RUST_BACKTRACE: 1
24
+
25
+ jobs:
26
+ # ── Public API breakage detection (AC2) ──────────────────────────────────────
27
+ # Compares the PR against the latest version published on crates.io. For a
28
+ # 0.x crate, cargo-semver-checks treats a MINOR bump as the breaking axis, so
29
+ # this fails only on an *unintended* break of the stable surface that was not
30
+ # accompanied by the required version bump.
31
+ semver:
32
+ name: Public API breakage (cargo-semver-checks)
33
+ runs-on: ubuntu-latest
34
+ timeout-minutes: 20
35
+ # TODO(#695): non-blocking until the next crates.io release resets the
36
+ # baseline. cargo-semver-checks compares against the last published release
37
+ # (currently v0.27.0); the error enums DocError / DjvmError / SmmrError
38
+ # gained variants (and SmmrError's implicit discriminants shifted) in the
39
+ # already-merged #696 work, so the gate reports pre-existing, intended
40
+ # breakage that no change on this PR can clear. Flip this back to a hard
41
+ # failure (delete continue-on-error) once a release has shipped and/or the
42
+ # error enums are marked #[non_exhaustive] per docs/api-compatibility.md §1
43
+ # ("Error stability rule").
44
+ continue-on-error: true
45
+ steps:
46
+ - uses: actions/checkout@v6
47
+
48
+ - name: Install Rust stable
49
+ uses: dtolnay/rust-toolchain@stable
50
+
51
+ - name: Cache Rust dependencies
52
+ uses: Swatinem/rust-cache@v2
53
+ with:
54
+ key: semver-checks
55
+
56
+ - name: cargo-semver-checks (stable public API)
57
+ uses: obi1kenobi/cargo-semver-checks-action@v2
58
+ with:
59
+ # Default features = the decode-only `std` stable surface. Writer /
60
+ # async / experimental surfaces are checked as they stabilize.
61
+ feature-group: default-features
62
+ package: djvu-rs
63
+
64
+ # ── Documented feature combinations & targets (AC3) ──────────────────────────
65
+ # The human-readable companion is docs/feature-matrix.md; keep the two in sync.
66
+ feature-matrix:
67
+ name: Feature matrix (${{ matrix.name }})
68
+ runs-on: ubuntu-latest
69
+ timeout-minutes: 20
70
+ strategy:
71
+ fail-fast: false
72
+ matrix:
73
+ include:
74
+ - name: "no_std (host)"
75
+ flags: "--no-default-features"
76
+ - name: "default (std, decode-only)"
77
+ flags: ""
78
+ - name: "jpeg"
79
+ flags: "--features std,jpeg"
80
+ - name: "pdf"
81
+ flags: "--features pdf"
82
+ - name: "epub"
83
+ flags: "--features epub"
84
+ - name: "cbz"
85
+ flags: "--features cbz"
86
+ - name: "tiff"
87
+ flags: "--features tiff"
88
+ - name: "cli"
89
+ flags: "--features cli"
90
+ - name: "async"
91
+ flags: "--features async"
92
+ - name: "parallel"
93
+ flags: "--features parallel"
94
+ - name: "mmap"
95
+ flags: "--features mmap"
96
+ - name: "serde"
97
+ flags: "--features serde"
98
+ - name: "image"
99
+ flags: "--features image"
100
+ - name: "kitchen-sink"
101
+ flags: "--features cli,tiff,async,serde,image,epub,mmap,parallel"
102
+ steps:
103
+ - uses: actions/checkout@v6
104
+
105
+ - name: Install Rust stable
106
+ uses: dtolnay/rust-toolchain@stable
107
+
108
+ - name: Cache Rust dependencies
109
+ uses: Swatinem/rust-cache@v2
110
+ with:
111
+ key: feature-matrix
112
+
113
+ - name: cargo check ${{ matrix.flags }}
114
+ run: cargo check ${{ matrix.flags }}
115
+
116
+ # ── wasm32 documented feature set (AC3) ──────────────────────────────────────
117
+ feature-matrix-wasm:
118
+ name: Feature matrix (wasm32 ${{ matrix.name }})
119
+ runs-on: ubuntu-latest
120
+ timeout-minutes: 20
121
+ strategy:
122
+ fail-fast: false
123
+ matrix:
124
+ include:
125
+ - name: "no_std"
126
+ flags: "--no-default-features"
127
+ - name: "wasm"
128
+ flags: "--features wasm"
129
+ - name: "wasm-lazy"
130
+ flags: "--features wasm-lazy"
131
+ steps:
132
+ - uses: actions/checkout@v6
133
+
134
+ - name: Install Rust stable + wasm32 target
135
+ uses: dtolnay/rust-toolchain@stable
136
+ with:
137
+ targets: wasm32-unknown-unknown
138
+
139
+ - name: Cache Rust dependencies
140
+ uses: Swatinem/rust-cache@v2
141
+ with:
142
+ key: feature-matrix-wasm
143
+
144
+ - name: cargo check --target wasm32-unknown-unknown ${{ matrix.flags }}
145
+ run: cargo check --target wasm32-unknown-unknown ${{ matrix.flags }}
146
+
147
+ # ── Contract tests under the async feature (AC7 + AC8) ───────────────────────
148
+ # The default Test (stable) job runs without `async`, so the Send/Sync
149
+ # assertions for LazyDocument and the async panic-free surface are only
150
+ # exercised here.
151
+ contract-tests:
152
+ name: Send/Sync + panic-free contracts (async)
153
+ runs-on: ubuntu-latest
154
+ timeout-minutes: 15
155
+ steps:
156
+ - uses: actions/checkout@v6
157
+
158
+ - name: Install Rust stable
159
+ uses: dtolnay/rust-toolchain@stable
160
+
161
+ - name: Cache Rust dependencies
162
+ uses: Swatinem/rust-cache@v2
163
+ with:
164
+ key: contract-tests
165
+
166
+ - name: Send/Sync contract
167
+ run: cargo test --test send_sync_contract --features async
168
+
169
+ - name: Panic-free corpus + adversarial inputs
170
+ run: cargo test --test panic_free_corpus --features cli
@@ -0,0 +1,110 @@
1
+ name: Benchmark dashboard
2
+
3
+ # Publishes Criterion benchmark history to a public dashboard on the gh-pages
4
+ # branch via benchmark-action/github-action-benchmark. Runs only on main-branch
5
+ # pushes that touch source/benches and on release tags, so PR runs in
6
+ # bench.yml stay fast and the public timeline only records merged commits.
7
+ #
8
+ # Output: https://matyushkin.github.io/djvu-rs/dev/bench/
9
+ #
10
+ # See #197 for design rationale.
11
+
12
+ on:
13
+ push:
14
+ branches: [main]
15
+ tags:
16
+ - 'v*'
17
+ paths:
18
+ - 'src/**'
19
+ - 'benches/**'
20
+ - 'Cargo.toml'
21
+ - 'Cargo.lock'
22
+ workflow_dispatch:
23
+
24
+ permissions:
25
+ contents: write # push to gh-pages
26
+ deployments: write # github-action-benchmark stores deployment markers
27
+
28
+ concurrency:
29
+ group: bench-dashboard
30
+ cancel-in-progress: false # don't drop history points
31
+
32
+ env:
33
+ CARGO_TERM_COLOR: always
34
+ RUST_BACKTRACE: 1
35
+
36
+ jobs:
37
+ publish:
38
+ name: Publish dashboard
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v6
42
+
43
+ - name: Install Rust stable
44
+ uses: dtolnay/rust-toolchain@stable
45
+
46
+ - name: Cache Rust dependencies
47
+ uses: Swatinem/rust-cache@v2
48
+ with:
49
+ key: bench-dashboard-ubuntu
50
+
51
+ # ── Run all Criterion benchmarks in bencher format ───────────────────
52
+ # github-action-benchmark consumes the `bencher` (libtest) format.
53
+ - name: Bench codecs
54
+ run: cargo bench --bench codecs -- --output-format bencher 2>&1 | tee bench_output.txt
55
+
56
+ - name: Bench render
57
+ run: cargo bench --bench render --features pdf -- --output-format bencher 2>&1 | tee -a bench_output.txt
58
+
59
+ - name: Bench document
60
+ run: cargo bench --bench document -- --output-format bencher 2>&1 | tee -a bench_output.txt
61
+
62
+ # ── DjVuLibre baseline (overlay on the same dashboard) ───────────────
63
+ # Compiles libdjvulibre's render benchmark and emits one bencher line
64
+ # per DPI so github-action-benchmark plots a parallel timeline next to
65
+ # djvu-rs's render_page series. This satisfies the "DjVuLibre ratio
66
+ # overlay" item of #197's DoD. The asset (colorbook.djvu) is checked
67
+ # into references/djvujs/ so no fetch step is needed.
68
+ - name: Run DjVuLibre render benchmark
69
+ id: djvulibre
70
+ continue-on-error: true
71
+ run: |
72
+ mkdir -p target/djvulibre-bench
73
+ bash scripts/bench_djvulibre.sh target/djvulibre-bench
74
+ # Parse render_only lines from djvulibre_bench.txt → one bencher line
75
+ # per case. Extract the target DPI from the preceding "size" line so
76
+ # each case gets a unique name (djvulibre_render_dpi_72 etc.) that
77
+ # aligns with the Criterion render_page/dpi/* series.
78
+ python3 - <<'PYEOF' >> bench_output.txt
79
+ import re, pathlib
80
+ txt = pathlib.Path("target/djvulibre-bench/djvulibre_bench.txt").read_text()
81
+ current_dpi = None
82
+ for line in txt.splitlines():
83
+ m_size = re.search(r"->(\d+)dpi", line)
84
+ if m_size:
85
+ current_dpi = int(m_size.group(1))
86
+ continue
87
+ m_render = re.match(r"render_only\s*:\s*([\d.]+)\s*ms", line)
88
+ if m_render and current_dpi is not None:
89
+ ns = int(float(m_render.group(1)) * 1_000_000)
90
+ print(f"test djvulibre_render_dpi_{current_dpi} ... bench: {ns} ns/iter (+/- 0)")
91
+ PYEOF
92
+
93
+ # ── Publish history + dashboard to gh-pages ─────────────────────────
94
+ - name: Push to gh-pages dashboard
95
+ uses: benchmark-action/github-action-benchmark@v1
96
+ with:
97
+ name: djvu-rs benchmarks
98
+ tool: 'cargo'
99
+ output-file-path: bench_output.txt
100
+ # Persist on the gh-pages branch under dev/bench/ → published page.
101
+ gh-pages-branch: gh-pages
102
+ benchmark-data-dir-path: dev/bench
103
+ github-token: ${{ secrets.GITHUB_TOKEN }}
104
+ auto-push: true
105
+ # 10 % regression alert on any benchmark; comment on the commit that
106
+ # introduced it (see #197 DoD).
107
+ alert-threshold: '110%'
108
+ fail-on-alert: false
109
+ comment-on-alert: true
110
+ alert-comment-cc-users: '@matyushkin'