Skip to content

Core: типизировать opacity-domain point-представления - #519

Merged
lemone112 merged 3 commits into
mainfrom
codex/v3a-opacity-domain
Aug 3, 2026
Merged

lemone112 merged 3 commits into
mainfrom
codex/v3a-opacity-domain

Conversation

@lemone112

@lemone112 lemone112 commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

Что изменено

  • добавлен один непустой замкнутый OpacityDomainV1; fixed opacity выражается равными границами без второго физического типа;
  • exact point-представление выбирает минимальную достижимую binary64 opacity внутри домена и сохраняет границу достижимости с predecessor-witness;
  • физическая exact-проверка отделена от geometric feasibility evidence и повторно проверяет итоговый sRGB8 occurrence;
  • замороженный AlphaAnalog компилирует объявленный минимум в [minimum, 1], не создавая нового публичного API;
  • исправлен stale mutation scope после переименования analog.rs в point_representation.rs;
  • перепривязаны clean-set receipt и point-support proof к изменившемуся source cone.

Почему

Раньше физический coordinator принимал только одно число «minimum opacity», поэтому допустимое множество и правило выбора не были представлены типами. Это мешало строить общий декларативный alpha-контракт и позволяло будущим frontend-ам размножать локальные selector-рецепты.

Этот PR намеренно не объявляет общий alpha:auto и не создаёт локальную selection-authority: остальные objectives должны войти в один глобальный versioned SelectionRelease.

Проверки

  • RED: компиляция зафиксировала отсутствие typed domain, selection evidence и typed no-feasible outcome;
  • cargo test --workspace --all-targets;
  • cargo clippy -p labcolors-core --all-targets -- -D warnings;
  • property: 256 диапазонов, точность и минимальность выбранной opacity;
  • differential oracle: полный byte-source перебор для выбранной opacity и predecessor;
  • mutation: первый прогон нашёл 2 missed; после RED-теста и удаления локальной selection-authority — 16 caught, 10 unviable, 0 missed;
  • clean-set receipt: PRODUCT_IDENTITY_VERIFIED;
  • point-support independent verifier: PASS;
  • npm@11.9.0 run release:verify.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 05ebdf0a-cfd6-44cb-85e0-14af7c9ab06e

📥 Commits

Reviewing files that changed from the base of the PR and between 98a239b and 8ed32eb.

📒 Files selected for processing (2)
  • crates/labcolors-core/src/point_representation.rs
  • docs/whitepaper.md

Walkthrough

Добавлен закрытый OpacityDomainV1 с точным predecessor binary64. Point representation выбирает feasible opacity внутри домена и сохраняет selection evidence. AlphaAnalog передаёт домен [minimum, 1] через semantic resolver. Контрольные хэши и документация обновлены.

Changes

Пайплайн opacity и point representation

Layer / File(s) Summary
Контракт закрытого opacity-домена
crates/labcolors-core/src/composition.rs
Добавлены OpacityDomainV1, typed errors, проверка границ, contains и точный predecessor. Тесты покрывают невалидные диапазоны, -0.0, фиксированные значения и frontier.
Выбор и проверка point representation
crates/labcolors-core/src/point_representation.rs
propose выбирает feasible opacity в домене. VerifiedPointRepresentationV1 разделяет exact и selection evidence. Добавлены typed errors и проверки minimal selection.
Интеграция AlphaAnalog
crates/labcolors-core/src/semantic.rs, crates/labcolors-core/src/alpha.rs
AlphaAnalog создаёт и сохраняет OpacityDomainV1 от запрошенной opacity до 1.0. Semantic resolver передаёт домен и вычисляет coercion относительно его нижней границы.
Документация и контрольные артефакты
docs/whitepaper.md, crates/labcolors-core/contracts/..., scripts/verify_point_support_surplus.py, .cargo/mutants.toml
Обновлены описание контракта, receipt-хэши, proof-хэши, source-capsule SHA и список анализируемых файлов.

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

Sequence Diagram(s)

