Skip to content

librle(PackBits RLE の WAL)と圧縮共通 API conde を追加 - #144

Merged
src3453 merged 1 commit into
mainfrom
claude/project-thread-mpjmew
Oct 24, 2026
Merged

src3453 merged 1 commit into
mainfrom
claude/project-thread-mpjmew

Conversation

@src3453

@src3453 src3453 commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Requested by src3453 · project thread

Closes #142

概要

  • 圧縮ライブラリ共通 API「conde」(compression-decompression)を foundation/include/foundation/conde.h に定義。cpt_<algo>_compress / _decompress / _compress_bound とステータスコード CONDE_*。今後の圧縮ライブラリもこれに従う。
  • foundation/lib/rle: PackBits 形式の WAL「rle」ABI 1.0。ラン検出・コピー・埋め込みを 4 byte 単位で行い、heap・libfnd・作業領域を使わない。/lib/rle.1.wal(約 10 KB)として既定ディスクに入る。
  • lzma も conde に合わせた(CPT_LZMA_* は別名で互換、cpt_lzma_compress_bound を追加し ABI 1.1)。

検証

  • python3 -m unittest foundation.tests.rle.test_rle(5 件): ホストは独立実装の PackBits 展開器との突き合わせ・容量不足・不正ストリーム、ゲストは rle と lzma を同時 import して -O1/-O2 × scalar/pipeline で往復。
  • foundation/tests/lzma(3 件)、foundation/tests/disk(7 件、/lib/rle.1.wal の存在を追加)も成功。clang-20 + llvmlite 0.46 で実行。

Generated by Claude Code

- foundation/include/foundation/conde.h: common API for compression
  libraries (cpt_<algo>_compress/decompress/compress_bound, CONDE_* codes)
- foundation/lib/rle: word-wise PackBits WAL "rle" 1.0, /lib/rle.1.wal
- lzma follows conde: CPT_LZMA_* aliases, cpt_lzma_compress_bound, ABI 1.1
- tests in foundation/tests/rle, disk image check, README and MEMORY.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDsnzoHQdxS5iCeCurShAt
@src3453 src3453 added this to the Foundation OS milestone Oct 24, 2026 — with Claude
@src3453 src3453 self-assigned this Oct 24, 2026
@src3453
src3453 merged commit a01d1c6 into main Oct 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RLE 圧縮ライブラリ librle.wal と共通圧縮 API を追加する

2 participants