@@ -61,6 +61,13 @@ const ExecutedParityCounts = struct {
6161 measurement_space : usize = 0 ,
6262};
6363
64+ const ParityRunResult = struct {
65+ expected : ExecutedParityCounts ,
66+ executed : ExecutedParityCounts ,
67+ };
68+
69+ const vendor_ascii_hdf_anchor_path = "validation/compatibility/disamar_asciihdf_anchor.txt" ;
70+
6471fn parseParityComponent (value : []const u8 ) ! ParityComponent {
6572 if (std .mem .eql (u8 , value , "transport" )) return .transport ;
6673 if (std .mem .eql (u8 , value , "retrieval" )) return .retrieval ;
@@ -79,6 +86,16 @@ fn includesParityComponent(
7986 return false ;
8087}
8188
89+ fn incrementParityCounts (counts : * ExecutedParityCounts , component : ParityComponent ) void {
90+ counts .total += 1 ;
91+ switch (component ) {
92+ .transport = > counts .transport += 1 ,
93+ .retrieval = > counts .retrieval += 1 ,
94+ .optics = > counts .optics += 1 ,
95+ .measurement_space = > counts .measurement_space += 1 ,
96+ }
97+ }
98+
8299fn matrixIndex (row : usize , column : usize , column_count : usize ) usize {
83100 return row * column_count + column ;
84101}
@@ -533,21 +550,21 @@ fn prepareOpticalStateForCase(
533550 allocator ,
534551 .spectroscopy_line_list ,
535552 "data/cross_sections/bundle_manifest.json" ,
536- "o2a_hitran_07_hit08_tropomi " ,
553+ "o2a_hitran_subset_07_hit08_tropomi " ,
537554 );
538555 defer line_asset .deinit (allocator );
539556 var strong_asset = try zdisamar .ingest .reference_assets .loadCsvBundleAsset (
540557 allocator ,
541558 .spectroscopy_strong_line_set ,
542559 "data/cross_sections/bundle_manifest.json" ,
543- "o2a_lisa_sdf " ,
560+ "o2a_lisa_sdf_subset " ,
544561 );
545562 defer strong_asset .deinit (allocator );
546563 var rmf_asset = try zdisamar .ingest .reference_assets .loadCsvBundleAsset (
547564 allocator ,
548565 .spectroscopy_relaxation_matrix ,
549566 "data/cross_sections/bundle_manifest.json" ,
550- "o2a_lisa_rmf " ,
567+ "o2a_lisa_rmf_subset " ,
551568 );
552569 defer rmf_asset .deinit (allocator );
553570
@@ -563,7 +580,7 @@ fn prepareOpticalStateForCase(
563580 allocator ,
564581 .collision_induced_absorption_table ,
565582 "data/cross_sections/bundle_manifest.json" ,
566- "o2o2_bira_o2a " ,
583+ "o2o2_bira_o2a_subset " ,
567584 );
568585 defer cia_asset .deinit (allocator );
569586 collision_induced_absorption = try cia_asset .toCollisionInducedAbsorptionTable (allocator );
@@ -716,7 +733,7 @@ fn expectNear(actual: f64, expected: f64, absolute_tolerance: f64, relative_tole
716733
717734fn runParityCases (
718735 components : []const ParityComponent ,
719- ) ! ExecutedParityCounts {
736+ ) ! ParityRunResult {
720737 const raw = try std .fs .cwd ().readFileAlloc (
721738 std .testing .allocator ,
722739 "validation/compatibility/parity_matrix.json" ,
@@ -743,11 +760,13 @@ fn runParityCases(
743760 try engine .bootstrapBuiltinCatalog ();
744761
745762 var workspace = engine .createWorkspace ("compatibility-suite" );
763+ var expected_counts = ExecutedParityCounts {};
746764 var executed_counts = ExecutedParityCounts {};
747765
748766 for (matrix .value .cases ) | case | {
749767 const component = try parseParityComponent (case .component );
750768 if (! includesParityComponent (components , component )) continue ;
769+ incrementParityCounts (& expected_counts , component );
751770
752771 if (component == .retrieval ) {
753772 const supported_status =
@@ -921,40 +940,40 @@ fn runParityCases(
921940 try expectBoundedO2AMorphology (product .wavelengths , product .reflectance );
922941 }
923942 }
924- executed_counts .total += 1 ;
925- switch (component ) {
926- .transport = > executed_counts .transport += 1 ,
927- .retrieval = > executed_counts .retrieval += 1 ,
928- .optics = > executed_counts .optics += 1 ,
929- .measurement_space = > executed_counts .measurement_space += 1 ,
930- }
943+ incrementParityCounts (& executed_counts , component );
931944 }
932945
933- return executed_counts ;
946+ return .{
947+ .expected = expected_counts ,
948+ .executed = executed_counts ,
949+ };
934950}
935951
936952test "compatibility harness executes transport and measurement-space parity cases against vendor anchors" {
937- const executed = try runParityCases (&.{ .transport , .measurement_space });
938- try std .testing .expect (executed .total > 0 );
939- try std .testing .expect (executed .transport > 0 );
940- try std .testing .expect (executed .measurement_space > 0 );
953+ const result = try runParityCases (&.{ .transport , .measurement_space });
954+ try std .testing .expect (result .expected .total > 0 );
955+ try std .testing .expectEqual (result .expected .total , result .executed .total );
956+ try std .testing .expectEqual (result .expected .transport , result .executed .transport );
957+ try std .testing .expectEqual (result .expected .measurement_space , result .executed .measurement_space );
941958}
942959
943960test "compatibility harness executes retrieval parity cases against vendor anchors" {
944- const executed = try runParityCases (&.{.retrieval });
945- try std .testing .expect (executed .total > 0 );
946- try std .testing .expect (executed .retrieval > 0 );
961+ const result = try runParityCases (&.{.retrieval });
962+ try std .testing .expect (result .expected .retrieval > 0 );
963+ try std .testing .expectEqual (result .expected .total , result .executed .total );
964+ try std .testing .expectEqual (result .expected .retrieval , result .executed .retrieval );
947965}
948966
949967test "compatibility harness executes optics parity cases against vendor anchors" {
950- const executed = try runParityCases (&.{.optics });
951- try std .testing .expect (executed .total > 0 );
952- try std .testing .expect (executed .optics > 0 );
968+ const result = try runParityCases (&.{.optics });
969+ try std .testing .expect (result .expected .optics > 0 );
970+ try std .testing .expectEqual (result .expected .total , result .executed .total );
971+ try std .testing .expectEqual (result .expected .optics , result .executed .optics );
953972}
954973
955974fn expectBoundedVendorAsciiHdfDiagnostics () ! void {
956975 const anchor = try parseVendorAsciiHdfAnchor (
957- "vendor/disamar-fortran/test/disamar.asciiHDF" ,
976+ vendor_ascii_hdf_anchor_path ,
958977 std .testing .allocator ,
959978 );
960979
@@ -969,12 +988,13 @@ test "compatibility harness parses bounded vendor retrieval diagnostics from asc
969988}
970989
971990test "compatibility harness executes the full parity matrix against vendor anchors" {
972- const executed = try runParityCases (&.{ .transport , .measurement_space , .retrieval , .optics });
973- try std .testing .expect (executed .total > 0 );
974- try std .testing .expect (executed .transport > 0 );
975- try std .testing .expect (executed .measurement_space > 0 );
976- try std .testing .expect (executed .retrieval > 0 );
977- try std .testing .expect (executed .optics > 0 );
991+ const result = try runParityCases (&.{ .transport , .measurement_space , .retrieval , .optics });
992+ try std .testing .expect (result .expected .total > 0 );
993+ try std .testing .expectEqual (result .expected .total , result .executed .total );
994+ try std .testing .expectEqual (result .expected .transport , result .executed .transport );
995+ try std .testing .expectEqual (result .expected .measurement_space , result .executed .measurement_space );
996+ try std .testing .expectEqual (result .expected .retrieval , result .executed .retrieval );
997+ try std .testing .expectEqual (result .expected .optics , result .executed .optics );
978998 try expectPreparedRouteRtmControls ();
979999 try expectBoundedVendorAsciiHdfDiagnostics ();
9801000}
0 commit comments