Skip to content

Core: добавить exact RawBitmap24 family codec - #495

Merged
lemone112 merged 2 commits into
mainfrom
agent/v5b2a-raw-bitmap24
Jul 29, 2026
Merged

Core: добавить exact RawBitmap24 family codec#495
lemone112 merged 2 commits into
mainfrom
agent/v5b2a-raw-bitmap24

Conversation

@lemone112

@lemone112 lemone112 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Что изменено

  • добавлен production RawBitmap24V1 для полного IEC sRGB8 domain: один bit на сигнал, RGB big-endian ordinal, MSB0;
  • loader переносит исходную owned payload-allocation прямо в executable storage без второго 2 MiB множества;
  • membership — O(1), allocation-free и не вызывает LCS;
  • один canonical streaming preimage связывает exact image для slice-fixture и bitmap codec;
  • transport receipt, semantic release и exact image остаются раздельными identities;
  • fixture Vec<ColorSignal> сохранён только под cfg(test) как независимый storage/decoder oracle;
  • новый exact codec включён в scheduled mutation population.

Зачем

Это V5b2a: universal exact storage до появления materialised contextual provider. Срез меняет только representation, не family semantics, cleanliness, selection или public API.

Точный diff

  • base: 8ed80da39bdc236253f13f859f5fbbe456807d72;
  • head: 8ccdc5e77afed3cfcff3752f2dcee7d6e0a4e9b4;
  • tree: f79316b21547ce728b0e6b7af549b64ed1d0b1c5;
  • patch-id до/после rebase: 1d4f40ca14f2868bf873d28f17605d0f2fe0b2c3.

Доказательства

  • cargo test --workspace --all-features: PASS;
  • family artifact: 32 passed, 1 ignored; Program family: 16 passed;
  • полный 256³ = 16,777,216 differential oracle: ровно один exhaustive test, 256 members, PASS локально и в CI;
  • exact ordinal/bit-boundaries, corruption/truncation/wrong length/count/image hostile tests;
  • исходная payload allocation сохраняет pointer при admission; contains/assess не аллоцируют;
  • mutation truth harness: 50/50;
  • targeted cargo-mutants: 49 caught, 8 unviable, 0 missed, 0 timeout (raw_bitmap24: 38 + 4; family loader/hash: 11 + 4);
  • fresh independent architecture/numerical/API review: PASS;
  • CodeRabbit: единственный комментарий опровергнут двумя предшествующими runtime length-gate, thread resolved; затем CodeRabbit APPROVED тот же head;
  • все required CI текущего head зелёные.

Performance / size

  • hot lookup: O(1), 0 alloc / 0 realloc / 0 dealloc;
  • cold admission: payload zero-copy, но честно выполняет SHA-256 + popcount + canonical scan;
  • Rust 1.96.0 clean snapshots: .rlib +21,432 B, staticlib +8,216 B, dylib 0 B;
  • raw WASM 0 B и byte-identical; wasm-pack 0.13.1 optimized WASM 0 B и byte-identical;
  • public Rust/FFI/WASM entrypoints, rustdoc surface, Cargo manifests, lockfile и dependencies не изменились.

Временную скорость cold admission не заявляем: для неё ещё нет отдельного воспроизводимого benchmark-gate.

Границы

Codec и loader остаются pub(crate); реальный provider import/mint приходит только после V5b2c/V5b2d. Adaptive compression оценивается по benchmark после первого реального artifact и не меняет semantic identity.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Добавлена точная RawBitmap24-кодировка семейных артефактов с streaming-проверкой digest, отдельным production storage и валидацией payload до bitmap-сканирования. Fixture-путь сохранён для тестов, а program fixtures переведены на raw admission.

Changes

RawBitmap24 admission

Layer / File(s) Summary
Streaming canonical digest
crates/labcolors-core/src/family.rs
Добавлена потоковая проверка профиля, строгого порядка и количества членов при вычислении canonical image digest.
RawBitmap24 codec
crates/labcolors-core/src/family_artifact/raw_bitmap24.rs
Добавлены bitmap24 storage, ordinal/bitmask membership, preflight, image verification и тестовый encoder.
Loader and executable storage
crates/labcolors-core/src/family_artifact.rs
Загрузчик разделяет raw и fixture-пути; admitted artifacts используют RawBitmap24V1 либо FixtureMembersV1, а ошибки length и member count уточнены.
Validation and test wiring
crates/labcolors-core/src/family_artifact_tests.rs, crates/labcolors-core/src/program_family_tests.rs, .cargo/mutants.toml
Добавлены проверки encoding boundaries, digest, порядка отказов, allocation-free lookup и использования raw artifacts в program fixtures; расширен mutation-testing scope.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant FamilyArtifactLoaderV1
  participant verify_bound_envelope
  participant raw_bitmap24
  participant AdmittedFamilyArtifactV2
  Client->>FamilyArtifactLoaderV1: load(encoded artifact)
  FamilyArtifactLoaderV1->>verify_bound_envelope: validate envelope and payload receipt
  verify_bound_envelope->>raw_bitmap24: preflight and verify_image
  raw_bitmap24-->>FamilyArtifactLoaderV1: verified image digest
  FamilyArtifactLoaderV1->>AdmittedFamilyArtifactV2: store RawBitmap24V1
  AdmittedFamilyArtifactV2-->>Client: contains/assess result
Loading

Possibly related PRs

  • Labpics-Team/lab-colors#491 — затрагивает точные admitted family sets и проверку canonical image/content digest.
  • Labpics-Team/lab-colors#492 — использует изменения family digest и family-artifact loading для semantic family runtime separation.
  • Labpics-Team/lab-colors#493 — пересекается с oracle-тестами membership полного 24-bit RGB-куба.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно отражает основное изменение: добавление точного RawBitmap24 family codec в core.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/v5b2a-raw-bitmap24

Comment @coderabbitai help to get the list of available commands.

@lemone112
lemone112 force-pushed the agent/v5b2a-raw-bitmap24 branch from 05b29c2 to 8ccdc5e Compare July 29, 2026 12:03
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/labcolors-core/src/family_artifact/raw_bitmap24.rs`:
- Around line 73-102: Update verify_image to validate payload.len() against
PAYLOAD_LEN_V1 at runtime before processing the bytes, returning
FamilyArtifactLoadErrorV1::CodecPayloadLengthMismatch with the appropriate
expected and actual lengths on mismatch. Keep the debug assertion only if useful
as an additional invariant check, and preserve the existing member-count and
canonical digest flow for valid-length payloads.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3b944c9f-0350-40de-af7a-b9042ba591a3

📥 Commits

Reviewing files that changed from the base of the PR and between 8ed80da and 8ccdc5e.

📒 Files selected for processing (6)
  • .cargo/mutants.toml
  • crates/labcolors-core/src/family.rs
  • crates/labcolors-core/src/family_artifact.rs
  • crates/labcolors-core/src/family_artifact/raw_bitmap24.rs
  • crates/labcolors-core/src/family_artifact_tests.rs
  • crates/labcolors-core/src/program_family_tests.rs

Comment thread crates/labcolors-core/src/family_artifact/raw_bitmap24.rs
@lemone112
lemone112 dismissed coderabbitai[bot]’s stale review July 29, 2026 12:19

Dismissed after the only thread was disproved with the exact admission proof and resolved; CodeRabbit subsequently approved the same head (review 4808024764). No code change is warranted.

@lemone112
lemone112 merged commit 410fce0 into main Jul 29, 2026
10 checks passed
@lemone112
lemone112 deleted the agent/v5b2a-raw-bitmap24 branch July 29, 2026 12:22
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.

1 participant