Skip to content

Commit

Permalink
refactor: create type NonNormalizedPropertyValue
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Aug 1, 2024
1 parent ac988cf commit 825cf40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions moz-webgpu-cts/src/process_reports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::{
taint_subtest_timeouts_by_suspicion,
wpt::{
metadata::{
properties::{ExpandedPropertyValue, Expected},
properties::{ExpandedPropertyValue, Expected, NonNormalizedPropertyValue},
BuildProfile, File, FileProps, ImplementationStatus, Platform, Subtest, SubtestOutcome,
Test, TestOutcome, TestProps,
},
Expand All @@ -38,7 +38,7 @@ where
Out: EnumSetType,
{
pub meta_props: Option<TestProps<Out>>,
pub reported: BTreeMap<Platform, BTreeMap<BuildProfile, Expected<Out>>>,
pub reported: NonNormalizedPropertyValue<Expected<Out>>,
}

#[derive(Debug, Default)]
Expand Down Expand Up @@ -83,7 +83,7 @@ fn cts_path(test_entry_path: &TestEntryPath<'_>) -> Option<String> {
}

fn accumulate<Out>(
recorded: &mut BTreeMap<Platform, BTreeMap<BuildProfile, Expected<Out>>>,
recorded: &mut NonNormalizedPropertyValue<Expected<Out>>,
platform: Platform,
build_profile: BuildProfile,
reported_outcome: Out,
Expand All @@ -108,7 +108,7 @@ fn accumulate<Out>(
fn reconcile<Out>(
parent_implementation_status: Option<&ExpandedPropertyValue<ImplementationStatus>>,
meta_props: &mut TestProps<Out>,
reported: BTreeMap<Platform, BTreeMap<BuildProfile, Expected<Out>>>,
reported: NonNormalizedPropertyValue<Expected<Out>>,
preset: ReportProcessingPreset,
implementation_status_filter: EnumSet<ImplementationStatus>,
) where
Expand Down
4 changes: 3 additions & 1 deletion moz-webgpu-cts/src/wpt/metadata/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,10 @@ where
}
}

/// Data from a [`NormalizedPropertyValue`].
/// Data from a [`NormalizedPropertyValue`]. A normalized form of [`NonNormalizedPropertyValue`].
pub type NormalizedPropertyValueData<T> = Normalized<Platform, Normalized<BuildProfile, T>>;

/// A value that is either `V` or a set of `V`s branched on by `K`.
pub type Normalized<K, V> = MaybeCollapsed<V, BTreeMap<K, V>>;

pub type NonNormalizedPropertyValue<T> = BTreeMap<Platform, BTreeMap<BuildProfile, T>>;

0 comments on commit 825cf40

Please sign in to comment.