Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
},
"artifacts": [
{
"bytes": 87722,
"bytes": 87733,
"license": "MIT",
"path": "crates/labcolors-core/src/appearance.rs",
"role": "appearance_executor_source",
"sha256": "66266904fc84afb03a3a774a8aaa0da23fe1e05a8b04abb14d5f18820e17a85d"
"sha256": "fecab7250ec96171daf3d6fe75c663e45b2356a2b0a8bb6f5ee418c9d62654a1"
},
{
"bytes": 6373,
Expand All @@ -27,11 +27,11 @@
"sha256": "30c7b3c5ce7b7f876c2cf475a2815b6ac8e53b9986e471864b03de1558978d99"
},
{
"bytes": 5981,
"bytes": 6046,
"license": "MIT",
"path": "crates/labcolors-core/src/composition.rs",
"role": "composition_executor_source",
"sha256": "195a67327a3bd86d7816b634481389930bf68577bb1202fad14c2ea152df8625"
"sha256": "0497b90b5e4bf8771604758034bee81655bcd5aedd934e9fef9dfc66429b07b7"
},
{
"bytes": 7419,
Expand All @@ -48,11 +48,11 @@
"sha256": "8bf5d5a1c0f00ce245a1ecb18b923aa1631483345962d72b633e466c242a8a1d"
},
{
"bytes": 14149,
"bytes": 14163,
"license": "MIT",
"path": "crates/labcolors-core/src/lib.rs",
"role": "module_registration_source",
"sha256": "919b46d9a838b1f5f333af938c2db7bfa20ba444e22c841def0349d93d213c38"
"sha256": "9c5493cc2d4dcca04dc989f61431e126d3f4ae973f284af0bac232059192dfed"
},
{
"bytes": 39439,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a1cedccfe9acf5feeb9244e4c9ed3dc7ee1c1703fc6910c665dbd88443899b14 receipt-v1.json
f29c6f4fc5d814843d1f64fdb4d26cb986968a675c67d8350f8f5a0ba9a2fddb receipt-v1.json

Large diffs are not rendered by default.

390 changes: 94 additions & 296 deletions crates/labcolors-core/src/alpha.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/labcolors-core/src/appearance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ impl SourceOverCertificateV1 {
self.subject_opacity.bits()
}

const fn subject_opacity(&self) -> crate::composition::AdmittedOpacityV1 {
pub(crate) const fn subject_opacity(&self) -> crate::composition::AdmittedOpacityV1 {
self.subject_opacity
}

Expand Down
2 changes: 1 addition & 1 deletion crates/labcolors-core/src/appearance_graph_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ fn static_exact_program_is_declarative_topology_plus_typed_constraint() {
.unwrap();
assert!(crate::appearance::point_program_matches(&compiled));
assert_eq!(
crate::analog::ExactAlphaProgramV1::physical_identity(),
crate::point_representation::ExactPointRepresentationV1::physical_identity(),
crate::appearance::PhysicalProgramIdentityV1::InputOpacityOverSurfaceEncodedSrgb8V1
);
assert_eq!(
Expand Down
1 change: 1 addition & 0 deletions crates/labcolors-core/src/composition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub(crate) enum CompositionProfileV1 {
pub(crate) struct AdmittedOpacityV1(u64);

impl AdmittedOpacityV1 {
pub(crate) const TRANSPARENT: Self = Self(0.0f64.to_bits());
pub(crate) const OPAQUE: Self = Self(1.0f64.to_bits());

pub(crate) fn new(alpha: f64) -> Result<Self, OpacityAdmissionErrorV1> {
Expand Down
6 changes: 3 additions & 3 deletions crates/labcolors-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ const HUE_STIFFNESS_MIN_INCLUSIVE: f64 = 0.0;
/// Запрошенная альфа альфа-аналога (`roles.*.alpha`) обязана лежать в `(0, 1]`.
///
/// `≤ 0` — невидимая роль (вырождение), `> 1` — не альфа. Резолвер поднимает
/// фактическую α до `α_min`, если запрошенная ниже минимально-разрешимой в
/// гамуте ([`crate::alpha::resolve_alpha_analog`]) — но сам запрос должен быть
/// валидной альфой.
/// фактическую α до первого exact sRGB8-представления, если запрос ниже
/// минимально разрешимого в гамуте. Сам запрос всё равно обязан быть валидной
/// альфой.
const ALPHA_MIN_EXCLUSIVE: f64 = 0.0;
/// Верхний предел запрошенной альфы (включительно; α = 1 = солид).
const ALPHA_MAX_INCLUSIVE: f64 = 1.0;
Expand Down
73 changes: 72 additions & 1 deletion crates/labcolors-core/src/generic_boundary_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::path::PathBuf;
mod source_scanner;

const APPEARANCE_SOURCE: &str = include_str!("appearance.rs");
const ALPHA_SOURCE: &str = include_str!("alpha.rs");
const CLEAN_SET_SOURCE: &str = include_str!("clean_set.rs");
const CONSTRAINTS_SOURCE: &str = include_str!("constraints/mod.rs");
const CONTEXTUAL_REGION_SOURCE: &str = include_str!("contextual_region.rs");
Expand All @@ -20,13 +21,82 @@ const OUTPUT_PROJECTION_SOURCE: &str = include_str!("output_projection.rs");
const PROGRAM_ATTACHMENT_SOURCE: &str = include_str!("program/attachment.rs");
const PROGRAM_SOURCE: &str = include_str!("program.rs");
const POINT_SUPPORT_SOURCE: &str = include_str!("point_support.rs");
const POINT_REPRESENTATION_SOURCE: &str = include_str!("point_representation.rs");
const PROGRAM_IDENTITY_SOURCE: &str = include_str!("program_identity.rs");
const PROGRAM_SESSION_SOURCE: &str = include_str!("program_session.rs");
const RELATION_SOURCE: &str = include_str!("relation.rs");
const SEMANTIC_SOURCE: &str = include_str!("semantic.rs");
const SESSION_SOURCE: &str = include_str!("session.rs");
const WCAG22_CONSTRAINT_SOURCE: &str = include_str!("constraints/wcag22.rs");

const GENERIC_SOURCES: [(&str, &str); 10] = [
#[test]
fn point_representation_execution_is_generic_and_the_helper_facade_is_gone() {
let representation = normalized_production_code(POINT_REPRESENTATION_SOURCE);
for forbidden in [
"alphaanalog",
"authoredalphabinding",
"exactalphaprogram",
"crate::analog",
"rolerecipe",
"rolespec",
] {
assert!(
!representation.contains(forbidden),
"generic point representation still owns recipe vocabulary `{forbidden}`",
);
}
for required in [
"pointopacityoversurfacev1",
"assess_visible_point_hard",
"exactidentityreleasev1",
] {
assert!(
representation.contains(required),
"generic point representation lost physical gate `{required}`",
);
}

let alpha = compact_production_syntax(ALPHA_SOURCE).to_ascii_lowercase();
for removed in [
"structalphaanalog",
"fnresolve_alpha_analog(",
"fnresolve_alpha_analog_hex(",
"crate::analog",
] {
assert!(
!alpha.contains(removed),
"public alpha helper facade still exposes removed recipe path `{removed}`",
);
}
assert!(
!LIB_SOURCE.contains("mod analog;"),
"the recipe-shaped execution module must be deleted",
);

let semantic = compact_production_syntax(SEMANTIC_SOURCE).to_ascii_lowercase();
for removed in [
"compiledalphaanaloginvocation",
"compiledalpha-analoginvocation",
"alpha_analog_invocations",
"compile_alpha_analog_invocations",
] {
assert!(
!semantic.contains(removed),
"compiled execution still owns recipe-shaped IR `{removed}`",
);
}
for required in [
"compiledpointrepresentationinvocationv1",
"resolve_exact_point_representation_v1",
] {
assert!(
semantic.contains(required),
"frozen frontend no longer lowers through generic point IR `{required}`",
);
}
}

const GENERIC_SOURCES: [(&str, &str); 11] = [
("appearance.rs", APPEARANCE_SOURCE),
("constraints/family.rs", FAMILY_CONSTRAINT_SOURCE),
("constraints/relation.rs", RELATION_CONSTRAINT_SOURCE),
Expand All @@ -36,6 +106,7 @@ const GENERIC_SOURCES: [(&str, &str); 10] = [
("program/attachment.rs", PROGRAM_ATTACHMENT_SOURCE),
("program_identity.rs", PROGRAM_IDENTITY_SOURCE),
("program_session.rs", PROGRAM_SESSION_SOURCE),
("point_representation.rs", POINT_REPRESENTATION_SOURCE),
("relation.rs", RELATION_SOURCE),
];

Expand Down
2 changes: 1 addition & 1 deletion crates/labcolors-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub use srgb8::Srgb8;

pub(crate) mod accent_balance;
pub mod alpha;
pub(crate) mod analog;
pub(crate) mod appearance;
pub mod config;
pub(crate) mod constraints;
Expand All @@ -47,6 +46,7 @@ pub mod numerical_plan;
reason = "the output-profile firewall is intentionally internal to registered profiles"
)]
pub(crate) mod output_projection;
pub(crate) mod point_representation;
#[cfg_attr(
not(test),
expect(
Expand Down
Loading
Loading