sequenceDiagram
  participant AlphaAnalog
  participant SemanticResolver
  participant PointRepresentation
  participant ExactVerifier
  AlphaAnalog->>SemanticResolver: передаёт solid target и OpacityDomainV1
  SemanticResolver->>PointRepresentation: вызывает resolver с доменом
  PointRepresentation->>PointRepresentation: выбирает первую feasible opacity
  PointRepresentation->>ExactVerifier: проверяет выбранное point representation
  ExactVerifier-->>SemanticResolver: возвращает VerifiedExactPointV1
  SemanticResolver-->>AlphaAnalog: возвращает verified representation и selection evidence
Loading

Possibly related PRs

  • Labpics-Team/lab-colors#518: расширяет тот же execution model point_representation.rs и OpacityDomainV1.
  • Labpics-Team/lab-colors#269: вводит исходный контракт разрешения opacity, который расширен в этом PR.
  • Labpics-Team/lab-colors#447: добавляет point-support/session architecture, используемую новым доменом opacity.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.83% 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 Заголовок точно описывает основное изменение: типизацию point-представлений для opacity-domain в 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 codex/v3a-opacity-domain

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

@lemone112
lemone112 marked this pull request as ready for review August 3, 2026 08:06

@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: 3

🤖 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/point_representation.rs`:
- Around line 653-667: Remove the tautological assertion comparing
evidence.binding().program_occurrence() with
verified.evidence.binding().program_occurrence(), since verified.evidence is
copied into evidence and both values are identical. Either compare the binding
occurrence against an independently expected value or delete this assertion
while preserving the remaining evidence checks.
- Around line 299-309: Construct `evidence` only inside a debug-only block
around the `debug_assert_eq!` checks in the verification path, using the
existing `verified.evidence()` call. Keep the assertions and their current
comparisons unchanged, while ensuring release builds do not bind or compute
`evidence`.

In `@docs/whitepaper.md`:
- Around line 171-177: Уточните описание AlphaAnalog: для MostTransparent явно
укажите выбор минимальной достижимой opacity внутри замкнутого диапазона
[minimum, 1], а не просто «первого достижимого binary64». В этом абзаце замените
англоязычные термины domain, release, predecessor, design objectives, versioned
selection contract и frontend на краткие русские эквиваленты, сохранив смысл
повторной проверки итогового sRGB8.
🪄 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: 9e2000ba-e0cd-4bab-9bcb-b623e22eeb28

📥 Commits

Reviewing files that changed from the base of the PR and between 08c1299 and 98a239b.

📒 Files selected for processing (10)
  • .cargo/mutants.toml
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.json
  • crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.sha256
  • crates/labcolors-core/contracts/point-support-reference-surplus-q55-bps-proof-v1.json
  • crates/labcolors-core/src/alpha.rs
  • crates/labcolors-core/src/composition.rs
  • crates/labcolors-core/src/point_representation.rs
  • crates/labcolors-core/src/semantic.rs
  • docs/whitepaper.md
  • scripts/verify_point_support_surplus.py

Comment thread crates/labcolors-core/src/point_representation.rs Outdated
Comment thread crates/labcolors-core/src/point_representation.rs Outdated
Comment thread docs/whitepaper.md Outdated
@lemone112
lemone112 merged commit c73f2f3 into main Aug 3, 2026
8 of 9 checks passed
@lemone112
lemone112 deleted the codex/v3a-opacity-domain branch August 3, 2026 08:27
@lemone112

Copy link
Copy Markdown
Collaborator Author

Пост-мортем красного статуса merge commit c73f2f3.

Rerun 30797490032 (запущен после ручной отмены) завершился failure в job wasm build + headless test + size: WASM size budget — expected=376554B, actual=376907B.

Причина: на момент merge этот коммит нёс устаревший пин бюджета (376554B из run 30790916413), а #518/#519 изменили реальный размер артефакта до 376907B. Дрейф закрыт в main коммитом be009ce (#514): пин обновлён на 376907B по замеру run 30864842276, self-hash бюджетного файла проверен (e39d32e0...).

Доказательство здоровья кодовой базы: актуальный CI на head main (run 30893495847, c327eb3) полностью зелёный. Красный статус на историческом merge commit — артефакт rerun старого коммита со старым пином; код #519 дефектов не содержит, переписывать историю недопустимо.

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