Publish experiment 79358cfd00bd409f837b713972fba2ca (rollouts)
Browse filesFiles changed (21)
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/config/47dd5619991eaa019f78087ef054eefa35b4431058c22da92f852d76e64d4009/config.yamlAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/metrics/6d11e318b99a73e7fd91b2a023834884dfc5caec95e13f93c2248df290e0d44a/metrics.jsonAdded+12
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/0b09856a9eb4095c10b3ab84b78796161990ec4cbfaa6bfc278e9bda0d287f3e/candidate_count_matched.htmlAdded+1
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/29418a5e383dfd117e12e3301493095175a4e50f6babdfd5d4faa41155f39e47/roi_depth_spatial.pngAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2a85e21142786e54bff67b4ce38cac8234f97f2581fe5fffcc8c13ae1e8331c5/git_start.diffAdded+259
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2ebba979105ea42827b60a76f2002ba6671c353c0a87e6a72a7198c8c32a5abb/source_hashes.jsonAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/31c0914d201cda1604c3a2154af56cb0e2f6a7571b3eb6248777fa26dc23d29c/selection_before_annotation.jsonAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4bdad8c9377dd3e2d314bb9455ec9f39957a7c61450dcbbac3e1f907d500dcd0/reference_multiplicity.pngAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4f29eddf6ce14a045b15df9b3b862adf2ecd13098bc13ec15a510d6e223e348c/implementation.patchAdded+1153
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/5ef74e80ebb59abc9a7252b14821543c3143c14657b3bf48a7f2f2f19a745d71/task03h_preflight_failure.jsonAdded+9
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/65a2abdcf1b82ade8efbc6ad20b60ba63b8ebfaf8844bbcc502b3029801aed44/verification.jsonAdded+81
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/70122d8d460c58006717ee94e671693207056d0400fdafd81d0d1998a7ff94c3/candidate_original.pngAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480/report-8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480.zipAdded+3
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/932d1b3f751b1263aafd53079fac6800330c31a0c1150af26a9065042def9dde/tests.logAdded+29
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9c8e2db57eca489aa4e4d0176de411462341a4bf8292ca0a02583b3417289017/03h_candidate_count_matched.mdAdded+102
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9cabfb70a117866f17b57b05734b3c6655f253c8c5a0c540c98a0705bcae584b/expected_coverage.pngAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9f943e6647f621b507943d1744c24c1deab9f26f7ea552dcfb67b677f976ca9e/git_end.jsonAdded+8
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/a8e40e2c2bed6f39c79d615cdcfc16f8f4913aedf689b196e17c11a89505da27/candidate_matched.pngAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/c36ddd01f6567f59398bd5ee2f6bfc914ab88744cb40f2a50d2cbef14aede2c9/candidate_count_matched.jsonAdded
- visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/cf1d50c687f97c1310578c151b2541037910dfe2a3a27eca890b0cfd7b7d93e2/git_start.jsonAdded+36
- visual/79358cfd00bd409f837b713972fba2ca/manifests/757ff7470aaca181f0f2efa9e70a6b0b55f276123197746caf766fa35dac703e/manifest.jsonAdded+155
123456789101112[ { "metrics": { "fd2_original": 57, "observed_random_expected": 9.342834391061388, "pca5_matched_expected": 79.89870045121945, "primary_delta": 22.898700451219455 }, "run_id": "79358cfd00bd409f837b713972fba2ca", "step": null }]1<!doctype html><html lang="ko"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Task03-H candidate count matching</title><style>body{font:16px/1.6 system-ui;max-width:1500px;margin:32px auto;padding:0 24px;color:#172235;background:#f8fafc}h1,h2{line-height:1.3}table{border-collapse:collapse;width:100%;background:white}td,th{padding:10px;border:1px solid #cbd5e1;text-align:left}img{max-width:100%;height:auto;background:white}a{color:#0759b0}section{margin:32px 0}.note{padding:16px;background:#e5eefb}code{overflow-wrap:anywhere}</style><body><h1>Task03-H — Candidate count-matched analysis</h1><p>Run <code>79358cfd00bd409f837b713972fba2ca</code> · ep000 / Frame 0 / Box · orientation-only 20° · same-pair ≤2px AND ≤3mm</p><p class="note">동일 후보 수에서도 PCA5의 기대 rim coverage가 FD2보다 높다. 후보 수 증가만으로 원래 coverage 차이를 설명할 수 없다.<br>Primary exact expectation: 79.898700/103 vs FD2 57/103 (Δ +22.898700 references).</p><table><tr><th>Condition</th><th>Nodes</th><th>Rim matching nodes</th><th>Rim fraction</th><th>Unique refs /103</th></tr><tr><td>fd2 original</td><td>297</td><td>101</td><td>34.01%</td><td>57/103</td></tr><tr><td>pca5 original</td><td>599</td><td>127</td><td>21.20%</td><td>91/103</td></tr><tr><td>pca5_matched exact expectation</td><td>297</td><td>62.9699</td><td>21.20%</td><td>79.898700/103</td></tr><tr><td>observed_random exact expectation</td><td>297</td><td>3.8955</td><td>1.31%</td><td>9.342834/103</td></tr></table><p>Expectation rows are analytic, not sampled means. Rim matching fraction describes concentration near this specific rim; it is not general edge precision. GT/ROI are evaluation annotations only.</p><p>At equal 297 nodes, PCA5 has fewer expected rim matching nodes (62.9699 vs FD2 101) but covers more references. Its broader distribution persists: 29.278361 of the 35 original PCA5-only references are expected to remain covered. Increasing from 297 to 599 PCA5 candidates adds 11.101300 expected references; the count-matched advantage over FD2 is 22.898700 references. These are descriptive contrasts, not independent causal percentages.</p><h2>Original coverage groups</h2><table><tr><th>Original reference group</th><th>Refs</th><th>PCA5 k=297 expected retained</th></tr><tr><td>intersection</td><td>56</td><td>50.620339</td></tr><tr><td>fd2_only</td><td>1</td><td>0.000000</td></tr><tr><td>pca5_only</td><td>35</td><td>29.278361</td></tr></table><p>PCG64, SeedSequence([20261024+r,stream]), r=0…15; streams PCA5=0, observed=1. All overlays use preselected r=0. Sixteen-repeat SD/range describes subset variability, not generalization uncertainty.</p><table><tr><th>16 fixed repeats</th><th>Actual unique refs mean</th><th>Sample SD</th><th>Min–max</th><th>Matching nodes mean</th><th>ROI union nodes mean</th></tr><tr><td>pca5_matched</td><td>79.0625/103</td><td>4.8093</td><td>68–86</td><td>62.8125/297</td><td>139.8125/297</td></tr><tr><td>observed_random</td><td>8.8125/103</td><td>3.9870</td><td>1–18</td><td>3.8125/297</td><td>268.1250/297</td></tr></table><section><h2>Original candidate locations: full Box and common rim crop</h2><a href="candidate_original.png"><img src="candidate_original.png" alt="Original candidate locations: full Box and common rim crop"></a></section><section><h2>Equal 297 nodes: FD2 / PCA5 matched / observed random</h2><a href="candidate_matched.png"><img src="candidate_matched.png" alt="Equal 297 nodes: FD2 / PCA5 matched / observed random"></a></section><section><h2>Reference multiplicity, missing positions and coverage probability</h2><a href="reference_multiplicity.png"><img src="reference_multiplicity.png" alt="Reference multiplicity, missing positions and coverage probability"></a></section><section><h2>Exact expected coverage saturation; no threshold sweep</h2><a href="expected_coverage.png"><img src="expected_coverage.png" alt="Exact expected coverage saturation; no threshold sweep"></a></section><section><h2>Existing ROI union, individual ROI occupancy, depth and spatial distribution</h2><a href="roi_depth_spatial.png"><img src="roi_depth_spatial.png" alt="Existing ROI union, individual ROI occupancy, depth and spatial distribution"></a></section><p>Overlapping ROI occupancy is not a false-edge label. Far positive depth is not contamination truth. Node counts, matching nodes, pair counts and unique references are distinct. All reference coverage ratios use the same 103 references. Single-frame Box evidence does not establish all-shape detector superiority or Graph/GNN/BC utility.</p><h2>Artifacts and reproducibility</h2><ul><li><a href="candidate_count_matched.json">Result JSON</a></li><li><a href="candidate_count_matched.npz">Source/subsets/pairs NPZ</a></li><li><a href="verification.json">Verification</a></li><li><a href="tests.log">Tests</a></li><li><a href="source_hashes.json">Source/input hashes</a></li><li><a href="implementation.patch">Implementation diff</a></li><li><a href="../../docs/visual-graph-integration/03h_candidate_count_matched.md">Korean Markdown report</a></li></ul><pre id="browser-check">image load pending</pre><script>window.addEventListener("load",()=>{document.getElementById("browser-check").textContent=JSON.stringify(Array.from(document.images).map(i=>({src:i.getAttribute("src"),complete:i.complete,width:i.naturalWidth,height:i.naturalHeight})))})</script></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259diff --git a/docs/visual-graph-integration/03_sampling.md b/docs/visual-graph-integration/03_sampling.mdindex acb3c0f..ac76cf2 100644--- a/docs/visual-graph-integration/03_sampling.md+++ b/docs/visual-graph-integration/03_sampling.md@@ -7,6 +7,10 @@ S4 depth-only 우선 선택은 이 조건에서 Peg 보존을 낮추고 가림· 이 수치는 **Tracker가 현재 관측한 reference 대비 Sampling 보존율**이다. 최종 detector, threshold, ratio 또는 feature 표현을 채택한 결과는 아니다. +후속 [Task03-D Box rim 병목 분석 Phase 1](03d_box_rim_bottleneck_phase1.md)은 저장된 frame 0/120의+관측·후보·priority·Surface coverage를 분리한다. Frame 0의 S3는 후보 coverage가 더 높지만+priority와 최종 coverage는 더 낮았다. 오염·원거리 depth·FPS 거리 경쟁의 인과 기여율은 미확인이다.+ 최종 run: `2551448b0fae4c6bbce3caf48774275f`. [전체 HTML](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/comparison.html), [전체 summary·설정·fidelity JSON](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/comparison.json), [검증 기록](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/verification.json), [budget/ratio/false selection/latency 그림](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/tradeoffs.png),diff --git a/visual/runtime/test/sampling_evaluation.py b/visual/runtime/test/sampling_evaluation.pyindex ea0f223..e242ecc 100644--- a/visual/runtime/test/sampling_evaluation.py+++ b/visual/runtime/test/sampling_evaluation.py@@ -44,6 +44,25 @@ class CoverageMatcher: @staticmethod def key(px,m): return f'{px:g}px_{m*1000:g}mm' + def reference_hits(self, selected_flat, px=2., m=.003):+ """Reference IDs and matched source nodes from the existing joint adjacency.++ IDs are row positions in the saved reference arrays, not rounded pixels.+ A node can cover multiple IDs; multiple nodes covering one ID count once.+ """+ selected_flat = np.asarray(selected_flat)+ if selected_flat.ndim != 1 or selected_flat.dtype.kind not in 'iu':+ raise ValueError('source indices must be a one-dimensional integer array')+ if len(np.unique(selected_flat)) != len(selected_flat):+ raise ValueError('duplicate source nodes')+ rows = np.searchsorted(self.flat, selected_flat)+ if len(rows) and ((rows >= len(self.flat)).any()+ or not np.array_equal(self.flat[rows], selected_flat)):+ raise ValueError('evaluation points outside observed support')+ adjacency = self.adjacencies[self.key(px, m)][rows]+ return (np.flatnonzero(adjacency.getnnz(axis=0)),+ selected_flat[adjacency.getnnz(axis=1) > 0])+ def score(self, selected_flat): rows = np.searchsorted(self.flat, selected_flat) if len(rows) and ((rows >= len(self.flat)).any() or not np.array_equal(self.flat[rows], selected_flat)):@@ -78,6 +97,61 @@ class CoverageMatcher: return out, arrays +def count_ratio(numerator, denominator):+ """Preserve raw counts, including undefined zero-denominator fractions."""+ return dict(numerator=int(numerator), denominator=int(denominator),+ value=numerator/denominator if denominator else None)+++def staged_reference_coverage(matcher, candidates, priority, surface, final):+ """Saved-set diagnosis only; no candidate extraction or selection is run.++ C/P are None for the General FPS control, rather than empty candidate sets.+ Set differences overlap and must not be summed as causal loss fractions.+ """+ if (candidates is None) != (priority is None):+ raise ValueError('candidate and priority applicability must agree')+ nodes = dict(X=matcher.flat, C=candidates, P=priority, S=surface, F=final)+ hits, stages = {}, {}+ for name, flat in nodes.items():+ if flat is None:+ hits[name] = None+ stages[name] = None+ continue+ ids, matched = matcher.reference_hits(flat)+ hits[name] = set(ids.tolist())+ stages[name] = dict(node_count=len(flat), matched_node_count=len(matched),+ unique_reference_count=len(ids))+ p = np.asarray(priority if priority is not None else [], dtype=np.int64)+ if np.intersect1d(p, surface).size or set(final) != set(p) | set(surface):+ raise ValueError('final nodes must be the disjoint priority/surface union')+ if candidates is not None and not set(p) <= set(candidates):+ raise ValueError('priority nodes outside candidate support')+ v, o = set(range(matcher.nref)), hits['X']+ c, p, s, f = hits['C'], hits['P'], hits['S'], hits['F']+ if not f <= o or (c is not None and not c <= o):+ raise AssertionError('covered references outside observable references')+ if f != (p or set()) | s:+ raise AssertionError('final reference union differs from priority/surface')+ differences = {'V_minus_O': v-o, 'O_minus_F': o-f}+ if c is not None:+ differences.update(O_minus_C=o-c, C_minus_P=c-p, C_minus_F=c-f,+ P_intersect_S=p&s, S_minus_P=s-p, S_minus_C=s-c,+ C_minus_P_intersect_S=(c-p)&s)+ else:+ differences.update({key: None for key in ('O_minus_C', 'C_minus_P', 'C_minus_F',+ 'P_intersect_S', 'S_minus_P', 'S_minus_C', 'C_minus_P_intersect_S')})+ coverage = dict(observation=count_ratio(len(o), len(v)))+ for name, key in [('C', 'candidate'), ('P', 'priority'), ('S', 'surface'), ('F', 'final_retention')]:+ coverage[key] = count_ratio(len(hits[name]), len(o)) if hits[name] is not None else None+ return dict(stages=stages, coverage=coverage,+ gt_final_coverage=count_ratio(len(f), len(v)),+ reference_ids={k: sorted(ids) if ids is not None else None+ for k, ids in dict(V=v, O=o, **hits).items()},+ differences={k: dict(count=len(ids), reference_ids=sorted(ids)) if ids is not None else None+ for k, ids in differences.items()})++ def evaluation_context(frame, evidence, gt, camera, robot_ids): """Reuse unchanged Task02 visible seam/rim definition; GT read after extraction.""" truths, regions, maps = real_truth(frame, evidence.frame, gt, camera)diff --git a/visual/runtime/test/test_sampling_evaluation.py b/visual/runtime/test/test_sampling_evaluation.pyindex 798172c..6975e66 100644--- a/visual/runtime/test/test_sampling_evaluation.py+++ b/visual/runtime/test/test_sampling_evaluation.py@@ -13,7 +13,10 @@ from visual.runtime.rgbd import PEG, BOX from visual.runtime.sampling import extract_sampling_evidence, sample_points, SamplingConfig from visual.runtime.test.normal_diagnostics import synthetic_frame, oracle, box_primitives, rim_region from visual.runtime.test.run_structural_edges import rim_reference-from visual.runtime.test.sampling_evaluation import CoverageMatcher+from visual.runtime.test.sampling_evaluation import CoverageMatcher, staged_reference_coverage+from visual.runtime.test.run_rim_bottleneck import (+ geometry_evidence, validate_saved_selection, occupancy, source_contract,+) from visual.runtime.test.run_sampling import conditions, evaluate @@ -110,4 +113,135 @@ class SamplingEvaluationTests(unittest.TestCase): with self.assertRaises(ValueError):evaluate(episode,masks,root/'out',camera='camera',selected=(),make_plots=False) +class StagedCoverageTests(unittest.TestCase):+ def fixture(self):+ mask = np.zeros((16, 16), bool)+ mask[5, [3, 6, 10]] = True+ k = np.array([[1000., 0, 8], [0, 1000., 8], [0, 0, 1]])+ frame = synthetic_frame(np.full((16, 16), .3, np.float32), k, mask)+ geometry = build_organized_geometry(frame)+ uv = np.array([[2., 5], [4.5, 5], [7., 5], [10., 5]])+ xyz = np.tile(geometry.xyz[5, 6], (4, 1))+ matcher = CoverageMatcher(geometry, PEG, (uv, xyz))+ return frame, geometry, matcher++ def test_reference_overlap_union_and_surface_outside_candidates(self):+ _, _, matcher = self.fixture()+ c, p, s, f = [np.array(a, np.int64) for a in ([83, 86], [83], [86, 90], [90, 83, 86])]+ row = staged_reference_coverage(matcher, c, p, s, f)+ self.assertEqual(row['reference_ids']['C'], [0, 1, 2])+ self.assertEqual(row['reference_ids']['P'], [0, 1])+ self.assertEqual(row['reference_ids']['S'], [1, 2, 3])+ self.assertEqual(row['reference_ids']['F'], [0, 1, 2, 3])+ self.assertEqual(row['stages']['C'], dict(node_count=2, matched_node_count=2, unique_reference_count=3))+ expected = dict(V_minus_O=0, O_minus_C=1, C_minus_P=1, C_minus_F=0,+ P_intersect_S=1, S_minus_P=2, S_minus_C=1,+ C_minus_P_intersect_S=1, O_minus_F=0)+ self.assertEqual({k: v['count'] for k, v in row['differences'].items()}, expected)+ self.assertEqual(row['coverage']['candidate'], dict(numerator=3, denominator=4, value=.75))++ def test_two_different_nodes_cannot_satisfy_one_reference_pair(self):+ frame, _, _ = self.fixture()+ intrinsic = frame.intrinsic.copy(); intrinsic[0, 0] = 100.+ geometry = build_organized_geometry(replace(frame, intrinsic=intrinsic))+ # Node 83 satisfies 2D only; node 90 satisfies 3D only.+ matcher = CoverageMatcher(geometry, PEG, (np.array([[3., 5]]), geometry.xyz[5, 10][None]))+ ids, matched = matcher.reference_hits(np.array([83, 90]))+ self.assertEqual((len(ids), len(matched)), (0, 0))++ def test_empty_points_zero_observation_and_zero_visible(self):+ frame, geometry, matcher = self.fixture()+ empty = np.array([], np.int64)+ row = staged_reference_coverage(matcher, empty, empty, empty, empty)+ self.assertEqual(row['coverage']['final_retention'], dict(numerator=0, denominator=4, value=0.))+ geometry = build_organized_geometry(replace(frame, masks={PEG: np.zeros_like(frame.depth, bool)}))+ for refs in ((matcher.ref_uv, matcher.ref_xyz), (np.empty((0, 2)), np.empty((0, 3)))):+ row = staged_reference_coverage(CoverageMatcher(geometry, PEG, refs), empty, empty, empty, empty)+ self.assertEqual(row['coverage']['final_retention'], dict(numerator=0, denominator=0, value=None))+ self.assertEqual(row['coverage']['observation']['numerator'], 0)+ self.assertEqual(row['coverage']['observation']['denominator'], len(refs[0]))++ def test_general_fps_candidate_and_priority_are_inapplicable(self):+ _, _, matcher = self.fixture()+ flat = matcher.flat+ row = staged_reference_coverage(matcher, None, None, flat, flat)+ for name in ('C', 'P'):+ self.assertIsNone(row['stages'][name])+ self.assertIsNone(row['coverage']['candidate'])+ self.assertIsNone(row['coverage']['priority'])+ self.assertIsNone(row['differences']['O_minus_C'])+ self.assertEqual(row['coverage']['surface'], row['coverage']['final_retention'])++ def test_invalid_nodes_and_non_partition_are_rejected(self):+ _, _, matcher = self.fixture()+ for flat in (np.array([0]), np.array([83, 83]), np.array([256]), np.array([-1]), np.array([83.])):+ with self.assertRaises(ValueError):+ matcher.reference_hits(flat)+ with self.assertRaises(ValueError):+ staged_reference_coverage(matcher, np.array([83]), np.array([86]), np.array([90]), np.array([86, 90]))+ with self.assertRaises(ValueError):+ staged_reference_coverage(matcher, matcher.flat, np.array([83]), np.array([83, 90]), np.array([83, 90]))+ with self.assertRaises(ValueError):+ staged_reference_coverage(matcher, matcher.flat, np.array([83]), np.array([90]), matcher.flat)++ def test_geometry_alignment_invalid_depth_overlap_and_pixel_centres(self):+ frame, _, _ = self.fixture()+ depth = frame.depth.copy()+ depth[5, 6] = 0+ depth[2, 2] = np.nan+ box = np.zeros_like(depth, bool)+ box[5, 10] = True # ambiguous in BOTH masks+ frame = replace(frame, depth=depth, masks={PEG: frame.masks[PEG], BOX: box})+ evidence = geometry_evidence(frame)+ geometry = evidence.frame.geometry+ self.assertEqual(np.flatnonzero(geometry.observed_mask(PEG)).tolist(), [83])+ self.assertFalse(geometry.observed_mask(BOX).any())+ self.assertTrue(np.isnan(geometry.xyz[5, 6]).all())+ z = float(depth[5, 3])+ np.testing.assert_allclose(geometry.xyz[5, 3], [(3.5-8)*z/1000, (5.5-8)*z/1000, z], rtol=1e-7)+ # Minimal evaluation adapter has exactly the existing validity ROI field.+ from visual.runtime.geometry import compute_geometric_features, GeometryParameters+ for oid in (PEG, BOX):+ features = compute_geometric_features(geometry, oid, np.full_like(geometry.xyz, np.nan),+ np.zeros_like(depth, bool), GeometryParameters())+ np.testing.assert_array_equal(evidence.frame.objects[oid].depth_validity_boundary,+ features.depth_validity_boundary)+ key = 'saved'+ archive = {'source_frame': np.array(frame.source_frame), 'shape': np.array(depth.shape),+ key+'/flat_index': np.array([83]), key+'/pixels_vu': np.array([[5, 3]]),+ key+'/object_id': np.array([PEG]), key+'/points': geometry.xyz[5, 3][None].copy(),+ key+'/priority_selected': np.array([False]), key+'/depth_priority_selected': np.array([False])}+ self.assertTrue(validate_saved_selection(archive, key, frame, geometry)['xyz_exact'])+ for field, corrupted in [('points', archive[key+'/points']+.001), ('pixels_vu', np.array([[5, 4]])),+ ('object_id', np.array([BOX]))]:+ with self.assertRaises((ValueError, AssertionError)):+ validate_saved_selection(dict(archive, **{key+'/'+field: corrupted}), key, frame, geometry)+ with self.assertRaises(ValueError):+ validate_saved_selection(dict(archive, source_frame=np.array(frame.source_frame+1)), key, frame, geometry)++ def test_negative_union_deduplicates_and_depth_bands_cover_paths(self):+ frame, _, matcher = self.fixture()+ a = np.zeros_like(frame.depth, bool); b = a.copy()+ a[5, [3, 6]] = True; b[5, [6, 10]] = True+ row = occupancy(frame, dict(X=matcher.flat, C=None, P=None, S=matcher.flat, F=matcher.flat), dict(a=a, b=b))+ roi = row['negative_roi']+ self.assertEqual(roi['a']['F']['count']+roi['b']['F']['count'], 4)+ self.assertEqual(roi['known_negative_union']['F']['count'], 3)+ self.assertIsNone(roi['known_negative_union']['P'])+ self.assertEqual(sum(v['numerator'] for v in row['depth_quantile_occupancy']['F'].values()), 3)++ def test_historical_evaluation_changes_fail_closed(self):+ import hashlib+ with tempfile.TemporaryDirectory() as directory:+ root = Path(directory)+ relative = 'visual/runtime/test/sampling_evaluation.py'+ snapshot = root/'evaluated_source'/relative+ snapshot.parent.mkdir(parents=True)+ source = Path(relative).read_text().replace('<= m', '<= m*2', 1)+ snapshot.write_text(source)+ config = {'source_sha256': {relative: hashlib.sha256(snapshot.read_bytes()).hexdigest()}}+ with self.assertRaisesRegex(ValueError, 'historical evaluation definition'):+ source_contract(root, config)++ if __name__=='__main__':unittest.main()1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153diff --git a/docs/visual-graph-integration/03_sampling.md b/docs/visual-graph-integration/03_sampling.mdindex acb3c0f..ac76cf2 100644--- a/docs/visual-graph-integration/03_sampling.md+++ b/docs/visual-graph-integration/03_sampling.md@@ -7,6 +7,10 @@ S4 depth-only 우선 선택은 이 조건에서 Peg 보존을 낮추고 가림· 이 수치는 **Tracker가 현재 관측한 reference 대비 Sampling 보존율**이다. 최종 detector, threshold, ratio 또는 feature 표현을 채택한 결과는 아니다. +후속 [Task03-D Box rim 병목 분석 Phase 1](03d_box_rim_bottleneck_phase1.md)은 저장된 frame 0/120의+관측·후보·priority·Surface coverage를 분리한다. Frame 0의 S3는 후보 coverage가 더 높지만+priority와 최종 coverage는 더 낮았다. 오염·원거리 depth·FPS 거리 경쟁의 인과 기여율은 미확인이다.+ 최종 run: `2551448b0fae4c6bbce3caf48774275f`. [전체 HTML](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/comparison.html), [전체 summary·설정·fidelity JSON](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/comparison.json), [검증 기록](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/verification.json), [budget/ratio/false selection/latency 그림](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/tradeoffs.png),diff --git a/visual/runtime/test/sampling_evaluation.py b/visual/runtime/test/sampling_evaluation.pyindex ea0f223..e242ecc 100644--- a/visual/runtime/test/sampling_evaluation.py+++ b/visual/runtime/test/sampling_evaluation.py@@ -44,6 +44,25 @@ class CoverageMatcher: @staticmethod def key(px,m): return f'{px:g}px_{m*1000:g}mm' + def reference_hits(self, selected_flat, px=2., m=.003):+ """Reference IDs and matched source nodes from the existing joint adjacency.++ IDs are row positions in the saved reference arrays, not rounded pixels.+ A node can cover multiple IDs; multiple nodes covering one ID count once.+ """+ selected_flat = np.asarray(selected_flat)+ if selected_flat.ndim != 1 or selected_flat.dtype.kind not in 'iu':+ raise ValueError('source indices must be a one-dimensional integer array')+ if len(np.unique(selected_flat)) != len(selected_flat):+ raise ValueError('duplicate source nodes')+ rows = np.searchsorted(self.flat, selected_flat)+ if len(rows) and ((rows >= len(self.flat)).any()+ or not np.array_equal(self.flat[rows], selected_flat)):+ raise ValueError('evaluation points outside observed support')+ adjacency = self.adjacencies[self.key(px, m)][rows]+ return (np.flatnonzero(adjacency.getnnz(axis=0)),+ selected_flat[adjacency.getnnz(axis=1) > 0])+ def score(self, selected_flat): rows = np.searchsorted(self.flat, selected_flat) if len(rows) and ((rows >= len(self.flat)).any() or not np.array_equal(self.flat[rows], selected_flat)):@@ -78,6 +97,61 @@ class CoverageMatcher: return out, arrays +def count_ratio(numerator, denominator):+ """Preserve raw counts, including undefined zero-denominator fractions."""+ return dict(numerator=int(numerator), denominator=int(denominator),+ value=numerator/denominator if denominator else None)+++def staged_reference_coverage(matcher, candidates, priority, surface, final):+ """Saved-set diagnosis only; no candidate extraction or selection is run.++ C/P are None for the General FPS control, rather than empty candidate sets.+ Set differences overlap and must not be summed as causal loss fractions.+ """+ if (candidates is None) != (priority is None):+ raise ValueError('candidate and priority applicability must agree')+ nodes = dict(X=matcher.flat, C=candidates, P=priority, S=surface, F=final)+ hits, stages = {}, {}+ for name, flat in nodes.items():+ if flat is None:+ hits[name] = None+ stages[name] = None+ continue+ ids, matched = matcher.reference_hits(flat)+ hits[name] = set(ids.tolist())+ stages[name] = dict(node_count=len(flat), matched_node_count=len(matched),+ unique_reference_count=len(ids))+ p = np.asarray(priority if priority is not None else [], dtype=np.int64)+ if np.intersect1d(p, surface).size or set(final) != set(p) | set(surface):+ raise ValueError('final nodes must be the disjoint priority/surface union')+ if candidates is not None and not set(p) <= set(candidates):+ raise ValueError('priority nodes outside candidate support')+ v, o = set(range(matcher.nref)), hits['X']+ c, p, s, f = hits['C'], hits['P'], hits['S'], hits['F']+ if not f <= o or (c is not None and not c <= o):+ raise AssertionError('covered references outside observable references')+ if f != (p or set()) | s:+ raise AssertionError('final reference union differs from priority/surface')+ differences = {'V_minus_O': v-o, 'O_minus_F': o-f}+ if c is not None:+ differences.update(O_minus_C=o-c, C_minus_P=c-p, C_minus_F=c-f,+ P_intersect_S=p&s, S_minus_P=s-p, S_minus_C=s-c,+ C_minus_P_intersect_S=(c-p)&s)+ else:+ differences.update({key: None for key in ('O_minus_C', 'C_minus_P', 'C_minus_F',+ 'P_intersect_S', 'S_minus_P', 'S_minus_C', 'C_minus_P_intersect_S')})+ coverage = dict(observation=count_ratio(len(o), len(v)))+ for name, key in [('C', 'candidate'), ('P', 'priority'), ('S', 'surface'), ('F', 'final_retention')]:+ coverage[key] = count_ratio(len(hits[name]), len(o)) if hits[name] is not None else None+ return dict(stages=stages, coverage=coverage,+ gt_final_coverage=count_ratio(len(f), len(v)),+ reference_ids={k: sorted(ids) if ids is not None else None+ for k, ids in dict(V=v, O=o, **hits).items()},+ differences={k: dict(count=len(ids), reference_ids=sorted(ids)) if ids is not None else None+ for k, ids in differences.items()})++ def evaluation_context(frame, evidence, gt, camera, robot_ids): """Reuse unchanged Task02 visible seam/rim definition; GT read after extraction.""" truths, regions, maps = real_truth(frame, evidence.frame, gt, camera)diff --git a/visual/runtime/test/test_sampling_evaluation.py b/visual/runtime/test/test_sampling_evaluation.pyindex 798172c..6975e66 100644--- a/visual/runtime/test/test_sampling_evaluation.py+++ b/visual/runtime/test/test_sampling_evaluation.py@@ -13,7 +13,10 @@ from visual.runtime.rgbd import PEG, BOX from visual.runtime.sampling import extract_sampling_evidence, sample_points, SamplingConfig from visual.runtime.test.normal_diagnostics import synthetic_frame, oracle, box_primitives, rim_region from visual.runtime.test.run_structural_edges import rim_reference-from visual.runtime.test.sampling_evaluation import CoverageMatcher+from visual.runtime.test.sampling_evaluation import CoverageMatcher, staged_reference_coverage+from visual.runtime.test.run_rim_bottleneck import (+ geometry_evidence, validate_saved_selection, occupancy, source_contract,+) from visual.runtime.test.run_sampling import conditions, evaluate @@ -110,4 +113,135 @@ class SamplingEvaluationTests(unittest.TestCase): with self.assertRaises(ValueError):evaluate(episode,masks,root/'out',camera='camera',selected=(),make_plots=False) +class StagedCoverageTests(unittest.TestCase):+ def fixture(self):+ mask = np.zeros((16, 16), bool)+ mask[5, [3, 6, 10]] = True+ k = np.array([[1000., 0, 8], [0, 1000., 8], [0, 0, 1]])+ frame = synthetic_frame(np.full((16, 16), .3, np.float32), k, mask)+ geometry = build_organized_geometry(frame)+ uv = np.array([[2., 5], [4.5, 5], [7., 5], [10., 5]])+ xyz = np.tile(geometry.xyz[5, 6], (4, 1))+ matcher = CoverageMatcher(geometry, PEG, (uv, xyz))+ return frame, geometry, matcher++ def test_reference_overlap_union_and_surface_outside_candidates(self):+ _, _, matcher = self.fixture()+ c, p, s, f = [np.array(a, np.int64) for a in ([83, 86], [83], [86, 90], [90, 83, 86])]+ row = staged_reference_coverage(matcher, c, p, s, f)+ self.assertEqual(row['reference_ids']['C'], [0, 1, 2])+ self.assertEqual(row['reference_ids']['P'], [0, 1])+ self.assertEqual(row['reference_ids']['S'], [1, 2, 3])+ self.assertEqual(row['reference_ids']['F'], [0, 1, 2, 3])+ self.assertEqual(row['stages']['C'], dict(node_count=2, matched_node_count=2, unique_reference_count=3))+ expected = dict(V_minus_O=0, O_minus_C=1, C_minus_P=1, C_minus_F=0,+ P_intersect_S=1, S_minus_P=2, S_minus_C=1,+ C_minus_P_intersect_S=1, O_minus_F=0)+ self.assertEqual({k: v['count'] for k, v in row['differences'].items()}, expected)+ self.assertEqual(row['coverage']['candidate'], dict(numerator=3, denominator=4, value=.75))++ def test_two_different_nodes_cannot_satisfy_one_reference_pair(self):+ frame, _, _ = self.fixture()+ intrinsic = frame.intrinsic.copy(); intrinsic[0, 0] = 100.+ geometry = build_organized_geometry(replace(frame, intrinsic=intrinsic))+ # Node 83 satisfies 2D only; node 90 satisfies 3D only.+ matcher = CoverageMatcher(geometry, PEG, (np.array([[3., 5]]), geometry.xyz[5, 10][None]))+ ids, matched = matcher.reference_hits(np.array([83, 90]))+ self.assertEqual((len(ids), len(matched)), (0, 0))++ def test_empty_points_zero_observation_and_zero_visible(self):+ frame, geometry, matcher = self.fixture()+ empty = np.array([], np.int64)+ row = staged_reference_coverage(matcher, empty, empty, empty, empty)+ self.assertEqual(row['coverage']['final_retention'], dict(numerator=0, denominator=4, value=0.))+ geometry = build_organized_geometry(replace(frame, masks={PEG: np.zeros_like(frame.depth, bool)}))+ for refs in ((matcher.ref_uv, matcher.ref_xyz), (np.empty((0, 2)), np.empty((0, 3)))):+ row = staged_reference_coverage(CoverageMatcher(geometry, PEG, refs), empty, empty, empty, empty)+ self.assertEqual(row['coverage']['final_retention'], dict(numerator=0, denominator=0, value=None))+ self.assertEqual(row['coverage']['observation']['numerator'], 0)+ self.assertEqual(row['coverage']['observation']['denominator'], len(refs[0]))++ def test_general_fps_candidate_and_priority_are_inapplicable(self):+ _, _, matcher = self.fixture()+ flat = matcher.flat+ row = staged_reference_coverage(matcher, None, None, flat, flat)+ for name in ('C', 'P'):+ self.assertIsNone(row['stages'][name])+ self.assertIsNone(row['coverage']['candidate'])+ self.assertIsNone(row['coverage']['priority'])+ self.assertIsNone(row['differences']['O_minus_C'])+ self.assertEqual(row['coverage']['surface'], row['coverage']['final_retention'])++ def test_invalid_nodes_and_non_partition_are_rejected(self):+ _, _, matcher = self.fixture()+ for flat in (np.array([0]), np.array([83, 83]), np.array([256]), np.array([-1]), np.array([83.])):+ with self.assertRaises(ValueError):+ matcher.reference_hits(flat)+ with self.assertRaises(ValueError):+ staged_reference_coverage(matcher, np.array([83]), np.array([86]), np.array([90]), np.array([86, 90]))+ with self.assertRaises(ValueError):+ staged_reference_coverage(matcher, matcher.flat, np.array([83]), np.array([83, 90]), np.array([83, 90]))+ with self.assertRaises(ValueError):+ staged_reference_coverage(matcher, matcher.flat, np.array([83]), np.array([90]), matcher.flat)++ def test_geometry_alignment_invalid_depth_overlap_and_pixel_centres(self):+ frame, _, _ = self.fixture()+ depth = frame.depth.copy()+ depth[5, 6] = 0+ depth[2, 2] = np.nan+ box = np.zeros_like(depth, bool)+ box[5, 10] = True # ambiguous in BOTH masks+ frame = replace(frame, depth=depth, masks={PEG: frame.masks[PEG], BOX: box})+ evidence = geometry_evidence(frame)+ geometry = evidence.frame.geometry+ self.assertEqual(np.flatnonzero(geometry.observed_mask(PEG)).tolist(), [83])+ self.assertFalse(geometry.observed_mask(BOX).any())+ self.assertTrue(np.isnan(geometry.xyz[5, 6]).all())+ z = float(depth[5, 3])+ np.testing.assert_allclose(geometry.xyz[5, 3], [(3.5-8)*z/1000, (5.5-8)*z/1000, z], rtol=1e-7)+ # Minimal evaluation adapter has exactly the existing validity ROI field.+ from visual.runtime.geometry import compute_geometric_features, GeometryParameters+ for oid in (PEG, BOX):+ features = compute_geometric_features(geometry, oid, np.full_like(geometry.xyz, np.nan),+ np.zeros_like(depth, bool), GeometryParameters())+ np.testing.assert_array_equal(evidence.frame.objects[oid].depth_validity_boundary,+ features.depth_validity_boundary)+ key = 'saved'+ archive = {'source_frame': np.array(frame.source_frame), 'shape': np.array(depth.shape),+ key+'/flat_index': np.array([83]), key+'/pixels_vu': np.array([[5, 3]]),+ key+'/object_id': np.array([PEG]), key+'/points': geometry.xyz[5, 3][None].copy(),+ key+'/priority_selected': np.array([False]), key+'/depth_priority_selected': np.array([False])}+ self.assertTrue(validate_saved_selection(archive, key, frame, geometry)['xyz_exact'])+ for field, corrupted in [('points', archive[key+'/points']+.001), ('pixels_vu', np.array([[5, 4]])),+ ('object_id', np.array([BOX]))]:+ with self.assertRaises((ValueError, AssertionError)):+ validate_saved_selection(dict(archive, **{key+'/'+field: corrupted}), key, frame, geometry)+ with self.assertRaises(ValueError):+ validate_saved_selection(dict(archive, source_frame=np.array(frame.source_frame+1)), key, frame, geometry)++ def test_negative_union_deduplicates_and_depth_bands_cover_paths(self):+ frame, _, matcher = self.fixture()+ a = np.zeros_like(frame.depth, bool); b = a.copy()+ a[5, [3, 6]] = True; b[5, [6, 10]] = True+ row = occupancy(frame, dict(X=matcher.flat, C=None, P=None, S=matcher.flat, F=matcher.flat), dict(a=a, b=b))+ roi = row['negative_roi']+ self.assertEqual(roi['a']['F']['count']+roi['b']['F']['count'], 4)+ self.assertEqual(roi['known_negative_union']['F']['count'], 3)+ self.assertIsNone(roi['known_negative_union']['P'])+ self.assertEqual(sum(v['numerator'] for v in row['depth_quantile_occupancy']['F'].values()), 3)++ def test_historical_evaluation_changes_fail_closed(self):+ import hashlib+ with tempfile.TemporaryDirectory() as directory:+ root = Path(directory)+ relative = 'visual/runtime/test/sampling_evaluation.py'+ snapshot = root/'evaluated_source'/relative+ snapshot.parent.mkdir(parents=True)+ source = Path(relative).read_text().replace('<= m', '<= m*2', 1)+ snapshot.write_text(source)+ config = {'source_sha256': {relative: hashlib.sha256(snapshot.read_bytes()).hexdigest()}}+ with self.assertRaisesRegex(ValueError, 'historical evaluation definition'):+ source_contract(root, config)++ if __name__=='__main__':unittest.main()diff --git a/visual/runtime/test/run_candidate_count_matched.py b/visual/runtime/test/run_candidate_count_matched.pynew file mode 100644index 0000000..5073626--- /dev/null+++ b/visual/runtime/test/run_candidate_count_matched.py@@ -0,0 +1,708 @@+"""Task03-H: saved Frame 0 Box candidates; no detection, normals or FPS.++WANDB_MODE=disabled .venv/bin/python -m visual.runtime.test.run_candidate_count_matched \+ --baseline /tmp/task03h_start.json+"""+from __future__ import annotations++import argparse+from contextlib import ExitStack+import hashlib+import html+from html.parser import HTMLParser+import json+import math+from operator import index+import os+from pathlib import Path+import platform+import re+import shutil+import subprocess+import sys+from unittest.mock import patch++import matplotlib+matplotlib.use('Agg')+import matplotlib.pyplot as plt+import numpy as np+import scipy+from scipy.sparse import csr_matrix++from utils.experiment_artifacts import digests+from utils.experiment_logger import ExperimentLogger+from visual.runtime.geometry import OrganizedGeometry+from visual.runtime.rgbd import BOX, PEG, iter_saved_rgbd+from visual.runtime.test.run_rim_bottleneck import occupancy, require_equal, source_contract, write_json+from visual.runtime.test.run_structural_edges import negative_regions+from visual.runtime.test.sampling_evaluation import CoverageMatcher++REPO = Path(__file__).resolve().parents[3]+SOURCE = REPO/'visual/results/sampling/2551448b0fae4c6bbce3caf48774275f'+DENSE = REPO/'visual/results/runtime_geometry/f9b0da8588734a28996a38f3724da16a'+EDGES = REPO/'visual/results/structural_edges/b622e76deceb419ab9c5aa80a8f8280c/f0000_pairs.npz'+PHASE1 = REPO/'experiments/d3f14ee494894daabb8ba2fab8e1b00c'+PHASE2 = REPO/'experiments/aa5d71078e0841fd886b5026d6030ebc'+PHASE3 = REPO/'experiments/f36f1e9e2bb64866b8d6c792db158635'+TASK03E = REPO/'experiments/7f657cf88baf4f1f89e594252e243e1c'+REPORT = REPO/'docs/visual-graph-integration/03h_candidate_count_matched.md'+PLAN = REPORT.with_name('03h_candidate_count_matched_plan.md')+STEM = 'candidate_count_matched'+K = 297+SEEDS = tuple(range(20261024, 20261040))+STREAMS = {'pca5_matched': 0, 'observed_random': 1}+FIGURES = ('candidate_original.png', 'candidate_matched.png', 'reference_multiplicity.png',+ 'expected_coverage.png', 'roi_depth_spatial.png')+# Explicit existing contracts; omit tests that run a sampler, sweep or GT generation.+EXISTING_TESTS = [+ 'SamplingEvaluationTests.test_joint_tolerance_requires_same_pair',+ 'SamplingEvaluationTests.test_tracking_and_sampling_losses_have_separate_denominators',+ 'SamplingEvaluationTests.test_empty_reference_is_undefined_not_perfect',+ 'StagedCoverageTests.test_reference_overlap_union_and_surface_outside_candidates',+ 'StagedCoverageTests.test_two_different_nodes_cannot_satisfy_one_reference_pair',+ 'StagedCoverageTests.test_empty_points_zero_observation_and_zero_visible',+ 'StagedCoverageTests.test_invalid_nodes_and_non_partition_are_rejected',+ 'StagedCoverageTests.test_negative_union_deduplicates_and_depth_bands_cover_paths',+ 'StagedCoverageTests.test_historical_evaluation_changes_fail_closed',+]+++def sha(path):+ return digests(Path(path))[1]+++def hash_files(paths):+ return {str(p.relative_to(REPO)): sha(p) for p in sorted(set(map(Path, paths)))}+++def array_sha(a):+ a = np.asarray(a)+ return hashlib.sha256(str(a.dtype).encode()+str(a.shape).encode()+a.tobytes()).hexdigest()+++def uniform_rows(n, k, seed, stream):+ """Selection sees ONLY population size, count and RNG identity, never GT/XYZ."""+ n, k, seed, stream = map(index, (n, k, seed, stream))+ if not 0 <= k <= n or min(seed, stream) < 0:+ raise ValueError('invalid uniform subset arguments')+ rng = np.random.Generator(np.random.PCG64(np.random.SeedSequence([seed, stream])))+ return np.sort(rng.choice(n, size=k, replace=False))+++def coverage_probability(n, h, k):+ """Exact hypergeometric coverage formula, evaluated without huge binomials."""+ n, h, k = map(index, (n, h, k))+ if not 0 <= h <= n or not 0 <= k <= n:+ raise ValueError('require 0 <= h,k <= N')+ if h == 0 or k == 0:+ return 0.+ if k > n-h:+ return 1.+ count, excluded = min(k, h), max(k, h)+ logq = math.fsum(math.log1p(-excluded/(n-i)) for i in range(count))+ return -math.expm1(logq)+++def probabilities(n, multiplicity, k):+ return np.array([coverage_probability(n, int(h), k) for h in multiplicity], np.float64)+++def checked_rows(support, selected):+ """Validate exact source membership before searchsorted indexing."""+ support, selected = np.asarray(support), np.asarray(selected)+ if support.ndim != 1 or selected.ndim != 1 or selected.dtype.kind not in 'iu':+ raise ValueError('one-dimensional integer source indices required')+ if len(support) and not np.all(support[:-1] < support[1:]):+ raise ValueError('support must be strictly sorted')+ if len(np.unique(selected)) != len(selected):+ raise ValueError('duplicate source indices')+ rows = np.searchsorted(support, selected)+ if (rows >= len(support)).any() or not np.array_equal(support[rows], selected):+ raise ValueError('source indices outside population')+ return rows+++def describe(adj):+ adj = adj.astype(bool).tocsr(copy=True)+ adj.sum_duplicates(); adj.eliminate_zeros()+ h = adj.getnnz(axis=0)+ degree = adj.getnnz(axis=1)+ covered = h > 0+ n, nref = adj.shape+ return dict(node_count=n, matching_node_count=int((degree > 0).sum()),+ rim_matching_node_fraction=float((degree > 0).mean()) if n else None,+ unique_reference_count=int(covered.sum()), reference_denominator=nref,+ reference_coverage=float(covered.mean()) if nref else None,+ pair_count=int(adj.nnz), reference_multiplicity=h.tolist(),+ node_reference_degree=degree.tolist(), covered_reference_ids=np.flatnonzero(covered).tolist(),+ missing_reference_ids=np.flatnonzero(~covered).tolist(),+ multiplicity_histogram={label: int(mask.sum()) for label, mask in+ [('zero', h == 0), ('one', h == 1), ('two_or_more', h >= 2)]})+++def sets(first, second):+ a, b = set(map(int, first)), set(map(int, second))+ return {k: dict(count=len(v), ids=sorted(v)) for k, v in+ [('intersection', a & b), ('fd2_only', a-b), ('pca5_only', b-a)]}+++def summary(values):+ a = np.asarray(values, float)+ return dict(mean=float(a.mean()), sample_sd=float(a.std(ddof=1)), min=float(a.min()), max=float(a.max()))+++def expectation(adj, k, labels, roi_masks, flat):+ row = describe(adj); n = row['node_count']+ p = probabilities(n, row['reference_multiplicity'], k)+ return dict(population_count=n, subset_count=k, reference_denominator=adj.shape[1],+ expected_unique_reference_count=math.fsum(p), expected_reference_coverage=math.fsum(p)/adj.shape[1],+ reference_coverage_probability=p.tolist(),+ expected_reference_multiplicity=(k*np.asarray(row['reference_multiplicity'])/n).tolist(),+ expected_matching_node_count=k*row['matching_node_count']/n,+ expected_rim_matching_node_fraction=row['rim_matching_node_fraction'],+ segments={str(s): dict(reference_count=int((labels == s).sum()),+ expected_unique_reference_count=math.fsum(p[labels == s]),+ expected_reference_coverage=math.fsum(p[labels == s])/adj.shape[1]) for s in np.unique(labels)},+ roi={name: dict(expected_node_count=k*int(mask.ravel()[flat].sum())/n,+ expected_node_fraction=float(mask.ravel()[flat].mean())) for name, mask in roi_masks.items()})+++def load_geometry():+ comparison = json.loads((SOURCE/'comparison.json').read_text())+ config = comparison['config']+ require_equal(comparison['run_id'], SOURCE.name, 'source UUID')+ require_equal(config['camera'], 'base_camera', 'camera')+ require_equal(Path(config['input']).name, 'ep000.npz', 'episode')+ for field in ('input', 'masks'):+ require_equal(sha(config[field]), config[field+'_sha256'], field+' SHA256')+ prior = json.loads((DENSE/'geometry.json').read_text())['config']+ for field in ('input_sha256', 'masks_sha256', 'camera'):+ require_equal(prior[field], config[field], 'Task01/03 '+field)+ contracts = source_contract(SOURCE, config)+ frame = next(iter_saved_rgbd(config['input'], config['masks'], camera=config['camera']))+ require_equal(frame.source_frame, 0, 'source frame')+ with np.load(DENSE/'f0000.npz', allow_pickle=False) as a:+ require_equal(int(a['source_frame']), 0, 'dense source frame')+ require_equal(str(a['camera']), frame.camera, 'dense camera')+ for key in ('intrinsic', 'cam2world'):+ np.testing.assert_array_equal(a[key], getattr(frame, key))+ geometry = OrganizedGeometry(a['xyz'], a['valid_depth'],+ {oid: a[name+'/object_mask'] for oid, name in [(PEG, 'peg'), (BOX, 'box')]}, a['overlap_mask'])+ for oid in (PEG, BOX):+ np.testing.assert_array_equal(geometry.object_masks[oid], frame.masks[oid])+ np.testing.assert_array_equal(a['box/valid_points'], geometry.observed_mask(BOX))+ np.testing.assert_array_equal(geometry.valid_depth, np.isfinite(frame.depth) & (frame.depth > 0))+ np.testing.assert_array_equal(geometry.overlap_mask, frame.masks[PEG] & frame.masks[BOX])+ np.testing.assert_array_equal(geometry.xyz[..., 2][geometry.valid_depth], frame.depth[geometry.valid_depth])+ populations = {}+ with np.load(TASK03E/'priority_fps_metric_control.npz', allow_pickle=False) as e, np.load(SOURCE/'f0000_samples.npz', allow_pickle=False) as a:+ require_equal(int(a['source_frame']), 0, 'candidate source frame')+ np.testing.assert_array_equal(a['shape'], frame.depth.shape)+ support = np.flatnonzero(geometry.observed_mask(BOX))+ require_equal(len(support), 11665, 'observed count')+ for method, estimator, count in [('S2', 'fd2', 297), ('S3', 'pca5', 599)]:+ prefix = method+'/box/'+ flat = e[prefix+'candidate_flat']+ require_equal(len(flat), count, estimator+' count')+ checked_rows(support, flat)+ np.testing.assert_array_equal(flat, a[f'evidence/{estimator}/1/20/orientation_flat'])+ np.testing.assert_array_equal(e[prefix+'candidate_xyz'], geometry.xyz.reshape(-1, 3)[flat])+ np.testing.assert_array_equal(e[prefix+'support_flat'], support)+ np.testing.assert_array_equal(e[prefix+'support_xyz'], geometry.xyz.reshape(-1, 3)[support])+ populations[estimator] = flat.copy()+ populations['observed'] = support+ return frame, geometry, populations, config, contracts+++def annotate(frame, geometry, populations):+ """Called only after the fixed draws have been persisted."""+ with np.load(SOURCE/'f0000_samples.npz', allow_pickle=False) as a, np.load(TASK03E/'priority_fps_metric_control.npz', allow_pickle=False) as e, np.load(EDGES, allow_pickle=False) as edges:+ ref = tuple(a['evaluation/box/reference_'+s] for s in ('uv', 'xyz'))+ for suffix, value in zip(('uv', 'xyz'), ref):+ np.testing.assert_array_equal(value, e['box/reference_'+suffix])+ np.testing.assert_array_equal(value, edges['evaluation/box/rim_'+suffix])+ require_equal((ref[0].shape, ref[1].shape), ((103, 2), (103, 3)), 'reference shapes')+ labels = e['box/reference_segment'].copy()+ matcher = CoverageMatcher(geometry, BOX, ref, tolerances=((2., .003),))+ np.testing.assert_array_equal(matcher.flat, populations['observed'])+ full = matcher.adjacencies['2px_3mm']+ np.testing.assert_array_equal(full.getnnz(axis=0) > 0, e['box/observable'])+ matrices = {name: full[checked_rows(matcher.flat, flat)] for name, flat in populations.items()}+ for method, estimator in [('S2', 'fd2'), ('S3', 'pca5')]:+ prefix = method+'/box/1.0/C/'+ adj = matrices[estimator]+ saved = csr_matrix((np.ones(len(e[prefix+'joint_node_row']), bool),+ (e[prefix+'joint_node_row'], e[prefix+'joint_reference_id'])), shape=adj.shape)+ require_equal((adj != saved).nnz, 0, estimator+' saved joint pairs')+ np.testing.assert_array_equal(adj.getnnz(axis=0) > 0, e[prefix+'covered'])+ np.testing.assert_array_equal(adj.getnnz(axis=1) > 0, e[prefix+'matched_node'])+ np.testing.assert_array_equal(adj.getnnz(axis=1), e[prefix+'reference_count_per_node'])+ regions = {k.split('/')[-1]: edges[k] for k in edges.files+ if k.startswith('evaluation/box/') and edges[k].shape == frame.depth.shape}+ all_ref = tuple(np.concatenate([ref[i], edges['evaluation/box/seam_'+s]]) for i, s in enumerate(('uv', 'xyz')))+ negatives = negative_regions(regions, {}, all_ref, frame.depth.shape)+ roi_masks = dict(negatives, known_negative_union=np.logical_or.reduce(list(negatives.values())))+ # Fixed GT rim mask crop, before evaluating subset outcomes.+ v, u = np.nonzero(regions['hole_rim'])+ crop = (max(0, int(u.min())-12), min(frame.depth.shape[1]-1, int(u.max())+12),+ min(frame.depth.shape[0]-1, int(v.max())+12), max(0, int(v.min())-12))+ original = {name: describe(adj) for name, adj in matrices.items()}+ for name, count, matching, refs in [('observed', 11665, 153, 103), ('fd2', 297, 101, 57), ('pca5', 599, 127, 91)]:+ row = original[name]+ require_equal((row['node_count'], row['matching_node_count'], row['unique_reference_count']),+ (count, matching, refs), name+' original evidence')+ ids, nodes = matcher.reference_hits(populations[name])+ require_equal((len(ids), len(nodes)), (refs, matching), name+' helper agreement')+ differences = dict(source_indices=sets(populations['fd2'], populations['pca5']),+ references=sets(original['fd2']['covered_reference_ids'], original['pca5']['covered_reference_ids']))+ require_equal([differences['references'][k]['count'] for k in ('intersection', 'fd2_only', 'pca5_only')], [56, 1, 35], 'reference set relation')+ phase = json.loads((PHASE1/'diagnostic.json').read_text())['frames'][0]+ require_equal(phase['source_frame'], 0, 'Phase1 frame')+ for new, old in [('intersection', 'intersection'), ('fd2_only', 'S2_only'), ('pca5_only', 'S3_only')]:+ require_equal(differences['references'][new]['ids'], phase['S2_vs_S3']['C'][old]['reference_ids'], 'Phase1 reference IDs')+ occ = occupancy(frame, dict(X=populations['observed'], fd2=populations['fd2'], pca5=populations['pca5']), negatives)+ prior = json.loads((TASK03E/'priority_fps_metric_control.json').read_text())+ for method, name in [('S2', 'fd2'), ('S3', 'pca5')]:+ old = prior['cases'][method+'/box']+ require_equal(array_sha(populations[name]), old['candidate_sha256'], name+' ordered hash')+ require_equal(array_sha(populations['observed']), old['support_sha256'], name+' support hash')+ old = old['conditions']['1.0']+ require_equal(occ['depth_m'][name], old['occupancy']['depth_m']['C'], name+' saved depth')+ for roi in roi_masks:+ require_equal(occ['negative_roi'][roi][name], old['occupancy']['negative_roi'][roi]['C'], name+' saved ROI '+roi)+ for s in np.unique(labels):+ ids = np.flatnonzero((labels == s) & (np.asarray(original[name]['reference_multiplicity']) > 0)).tolist()+ require_equal(ids, old['stages']['C']['segments'][str(s)]['covered_reference_ids'], name+' saved segment '+str(s))+ return matcher, matrices, original, differences, ref, labels, negatives, roi_masks, crop+++def evaluate_set(flat, matcher, labels, frame, negatives, arrays, prefix):+ rows = checked_rows(matcher.flat, flat)+ adj = matcher.adjacencies['2px_3mm'][rows]+ row = describe(adj)+ occ = occupancy(frame, dict(X=matcher.flat, selected=flat), negatives)+ row['occupancy'] = dict(negative_roi={k: v['selected'] for k, v in occ['negative_roi'].items()},+ depth_m=occ['depth_m']['selected'], depth_quantile_occupancy=occ['depth_quantile_occupancy']['selected'],+ depth_band_bounds_m=occ['depth_band_bounds_m'])+ row['segments'] = {str(s): dict(reference_count=int((labels == s).sum()),+ covered_reference_ids=np.flatnonzero((labels == s) & (np.asarray(row['reference_multiplicity']) > 0)).tolist(),+ missing_reference_ids=np.flatnonzero((labels == s) & (np.asarray(row['reference_multiplicity']) == 0)).tolist(),+ coverage_count=int(((labels == s) & (np.asarray(row['reference_multiplicity']) > 0)).sum()),+ coverage_denominator=103) for s in np.unique(labels)}+ coo = adj.tocoo()+ arrays.update({prefix+'/flat_index': flat, prefix+'/xyz': matcher.xyz[rows], prefix+'/uv': matcher.uv[rows],+ prefix+'/joint_node_row': coo.row, prefix+'/joint_reference_id': coo.col,+ prefix+'/reference_multiplicity': np.asarray(row['reference_multiplicity']),+ prefix+'/matched_node': adj.getnnz(axis=1) > 0,+ prefix+'/covered': adj.getnnz(axis=0) > 0})+ return row+++def repeated_summary(rows):+ out = {key: summary([r[key] for r in rows]) for key in+ ('matching_node_count', 'rim_matching_node_fraction', 'unique_reference_count', 'reference_coverage')}+ out['roi'] = {roi: {key: summary([r['occupancy']['negative_roi'][roi][key] if key == 'count'+ else r['occupancy']['negative_roi'][roi]['fraction_of_path']['value'] for r in rows])+ for key in ('count', 'fraction')} for roi in rows[0]['occupancy']['negative_roi']}+ out['depth_m'] = {key: summary([r['occupancy']['depth_m'][key] for r in rows]) for key in ('min', 'median', 'p95', 'max')}+ out['segments'] = {s: summary([r['segments'][s]['coverage_count'] for r in rows]) for s in rows[0]['segments']}+ out['reference_multiplicity_mean'] = np.mean([r['reference_multiplicity'] for r in rows], axis=0).tolist()+ out['reference_coverage_frequency'] = np.mean([np.asarray(r['reference_multiplicity']) > 0 for r in rows], axis=0).tolist()+ return out+++def save_figure(out, filename, fig):+ fig.savefig(out/filename, dpi=170, bbox_inches='tight'); plt.close(fig)+++def plots(out, frame, matcher, populations, draws, original, expected, labels, negatives, roi_masks, crop, arrays):+ def overlay(ax, flat, title, extent):+ rows = checked_rows(matcher.flat, flat)+ adj = matcher.adjacencies['2px_3mm'][rows]+ hit = adj.getnnz(axis=1) > 0; covered = adj.getnnz(axis=0) > 0+ uv = matcher.uv[rows]; refs = matcher.ref_uv+ ax.imshow(frame.rgb)+ ax.scatter(*refs[~covered].T, s=25, marker='x', color='#ffdb6e', linewidths=.8, label='missing ref', zorder=3)+ ax.scatter(*refs[covered].T, s=22, facecolors='none', edgecolors='#58ef9b', linewidths=.8, label='covered ref', zorder=3)+ ax.scatter(*uv[~hit].T, s=9, color='#ff6347', alpha=.55, linewidths=0, label='candidate', zorder=4)+ ax.scatter(*uv[hit].T, s=9, color='#43b5ff', alpha=.55, linewidths=0, label='rim matching node', zorder=4)+ ax.set(xlim=extent[:2], ylim=extent[2:], title=title, xlabel='source u (px)', ylabel='source v (px)')+ u, v = matcher.uv.T+ full = (max(0, int(u.min())-12), min(511, int(u.max())+12), min(511, int(v.max())+12), max(0, int(v.min())-12))+ fig, axes = plt.subplots(2, 2, figsize=(13, 11))+ for col, name in enumerate(('fd2', 'pca5')):+ r = original[name]+ for row, extent in enumerate((full, crop)):+ overlay(axes[row, col], populations[name], f'{name.upper()} original | {len(populations[name])} nodes | {r["unique_reference_count"]}/103 refs', extent)+ axes[0, 0].legend(fontsize=8); fig.tight_layout(); save_figure(out, FIGURES[0], fig)+ fig, axes = plt.subplots(2, 3, figsize=(17, 10))+ choices = [('FD2 original', populations['fd2']), ('PCA5 matched r=0', draws['pca5_matched'][0]), ('Observed random r=0', draws['observed_random'][0])]+ for col, (title, flat) in enumerate(choices):+ r = describe(matcher.adjacencies['2px_3mm'][checked_rows(matcher.flat, flat)])+ for row, extent in enumerate((full, crop)):+ overlay(axes[row, col], flat, f'{title} | 297 nodes | {r["unique_reference_count"]}/103 refs', extent)+ axes[0, 0].legend(fontsize=8); fig.tight_layout(); save_figure(out, FIGURES[1], fig)+ # Physical order is established by the saved line label and varying XYZ axis.+ order = []+ for label in sorted(np.unique(labels)):+ ids = np.flatnonzero(labels == label)+ axis = int(np.argmax(np.ptp(matcher.ref_xyz[ids], axis=0)))+ order.extend(ids[np.argsort(matcher.ref_xyz[ids, axis], kind='stable')])+ order = np.asarray(order); arrays['reference_plot_order'] = order+ h = np.array([original[n]['reference_multiplicity'] for n in ('fd2', 'pca5')])+ empirical = [describe(matcher.adjacencies['2px_3mm'][checked_rows(matcher.flat, flat)])['reference_multiplicity'] for _, flat in choices[1:]]+ fig, axes = plt.subplots(3, 1, figsize=(16, 9), constrained_layout=True)+ im = axes[0].imshow(np.vstack([h, empirical])[:, order], aspect='auto', interpolation='nearest', cmap='magma', vmin=0)+ axes[0].set_yticks(range(4), ['FD2 original h', 'PCA5 original h', 'PCA5 matched r=0 h', 'Observed r=0 h']); fig.colorbar(im, ax=axes[0], label='actual matching node multiplicity')+ p = np.array([expected[n]['reference_coverage_probability'] for n in ('pca5_matched', 'observed_random')])+ im = axes[1].imshow(p[:, order], aspect='auto', interpolation='nearest', cmap='viridis', vmin=0, vmax=1)+ axes[1].set_yticks(range(2), ['PCA5 k=297 exact P(covered)', 'Observed k=297 exact P(covered)']); fig.colorbar(im, ax=axes[1], label='coverage probability')+ for name in ('fd2', 'pca5'):+ axes[2].plot(np.arange(103), np.asarray(original[name]['reference_multiplicity'])[order], label=name)+ for ax in axes:+ offset = 0+ for label in sorted(np.unique(labels)):+ count = int((labels == label).sum())+ ax.axvline(offset-.5, color='gray', alpha=.5)+ offset += count+ ax.set_xlabel('references grouped by saved rim line, sorted along verified varying XYZ axis')+ axes[2].legend(); axes[0].set_title('Zero = missing; candidate nodes and reference counts are different quantities')+ save_figure(out, FIGURES[2], fig)+ fig, axes = plt.subplots(1, 2, figsize=(13, 5), constrained_layout=True)+ for name in ('fd2', 'pca5', 'observed'):+ x, y = arrays[name+'/curve_k'], arrays[name+'/curve_expected_unique']+ axes[0].plot(x, y, label=name); axes[1].plot(x[1:], np.diff(y), label=name)+ axes[0].axhline(57, color='gray', ls=':', label='FD2 original 57/103')+ for ax in axes:+ ax.axvline(K, color='black', ls='--', alpha=.5); ax.legend(); ax.set_xlabel('uniform subset count k (analytic, no sampling sweep)')+ axes[0].set(ylabel='expected unique references (denominator 103)', ylim=(0, 103))+ axes[1].set(ylabel='expected additional references per additional node')+ save_figure(out, FIGURES[3], fig)+ names = ['fd2', 'pca5', 'pca5_matched', 'observed_random']+ flats = [populations['fd2'], populations['pca5'], draws['pca5_matched'][0], draws['observed_random'][0]]+ fig, axes = plt.subplots(2, 3, figsize=(18, 10), constrained_layout=True)+ union = roi_masks['known_negative_union']+ axes[0, 0].imshow(frame.rgb); axes[0, 0].imshow(np.ma.masked_where(~union, union), cmap='Reds', alpha=.4, vmin=0, vmax=1)+ axes[0, 0].set(xlim=full[:2], ylim=full[2:], title='Existing negative ROI union (not an error label)')+ roi_names = list(roi_masks); positions = np.arange(len(roi_names))+ for i, (name, flat) in enumerate(zip(names, flats)):+ axes[0, 1].bar(positions+(i-1.5)*.19, [roi_masks[r].ravel()[flat].mean() for r in roi_names], width=.19, label=name)+ z = frame.depth.ravel()[flat]+ axes[0, 2].step(np.sort(z), np.arange(1, len(z)+1)/len(z), where='post', label=name)+ xyz = matcher.xyz[checked_rows(matcher.flat, flat)]+ axes[1, 1].scatter(xyz[:, 0], xyz[:, 1], s=8, alpha=.4, label=name)+ axes[1, 2].scatter(xyz[:, 0], xyz[:, 2], s=8, alpha=.4, label=name)+ axes[0, 1].set_xticks(positions, roi_names, rotation=65, ha='right', fontsize=8)+ axes[0, 1].set_ylabel('fraction of nodes; r=0 for random conditions')+ axes[0, 2].set(xlabel='positive camera depth (m)', ylabel='ECDF', title='Far positive depth is not a contamination truth')+ median, p95 = np.percentile(frame.depth.ravel()[matcher.flat], [50, 95])+ for j, (name, flat) in enumerate(zip(names, flats)):+ z = frame.depth.ravel()[flat]; counts = [np.mean(z <= median), np.mean((z > median) & (z <= p95)), np.mean(z > p95)]+ axes[1, 0].bar(np.arange(3)+(j-1.5)*.19, counts, width=.19, label=name)+ axes[1, 0].set_xticks(range(3), ['z <= X median', 'X median < z <= X p95', 'z > X p95'], rotation=15)+ axes[1, 0].set_ylabel('fraction of nodes; fixed observed-depth bands')+ axes[1, 1].set(xlabel='camera X (m)', ylabel='camera Y (m)', title='XY distribution')+ axes[1, 2].set(xlabel='camera X (m)', ylabel='camera Z (m)', title='XZ distribution')+ for ax in axes.flat:+ if ax.get_legend_handles_labels()[0]: ax.legend(fontsize=7)+ save_figure(out, FIGURES[4], fig)+++def table(result):+ lines = ['| 조건 | 후보 node 수 | rim matching node | rim matching fraction | unique rim reference /103 |',+ '| --- | ---: | ---: | ---: | ---: |']+ for name in ('fd2', 'pca5'):+ r = result['original'][name]+ lines.append(f'| {name} original | {r["node_count"]} | {r["matching_node_count"]} | {r["rim_matching_node_fraction"]:.2%} | {r["unique_reference_count"]}/103 |')+ for name in STREAMS:+ r = result['expected'][name]+ lines.append(f'| {name} exact expectation | 297 | {r["expected_matching_node_count"]:.4f} | {r["expected_rim_matching_node_fraction"]:.2%} | {r["expected_unique_reference_count"]:.6f}/103 |')+ return lines+++def write_reports(out, result):+ p = result['expected']['pca5_matched']; o = result['expected']['observed_random']+ delta = p['expected_unique_reference_count']-57+ conclusion = ('동일 후보 수에서도 PCA5의 기대 rim coverage가 FD2보다 높다. 후보 수 증가만으로 원래 coverage 차이를 설명할 수 없다.' if delta > 0 else+ '동일 후보 수에서 PCA5의 기대 rim coverage 우위가 사라진다. 원래 높은 coverage는 후보 수에 상당히 의존한다.')+ result['conclusion'] = conclusion+ def link(name): return os.path.relpath(out/name, REPORT.parent)+ lines = ['# Task03-H — Candidate Count-Matched Structural Evidence Analysis', '',+ f'실행 UUID: `{out.name}`. {conclusion}', '',+ f'Primary: PCA5 297개 정확한 expected unique reference는 **{p["expected_unique_reference_count"]:.6f}/103 ({p["expected_reference_coverage"]:.2%})**, FD2 original은 **57/103**이며 차이는 **{delta:+.6f} reference**다.', '',+ *table(result), '',+ '정확한 기대값 행의 matching node/reference 수는 비정수 기대값이다. 실제 subset의 정수 count 및 16회 표본 평균과 구분한다. Rim matching fraction은 이 특정 rim에 대한 후보 집중도이며 일반적인 detector precision이 아니다.', '',+ '## 고정 조건과 선택 독립성', '',+ 'ep000 Frame 0 Box, base_camera, 동일 관측 11,665개, 저장 FD2/PCA5 orientation-only 20° 후보 297/599개, 같은 103개 reference, 동일 pair의 ≤2px AND ≤3mm다. 원본 source index·XYZ·reference를 그대로 사용했으며 normal/candidate/backprojection/FPS를 재실행하지 않았다.', '',+ 'GT·ROI·score·XYZ를 받지 않는 uniform_rows(N,k,seed,stream)으로 비복원 선택했다. PCG64 + SeedSequence([seed,stream]), seed 20261024–20261039, PCA5 stream=0/observed stream=1, 조건별 16회, 대표 overlay는 사전 고정 r=0이다. 선택 배열은 GT matching annotation 전에 저장했다. 전체 관측 control은 candidate/normal-valid filtering을 하지 않았다.', '',+ '## 후보 수 효과와 공간 분포', '',+ f'PCA5 original 91개와 FD2 original 57개의 차이는 34 reference다. 같은 PCA5 모집단을 297개로 줄일 때 기대 coverage 감소는 **{91-p["expected_unique_reference_count"]:.6f} reference**이고, 줄인 뒤 FD2와의 차이는 **{delta:+.6f} reference**다. 이는 고정 모집단에서의 기술적 비교이며 독립적인 인과 기여율이나 estimator ���과의 비율 분해가 아니다.', '',+ f'Observed random 297개의 기대값은 **{o["expected_unique_reference_count"]:.6f}/103**, 기대 matching node는 **{o["expected_matching_node_count"]:.4f}/297**다. 두 estimator의 rim 집중도와 임의 관측점 선택의 차이를 보는 대조군이다.', '',+ 'Expected unique coverage는 reference별 multiplicity h에 대한 1−C(N−h,k)/C(N,k)를 합산했다. 짧은 유한곱의 log1p, math.fsum 및 −expm1을 사용했다. Reference 간 독립성을 가정하지 않는다. 정확한 분산은 계산하지 않았고, 아래 변동은 고정 후보 집합의 부분추출 변동이다. Curve는 고정 후보의 analytic rarefaction으로 추가 실험/threshold sweep이 아니다.', '',+ '| 조건 | 16회 실제 unique refs mean | sample SD | min–max | matching nodes mean |',+ '| --- | ---: | ---: | ---: | ---: |']+ for name, r in result['repeated_summary'].items():+ u = r['unique_reference_count']+ lines.append(f'| {name} | {u["mean"]:.4f} | {u["sample_sd"]:.4f} | {u["min"]:.0f}–{u["max"]:.0f} | {r["matching_node_count"]["mean"]:.4f} |')+ lines += ['', '## 중복·누락과 reference 집합', '',+ '| 모집단 | h=0 refs | h=1 refs | h≥2 refs | joint pairs | matching nodes |',+ '| --- | ---: | ---: | ---: | ---: | ---: |']+ for name in ('fd2', 'pca5', 'observed'):+ r = result['original'][name]; h = r['multiplicity_histogram']+ lines.append(f'| {name} | {h["zero"]} | {h["one"]} | {h["two_or_more"]} | {r["pair_count"]} | {r["matching_node_count"]} |')+ lines += ['', '한 node가 여러 reference를 덮을 수 있고 여러 node가 같은 reference에 집중될 수 있다. Pair 수를 node 수나 unique reference 수로 읽지 않는다. h가 높은 reference는 작은 k에서 포화되고, h=0인 위치는 원래 후보 전체를 사용해도 누락된다.', '',+ f'Original reference 교집합 56개, FD2-only 1개, PCA5-only 35개를 ID까지 재확인했다. Candidate source index 집합 관계는 {result["set_comparison"]["source_indices"] ["intersection"]["count"]}개 공통, FD2-only {result["set_comparison"]["source_indices"]["fd2_only"]["count"]}개, PCA5-only {result["set_comparison"]["source_indices"]["pca5_only"]["count"]}개다. 두 종류의 집합 관계는 서로 다르다.', '',+ '| 기존 rim 구간 | 구간 reference 수 | FD2 original covered | PCA5 original covered | PCA5 297 expected covered | Observed 297 expected covered |',+ '| --- | ---: | ---: | ---: | ---: | ---: |']+ for s in sorted(result['original']['fd2']['segments']):+ a, b = (result['original'][n]['segments'][s] for n in ('fd2', 'pca5'))+ lines.append(f'| {s} | {a["reference_count"]} | {a["coverage_count"]}/103 | {b["coverage_count"]}/103 | {p["segments"][s]["expected_unique_reference_count"]:.4f}/103 | {o["segments"][s]["expected_unique_reference_count"]:.4f}/103 |')+ lines += ['', '구간 크기는 별도 count이며 모든 coverage 비율의 분모는 103이다. 원래 56/1/35 reference 그룹별 기대 보존과 16회 실제 보존, reference 103행별 multiplicity/확률/누락 ID는 JSON/NPZ에 보존했다.', '',+ '## 기존 ROI와 depth', '',+ '| 조건 | negative union nodes / 전체 | depth median m | depth p95 m | max m |',+ '| --- | ---: | ---: | ---: | ---: |']+ for name in ('fd2', 'pca5'):+ r = result['original'][name]['occupancy']; z = r['depth_m']+ lines.append(f'| {name} original | {r["negative_roi"]["known_negative_union"]["count"]}/{result["original"][name]["node_count"]} | {z["median"]:.4f} | {z["p95"]:.4f} | {z["max"]:.4f} |')+ for name in STREAMS:+ r = result['repeated_summary'][name]; z = r['depth_m']+ lines.append(f'| {name} 16回 mean | {r["roi"]["known_negative_union"]["count"]["mean"]:.4f}/297 | {z["median"]["mean"]:.4f} | {z["p95"]["mean"]:.4f} | {z["max"]["mean"]:.4f} |')+ lines += ['', '個別 ROI는 중첩되므로 합계와 union을 구분한다. ROI 점유는 오검출 정답이 아니며, 원거리 positive depth 자체도 오염 정답이 아니다. X의 median/p95로 고정한 depth bands, 개별 ROI count/fraction과 camera XY/XZ/source UV 분포를 별도 저장·시각화했다.', '',+ '## 확인된 사실과 미확인 범위', '', conclusion,+ '이 결과는 고정 Frame 0 Box에서 후보 수를 통제한 rim coverage와 후보 위치·중복 분포의 근거다. PCA5의 모든 구조/형상에 대한 우월성, 모든 edge의 precision, 추가 후보가 noise인지 여부, 독립 episode 일반화, Graph/GNN/BC 효용은 검증하지 않았다. 후속 sampling 정책이나 Voxel 설계는 채택하지 않는다.', '',+ '## 검증·재현성·산출물', '',+ '작은 N 전수열거·exact rational 대조, same-pair tolerance·중복/집합·GT 독립성 계약 테스트를 통과했다. 입력 support/camera/XYZ와 저장 pair, 원래 103/57/91 coverage 및 56/1/35 집합을 재확인했다. 기존 source/input/artifact/sidecar와 초기 dirty 파일의 SHA-256 불변을 확인했다. 상세 PASS와 테스트 목록은 verification.json/tests.log를 따른다.', '',+ 'ExperimentLogger(team=visual, job_type=evaluate), WANDB_MODE=disabled와 기존 로컬 artifact 등록을 재사용했다. UUID/project/group 규칙은 유지했다. Git dirty 상태는 source snapshot/input hashes/implementation diff와 함께 보존했다. CPU NumPy/SciPy offline 분석이며 simulator·renderer·CUDA/MPS/GPU, 외부 업로드·dependency 설치·Git commit은 실행하지 않았다.', '',+ f'[승인된 계획](03h_candidate_count_matched_plan.md) · [정적 HTML]({link(STEM+".html")}) · [결과 JSON]({link(STEM+".json")}) · [결과 NPZ]({link(STEM+".npz")}) · [검증]({link("verification.json")}) · [테스트]({link("tests.log")}) · [hash]({link("source_hashes.json")}) · [implementation diff]({link("implementation.patch")})', '']+ for filename in FIGURES: lines.append(f'})\n')+ lines.append('구현·진단·검증·보고를 완료했으며 추가 알고리즘 변경 없이 중단한다.\n')+ REPORT.write_text('\n'.join(lines).replace('個別', '개별'), encoding='utf-8')+ table_html = '<table><tr><th>Condition</th><th>Nodes</th><th>Rim matching nodes</th><th>Rim fraction</th><th>Unique refs /103</th></tr>'+ for line in table(result)[2:]:+ table_html += '<tr>'+''.join('<td>'+html.escape(v.strip())+'</td>' for v in line.strip('|').split('|'))+'</tr>'+ table_html += '</table>'+ groups = result['reference_groups']+ group_html = '<table><tr><th>Original reference group</th><th>Refs</th><th>PCA5 k=297 expected retained</th></tr>'+ for name, group in groups.items(): group_html += f'<tr><td>{name}</td><td>{group["count"]}</td><td>{group["pca5_expected_retained"]:.6f}</td></tr>'+ group_html += '</table>'+ links = [(STEM+'.json', 'Result JSON'), (STEM+'.npz', 'Source/subsets/pairs NPZ'), ('verification.json', 'Verification'),+ ('tests.log', 'Tests'), ('source_hashes.json', 'Source/input hashes'), ('implementation.patch', 'Implementation diff'),+ (os.path.relpath(REPORT, out), 'Korean Markdown report')]+ page = '<!doctype html><html lang="ko"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Task03-H candidate count matching</title><style>body{font:16px/1.6 system-ui;max-width:1500px;margin:32px auto;padding:0 24px;color:#172235;background:#f8fafc}h1,h2{line-height:1.3}table{border-collapse:collapse;width:100%;background:white}td,th{padding:10px;border:1px solid #cbd5e1;text-align:left}img{max-width:100%;height:auto;background:white}a{color:#0759b0}section{margin:32px 0}.note{padding:16px;background:#e5eefb}code{overflow-wrap:anywhere}</style><body>'+ page += f'<h1>Task03-H — Candidate count-matched analysis</h1><p>Run <code>{out.name}</code> · ep000 / Frame 0 / Box · orientation-only 20° · same-pair ≤2px AND ≤3mm</p><p class="note">{html.escape(conclusion)}<br>Primary exact expectation: {p["expected_unique_reference_count"]:.6f}/103 vs FD2 57/103 (Δ {delta:+.6f} references).</p>'+table_html+ page += '<p>Expectation rows are analytic, not sampled means. Rim matching fraction describes concentration near this specific rim; it is not general edge precision. GT/ROI are evaluation annotations only.</p><h2>Original coverage groups</h2>'+group_html+ page += '<p>PCG64, SeedSequence([20261024+r,stream]), r=0…15; streams PCA5=0, observed=1. All overlays use preselected r=0. Sixteen-repeat SD/range describes subset variability, not generalization uncertainty.</p>'+ page += '<table><tr><th>16 fixed repeats</th><th>Actual unique refs mean</th><th>Sample SD</th><th>Min–max</th><th>Matching nodes mean</th><th>ROI union nodes mean</th></tr>'+ for name, r in result['repeated_summary'].items():+ u = r['unique_reference_count']+ page += f'<tr><td>{name}</td><td>{u["mean"]:.4f}/103</td><td>{u["sample_sd"]:.4f}</td><td>{u["min"]:.0f}–{u["max"]:.0f}</td><td>{r["matching_node_count"]["mean"]:.4f}/297</td><td>{r["roi"]["known_negative_union"]["count"]["mean"]:.4f}/297</td></tr>'+ page += '</table>'+ for filename, title in zip(FIGURES, ['Original candidate locations: full Box and common rim crop', 'Equal 297 nodes: FD2 / PCA5 matched / observed random', 'Reference multiplicity, missing positions and coverage probability', 'Exact expected coverage saturation; no threshold sweep', 'Existing ROI union, individual ROI occupancy, depth and spatial distribution']):+ page += f'<section><h2>{title}</h2><a href="{filename}"><img src="{filename}" alt="{title}"></a></section>'+ page += '<p>Overlapping ROI occupancy is not a false-edge label. Far positive depth is not contamination truth. Node counts, matching nodes, pair counts and unique references are distinct. All reference coverage ratios use the same 103 references. Single-frame Box evidence does not establish all-shape detector superiority or Graph/GNN/BC utility.</p><h2>Artifacts and reproducibility</h2><ul>'+ page += ''.join(f'<li><a href="{html.escape(path)}">{title}</a></li>' for path, title in links)+'</ul><pre id="browser-check">image load pending</pre>'+ page += '<script>window.addEventListener("load",()=>{document.getElementById("browser-check").textContent=JSON.stringify(Array.from(document.images).map(i=>({src:i.getAttribute("src"),complete:i.complete,width:i.naturalWidth,height:i.naturalHeight})))})</script></body></html>'+ (out/(STEM+'.html')).write_text(page, encoding='utf-8')+++class Links(HTMLParser):+ def __init__(self): super().__init__(); self.targets = []+ def handle_starttag(self, tag, attrs):+ self.targets += [v for k, v in attrs if k in ('href', 'src')]+++def verify_links(out):+ parser = Links(); parser.feed((out/(STEM+'.html')).read_text())+ for path in parser.targets:+ if '://' in path or Path(path).is_absolute(): raise ValueError('non-relative HTML link')+ if not (out/path).is_file(): raise ValueError('missing HTML target: '+path)+ targets = re.findall(r'\]\(([^)]+)\)', REPORT.read_text())+ for path in targets:+ if not (REPORT.parent/path).is_file(): raise ValueError('missing Markdown target: '+path)+ for name in FIGURES:+ a = plt.imread(out/name)+ if min(a.shape[:2]) == 0 or not np.isfinite(a).all(): raise ValueError('invalid PNG '+name)+ return dict(html_relative_targets=len(parser.targets), markdown_relative_targets=len(targets), png_decodes=len(FIGURES))+++def verify_browser(out):+ chrome = Path('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')+ if not chrome.is_file(): return dict(status='not executed', reason='Chrome unavailable')+ command = [str(chrome), '--headless', '--disable-gpu', '--no-sandbox', '--allow-file-access-from-files',+ '--user-data-dir='+str(out/'chrome_profile'), '--dump-dom', (out/(STEM+'.html')).as_uri()]+ process = subprocess.run(command, capture_output=True, text=True, timeout=45)+ require_equal(process.returncode, 0, 'headless browser return code')+ match = re.search(r'<pre id="browser-check">(.*?)</pre>', process.stdout, re.S)+ if match is None: raise ValueError('browser image check absent')+ rows = json.loads(html.unescape(match.group(1)))+ require_equal(len(rows), len(FIGURES), 'browser image count')+ if not all(r['complete'] and r['width'] > 0 and r['height'] > 0 for r in rows): raise ValueError('browser image load failed')+ shutil.rmtree(out/'chrome_profile')+ return dict(status='PASS', images=rows)+++def preserved(hashes):+ require_equal(hash_files([REPO/p for p in hashes]), hashes, 'protected files SHA256')+ return dict(status='PASS', protected_file_count=len(hashes), all_sha256_unchanged=True)+++def diagnose(baseline_path):+ if os.environ.get('WANDB_MODE') != 'disabled': raise ValueError('WANDB_MODE=disabled required')+ if REPORT.exists(): raise FileExistsError('refuse to overwrite result Markdown')+ baseline = json.loads(Path(baseline_path).read_text())+ preserved(baseline['hashes'])+ c = json.loads((SOURCE/'comparison.json').read_text())['config']+ protected = [Path(c[k]) for k in ('input', 'masks')]+ for root in (SOURCE, DENSE, PHASE1, PHASE2, PHASE3, TASK03E, EDGES.parent):+ # Only designated evidence directories, not a repository search.+ protected += [p for p in root.rglob('*') if p.is_file()]+ source_paths = [Path(module.__file__).resolve() for module in list(sys.modules.values())+ if getattr(module, '__file__', None) and str(module.__file__).endswith('.py')+ and Path(module.__file__).resolve().is_relative_to(REPO)+ and not Path(module.__file__).resolve().is_relative_to(REPO/'.venv')]+ source_paths += [REPO/'visual/runtime/test/test_candidate_count_matched.py',+ REPO/'visual/runtime/test/test_sampling_evaluation.py', PLAN]+ input_hashes = hash_files(protected)+ source_hashes = hash_files(source_paths)+ protected_hashes = {**input_hashes, **source_hashes, **baseline['hashes']}+ config = dict(task='03-H', source_run_id=SOURCE.name, source_geometry_run_id=TASK03E.name,+ frame=0, episode='ep000', camera='base_camera', object='box', orientation_only=True, threshold_deg=20,+ observed_count=11665, candidate_counts=dict(fd2=297, pca5=599), reference_count=103,+ tolerances_px_m=[[2., .003]], k=K, seeds=list(SEEDS), streams=STREAMS, repeats=16,+ rng='PCG64(SeedSequence([seed,stream])); sorted choice(N,k,replace=False)',+ gt_selection_input=False, representative_repeat=0, analytic_curves=True,+ input_sha256=input_hashes, source_sha256=source_hashes,+ python=platform.python_version(), numpy=np.__version__, scipy=scipy.__version__,+ device='cpu', simulator_executed=False, gpu_executed=False)+ with ExperimentLogger(team='visual', config=config, seed=SEEDS[0], model='task03h_candidate_count_matched', job_type='evaluate') as logger:+ out = logger.directory+ try:+ write_json(out/'git_start.json', baseline)+ preflight_note = Path(baseline_path).with_name('task03h_preflight_failure.json')+ if preflight_note.is_file(): shutil.copyfile(preflight_note, out/preflight_note.name)+ (out/'git_start.diff').write_text(baseline['git_diff'])+ for p in source_paths:+ dest = out/'source_snapshot'/p.relative_to(REPO); dest.parent.mkdir(parents=True, exist_ok=True); shutil.copyfile(p, dest)+ additions = [REPO/'visual/runtime/test/run_candidate_count_matched.py', REPO/'visual/runtime/test/test_candidate_count_matched.py']+ diff = subprocess.check_output(['git', 'diff', '--binary'], cwd=REPO, text=True)+ for p in additions:+ proc = subprocess.run(['git', 'diff', '--no-index', '--', '/dev/null', str(p.relative_to(REPO))], cwd=REPO, capture_output=True, text=True)+ if proc.returncode not in (0, 1): raise RuntimeError('implementation diff failed')+ diff += proc.stdout+ (out/'implementation.patch').write_text(diff)+ tests = ['visual.runtime.test.test_candidate_count_matched'] + ['visual.runtime.test.test_sampling_evaluation.'+t for t in EXISTING_TESTS]+ with (out/'tests.log').open('w') as log:+ proc = subprocess.run([sys.executable, '-m', 'unittest', *tests, '-v'], cwd=REPO, stdout=log, stderr=subprocess.STDOUT)+ require_equal(proc.returncode, 0, 'required contract tests')+ # Guard actual data path: any accidental regeneration or FPS aborts.+ with ExitStack() as stack:+ for module in list(sys.modules.values()):+ if getattr(module, '__name__', '').startswith('visual.'):+ for name in ('fps_indices', 'sample_points', 'extract_sampling_evidence', 'build_organized_geometry', 'rim_reference'):+ if callable(getattr(module, name, None)):+ stack.enter_context(patch.object(module, name, side_effect=AssertionError('forbidden actual-data call: '+name)))+ frame, geometry, populations, old_config, contracts = load_geometry()+ arrays = {}+ draws, draw_records = {}, {}+ for condition, population in [('pca5_matched', populations['pca5']), ('observed_random', populations['observed'])]:+ draws[condition] = []; draw_records[condition] = []+ for repeat, seed in enumerate(SEEDS):+ rows = uniform_rows(len(population), K, seed, STREAMS[condition]); flat = population[rows]+ require_equal((len(flat), len(np.unique(flat))), (K, K), 'unique subset count')+ checked_rows(population, flat)+ draws[condition].append(flat)+ arrays[f'{condition}/r{repeat:02d}/draw_rows'] = rows+ arrays[f'{condition}/r{repeat:02d}/flat_index'] = flat+ draw_records[condition].append(dict(repeat=repeat, seed=seed, stream=STREAMS[condition], source_sha256=array_sha(flat),+ population_sha256=array_sha(population), selected_source_indices=flat.tolist()))+ # Persist draws before matcher, reference/ROI access or outcome evaluation.+ np.savez_compressed(out/'selection_before_annotation.npz', **arrays)+ write_json(out/'selection_before_annotation.json', draw_records)+ matcher, matrices, original, differences, ref, labels, negatives, roi_masks, crop = annotate(frame, geometry, populations)+ result = dict(run_id=logger.run_id, source_run_id=SOURCE.name, config=config, source_contract=contracts,+ set_comparison=differences, original={}, expected={}, repeats={}, repeated_summary={},+ representative_repeat=0, fixed_crop=list(crop), reference_denominator=103)+ arrays.update(reference_uv=ref[0], reference_xyz=ref[1], reference_segment=labels)+ for name, flat in populations.items():+ result['original'][name] = evaluate_set(flat, matcher, labels, frame, negatives, arrays, name+'/original')+ max_k = len(flat) if name != 'observed' else K+ curve = np.array([math.fsum(probabilities(len(flat), original[name]['reference_multiplicity'], k)) for k in range(max_k+1)])+ if (np.diff(curve) < -1e-12).any(): raise ValueError('nonmonotone expectation')+ arrays[name+'/curve_k'] = np.arange(max_k+1); arrays[name+'/curve_expected_unique'] = curve+ arrays[name+'/curve_marginal_gain'] = np.diff(curve)+ require_equal(float(arrays['fd2/curve_expected_unique'][-1]), 57., 'FD2 full expectation')+ require_equal(float(arrays['pca5/curve_expected_unique'][-1]), 91., 'PCA5 full expectation')+ for condition, population_name in [('pca5_matched', 'pca5'), ('observed_random', 'observed')]:+ exp = expectation(matrices[population_name], K, labels, roi_masks, populations[population_name])+ result['expected'][condition] = exp+ arrays[condition+'/expected_reference_coverage_probability'] = np.asarray(exp['reference_coverage_probability'])+ arrays[condition+'/expected_reference_multiplicity'] = np.asarray(exp['expected_reference_multiplicity'])+ rows = []+ for repeat, flat in enumerate(draws[condition]):+ r = evaluate_set(flat, matcher, labels, frame, negatives, arrays, f'{condition}/r{repeat:02d}')+ if not set(r['covered_reference_ids']) <= set(original[population_name]['covered_reference_ids']): raise ValueError('subset covers outside population')+ np.testing.assert_array_equal(arrays[f'{condition}/r{repeat:02d}/xyz'], geometry.xyz.reshape(-1, 3)[flat])+ r.update(draw_records[condition][repeat]); rows.append(r)+ result['repeats'][condition] = rows; result['repeated_summary'][condition] = repeated_summary(rows)+ p = result['expected']['pca5_matched']['expected_unique_reference_count']; o = result['expected']['observed_random']['expected_unique_reference_count']+ result['comparisons'] = dict(original_pca5_minus_fd2=34, pca5_original_minus_matched_expected=91-p,+ pca5_matched_expected_minus_fd2=p-57, fd2_minus_observed_expected=57-o, pca5_matched_minus_observed_expected=p-o,+ pca5_original_minus_observed_expected=91-o)+ result['reference_groups'] = {}+ for group, entry in differences['references'].items():+ ids = entry['ids']+ result['reference_groups'][group] = dict(count=len(ids), ids=ids,+ pca5_expected_retained=math.fsum(np.asarray(result['expected']['pca5_matched']['reference_coverage_probability'])[ids]),+ observed_expected_retained=math.fsum(np.asarray(result['expected']['observed_random']['reference_coverage_probability'])[ids]),+ retained_per_repeat={condition: [len(set(ids) & set(r['covered_reference_ids'])) for r in result['repeats'][condition]] for condition in STREAMS})+ plots(out, frame, matcher, populations, draws, result['original'], result['expected'], labels, negatives, roi_masks, crop, arrays)+ np.savez_compressed(out/(STEM+'.npz'), **arrays)+ with np.load(out/(STEM+'.npz'), allow_pickle=False) as saved:+ require_equal(set(saved.files), set(arrays), 'NPZ keys')+ for key, value in arrays.items():+ np.testing.assert_array_equal(saved[key], value, err_msg=key)+ require_equal(saved[key].dtype, value.dtype, 'NPZ dtype '+key)+ result['tests_summary'] = next(line for line in (out/'tests.log').read_text().splitlines() if line.startswith('Ran '))+'; OK'+ verification = dict(status='PASS', original_evidence_exact=True, same_pair_joint_tolerance=True,+ draw_count=32, all_draws_unique_k297_and_original_membership=True, selections_saved_before_gt_annotation=True,+ gt_blind_selector_signature=['n', 'k', 'seed', 'stream'], original_reference_relation=[56, 1, 35],+ exact_formula_exhaustive_synthetic_tests=True, npz_readback_exact=True,+ forbidden_actual_data_calls_guarded=True, preservation=preserved(protected_hashes), tests=result['tests_summary'],+ simulator_executed=False, renderer_executed=False, gpu_executed=False)+ write_json(out/'verification.json', verification)+ write_json(out/'source_hashes.json', dict(inputs_before=input_hashes, sources_before=source_hashes,+ protected_before=protected_hashes, protected_after=hash_files([REPO/p for p in protected_hashes])))+ write_reports(out, result)+ write_json(out/(STEM+'.json'), result)+ verification['links'] = verify_links(out)+ verification['browser'] = verify_browser(out)+ verification['preservation'] = preserved(protected_hashes)+ write_json(out/'verification.json', verification)+ write_json(out/'git_end.json', dict(status=subprocess.check_output(['git', 'status', '--short'], cwd=REPO, text=True),+ initial_dirty_files_preserved=preserved(baseline['hashes'])))+ logger.record(source_run_id=SOURCE.name, source_geometry_run_id=TASK03E.name,+ simulator_executed=False, gpu_executed=False, preserved=True)+ logger.log(dict(pca5_matched_expected=p, fd2_original=57, observed_random_expected=o, primary_delta=p-57))+ for path in sorted(out.iterdir()):+ if path.is_file() and path.name not in ('config.yaml', 'metadata.json', 'metrics.json', 'manifest.json'):+ logger.link_output(path, kind='trajectory' if path.suffix == '.npz' else 'reports')+ # The new Markdown is the only registered output outside this UUID.+ logger.link_output(REPORT, kind='reports')+ print(json.dumps(dict(run_id=logger.run_id, expected_pca5=p, expected_observed=o, primary_delta=p-57,+ tests=result['tests_summary'], verification='PASS', directory=str(out)), indent=2))+ except Exception as exc:+ write_json(out/'verification.json', dict(status='FAIL', exception_type=type(exc).__name__, reason=str(exc),+ stopped_without_source_or_tolerance_adjustment=True))+ logger.link_output(out/'verification.json', kind='reports')+ raise+ return out+++def main():+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('--baseline', type=Path, required=True)+ args = parser.parse_args()+ diagnose(args.baseline)+++if __name__ == '__main__': main()diff --git a/visual/runtime/test/test_candidate_count_matched.py b/visual/runtime/test/test_candidate_count_matched.pynew file mode 100644index 0000000..e84eb48--- /dev/null+++ b/visual/runtime/test/test_candidate_count_matched.py@@ -0,0 +1,174 @@+"""Task03-H synthetic contracts; no actual episode, FPS or detector execution."""+import ast+from fractions import Fraction+import inspect+import itertools+import math+from pathlib import Path+import tempfile+import unittest++import numpy as np+from scipy.sparse import csr_matrix++from visual.runtime.geometry import OrganizedGeometry+from visual.runtime.rgbd import BOX+from visual.runtime.test.sampling_evaluation import CoverageMatcher+from visual.runtime.test.run_candidate_count_matched import (+ SEEDS, STREAMS, array_sha, checked_rows, coverage_probability, describe,+ hash_files, preserved, probabilities, summary, uniform_rows,+)+++class ExpectedCoverageTests(unittest.TestCase):+ def test_all_small_scalar_hypergeom_cases_against_rational(self):+ for n in range(9):+ for h in range(n+1):+ for k in range(n+1):+ exact = Fraction(1)-Fraction(math.comb(n-h, k) if k <= n-h else 0, math.comb(n, k))+ self.assertAlmostEqual(coverage_probability(n, h, k), float(exact), places=14)++ def test_expected_unique_exhaustive_shared_nodes_and_duplicate_references(self):+ a = np.array([[1, 1, 0, 0], [1, 0, 1, 0], [0, 0, 1, 0],+ [0, 1, 0, 0], [0, 0, 0, 0], [1, 1, 1, 0]], bool)+ h = a.sum(axis=0)+ for k in range(len(a)+1):+ totals = [int(a[list(rows)].any(axis=0).sum()) for rows in itertools.combinations(range(len(a)), k)]+ expected = Fraction(sum(totals), len(totals))+ p = probabilities(len(a), h, k)+ self.assertAlmostEqual(math.fsum(p), float(expected), places=14)+ self.assertEqual(math.fsum(probabilities(len(a), h, len(a))), 3.)++ def test_stable_tiny_coverage_probability(self):+ # Subtracting exp(logq) from 1 loses this probability entirely.+ self.assertAlmostEqual(coverage_probability(10**18, 1, 1)/1e-18, 1., places=14)+ self.assertEqual(coverage_probability(0, 0, 0), 0.)+ self.assertEqual(coverage_probability(5, 0, 5), 0.)+ self.assertEqual(coverage_probability(5, 5, 1), 1.)+ self.assertEqual(coverage_probability(5, 3, 3), 1.)++ def test_invalid_ranges_are_rejected_without_clipping(self):+ for args in [(-1, 0, 0), (5, -1, 2), (5, 6, 2), (5, 1, -1), (5, 1, 6)]:+ with self.assertRaises(ValueError): coverage_probability(*args)+ with self.assertRaises(TypeError): coverage_probability(5, 1.5, 2)++ def test_monotone_saturating_curve_and_full_set(self):+ h = [0, 1, 2, 5, 10, 20]+ curve = np.array([math.fsum(probabilities(20, h, k)) for k in range(21)])+ self.assertTrue((np.diff(curve) >= -1e-14).all())+ self.assertTrue((np.diff(curve, n=2) <= 1e-14).all())+ self.assertEqual(curve[0], 0.)+ self.assertEqual(curve[-1], 5.)+++class UniformSubsetTests(unittest.TestCase):+ def test_all_preregistered_draws_unique_fixed_k_and_membership(self):+ for stream, n in [(0, 599), (1, 11665)]:+ population = np.arange(n)*7+3+ before = population.copy()+ for seed in SEEDS:+ rows = uniform_rows(n, 297, seed, stream)+ self.assertEqual(len(rows), 297)+ self.assertEqual(len(np.unique(rows)), 297)+ self.assertTrue(np.all(rows[:-1] < rows[1:]))+ np.testing.assert_array_equal(checked_rows(population, population[rows]), rows)+ np.testing.assert_array_equal(rows, uniform_rows(n, 297, seed, stream))+ np.testing.assert_array_equal(population, before)+ self.assertEqual(SEEDS, tuple(range(20261024, 20261040)))+ self.assertEqual(STREAMS, {'pca5_matched': 0, 'observed_random': 1})++ def test_exact_pcg64_seedsequence_rule_and_independent_order(self):+ rows = uniform_rows(599, 297, SEEDS[0], 0)+ expected = np.sort(np.random.Generator(np.random.PCG64(np.random.SeedSequence([SEEDS[0], 0]))).choice(599, 297, replace=False))+ np.testing.assert_array_equal(rows, expected)+ uniform_rows(11665, 297, SEEDS[-1], 1)+ np.random.seed(999); np.random.random(100)+ np.testing.assert_array_equal(rows, uniform_rows(599, 297, SEEDS[0], 0))+ self.assertFalse(np.array_equal(rows, uniform_rows(599, 297, SEEDS[0], 1)))++ def test_selector_has_no_gt_geometry_roi_score_or_result_access(self):+ self.assertEqual(list(inspect.signature(uniform_rows).parameters), ['n', 'k', 'seed', 'stream'])+ tree = ast.parse(inspect.getsource(uniform_rows))+ names = {node.id for node in ast.walk(tree) if isinstance(node, ast.Name)}+ self.assertFalse(names & {'gt', 'roi', 'xyz', 'score', 'matcher', 'labels', 'reference', 'result', 'open'})+ self.assertTrue(names <= {'n', 'k', 'seed', 'stream', 'map', 'index', 'min', 'ValueError', 'np', 'rng'})+ annotations = dict(gt=np.zeros(599), roi=np.zeros(599), xyz=np.zeros((599, 3)), score=np.zeros(599))+ before = uniform_rows(599, 297, SEEDS[0], 0)+ for key in annotations:+ annotations[key] = annotations[key][::-1]+1+ np.testing.assert_array_equal(before, uniform_rows(599, 297, SEEDS[0], 0))+ with self.assertRaises(TypeError): uniform_rows(599, 297, SEEDS[0], 0, gt=annotations['gt'])++ def test_empty_full_and_invalid_count(self):+ np.testing.assert_array_equal(uniform_rows(0, 0, 0, 0), np.array([], int))+ np.testing.assert_array_equal(uniform_rows(5, 5, 0, 0), np.arange(5))+ for args in [(5, 6, 0, 0), (5, -1, 0, 0), (5, 2, -1, 0), (5, 2, 0, -1)]:+ with self.assertRaises(ValueError): uniform_rows(*args)++ def test_source_membership_and_xyz_preserved(self):+ support = np.array([5, 9, 13, 17, 28], np.int64)+ xyz = np.arange(15, dtype=np.float32).reshape(5, 3)+ before = array_sha(xyz)+ rows = uniform_rows(5, 3, 9, 0)+ selected = support[rows]+ np.testing.assert_array_equal(xyz[checked_rows(support, selected)], xyz[rows])+ self.assertEqual(before, array_sha(xyz))+ for bad in [np.array([5, 5]), np.array([-1]), np.array([100]), np.array([6]), np.array([5.])]:+ with self.assertRaises(ValueError): checked_rows(support, bad)+ with self.assertRaises(ValueError): checked_rows(np.array([9, 5]), np.array([5]))+++class MatchingAndPreservationTests(unittest.TestCase):+ def geometry(self, xyz):+ valid = np.ones(xyz.shape[:2], bool)+ return OrganizedGeometry(xyz, valid, {BOX: valid}, np.zeros_like(valid))++ def test_same_pair_different_nodes_cannot_jointly_match_reference(self):+ xyz = np.full((1, 5, 3), 10.)+ xyz[0, 0] = [0, 0, 1.1] # UV passes, XYZ fails+ xyz[0, 4] = [0, 0, 1.] # XYZ passes, UV fails+ g = self.geometry(xyz)+ m = CoverageMatcher(g, BOX, (np.array([[0., 0.]]), np.array([[0., 0., 1.]])), ((2., .003),))+ ids, nodes = m.reference_hits(np.array([0, 4]))+ self.assertEqual((len(ids), len(nodes)), (0, 0))++ def test_inclusive_pair_boundaries_and_node_reference_distinction(self):+ xyz = np.zeros((1, 3, 3), np.float64)+ xyz[0, :, 0] = [.003, .003000001, 0]+ g = self.geometry(xyz)+ ref = (np.array([[0., 0.], [0., 0.], [10., 0.]]), np.zeros((3, 3)))+ m = CoverageMatcher(g, BOX, ref, ((2., .003),))+ a = m.adjacencies['2px_3mm']+ r = describe(a)+ self.assertEqual(r['node_count'], 3)+ self.assertEqual(r['matching_node_count'], 2)+ self.assertEqual(r['unique_reference_count'], 2)+ self.assertEqual(r['pair_count'], 4)+ self.assertEqual(r['reference_multiplicity'], [2, 2, 0])+ self.assertEqual(r['node_reference_degree'], [2, 0, 2])+ self.assertEqual(r['reference_denominator'], 3)+ self.assertEqual(r['rim_matching_node_fraction'], 2/3)+ ids, nodes = m.reference_hits(np.array([0]))+ self.assertEqual((len(nodes), len(ids)), (1, 2))++ def test_duplicate_pairs_do_not_count_as_multiple_nodes(self):+ a = csr_matrix((np.ones(3, bool), ([0, 0, 1], [0, 0, 0])), shape=(2, 2))+ r = describe(a)+ self.assertEqual(r['reference_multiplicity'], [2, 0])+ self.assertEqual(r['pair_count'], 2)+ self.assertEqual(r['unique_reference_count'], 1)++ def test_summary_uses_sample_standard_deviation(self):+ self.assertEqual(summary([1, 3]), dict(mean=2., sample_sd=math.sqrt(2), min=1., max=3.))++ def test_preservation_failure_detects_changed_file(self):+ # Keep the fixture under REPO so the same relative-path hash logic is tested.+ root = Path(__file__).resolve().parents[3]+ with tempfile.TemporaryDirectory(dir=root) as folder:+ p = Path(folder)/'input.bin'; p.write_bytes(b'original')+ hashes = hash_files([p]); self.assertEqual(preserved(hashes)['status'], 'PASS')+ p.write_bytes(b'changed')+ with self.assertRaises(ValueError): preserved(hashes)+++if __name__ == '__main__': unittest.main()123456789{ "stage": "initial hash inventory before ExperimentLogger and before actual data validation", "exception_type": "TypeError", "reason": "dict keyword merge used overlapping source/input/initial-dirty hash keys", "actual_subsets_generated": false, "coverage_calculated": false, "input_mismatch": false, "fix": "dictionary unpacking merge; no input, seed, metric or tolerance change"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081{ "status": "PASS", "original_evidence_exact": true, "same_pair_joint_tolerance": true, "draw_count": 32, "all_draws_unique_k297_and_original_membership": true, "selections_saved_before_gt_annotation": true, "gt_blind_selector_signature": [ "n", "k", "seed", "stream" ], "original_reference_relation": [ 56, 1, 35 ], "exact_formula_exhaustive_synthetic_tests": true, "npz_readback_exact": true, "forbidden_actual_data_calls_guarded": true, "preservation": { "status": "PASS", "protected_file_count": 1202, "all_sha256_unchanged": true }, "tests": "Ran 24 tests in 0.045s; OK", "simulator_executed": false, "renderer_executed": false, "gpu_executed": false, "links": { "html_relative_targets": 17, "markdown_relative_targets": 14, "png_decodes": 5 }, "browser": { "status": "PASS", "images": [ { "src": "candidate_original.png", "complete": true, "width": 2017, "height": 1851 }, { "src": "candidate_matched.png", "complete": true, "width": 2760, "height": 1681 }, { "src": "reference_multiplicity.png", "complete": true, "width": 2734, "height": 1549 }, { "src": "expected_coverage.png", "complete": true, "width": 2229, "height": 869 }, { "src": "roi_depth_spatial.png", "complete": true, "width": 3079, "height": 1719 } ] }, "final_report_review": { "five_pngs_visually_inspected": true, "markdown_and_html_explanation_completed_from_saved_results": true, "diagnostic_source_and_raw_results_unchanged": true, "raw_result_sha256": { "candidate_count_matched.json": "c36ddd01f6567f59398bd5ee2f6bfc914ab88744cb40f2a50d2cbef14aede2c9", "candidate_count_matched.npz": "e2a038873e6798e5b87c8dc3258a76d44e97b4562e82dd45f01e2345d17994eb", "selection_before_annotation.npz": "989f451ee333cb97eb8d0145f8e2c84e7d86cf993d6a82a12e0d67e378808ba5" } }}123version https://git-lfs.github.com/spec/v1oid sha256:8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480size 22423431234567891011121314151617181920212223242526272829test_all_small_scalar_hypergeom_cases_against_rational (visual.runtime.test.test_candidate_count_matched.ExpectedCoverageTests.test_all_small_scalar_hypergeom_cases_against_rational) ... oktest_expected_unique_exhaustive_shared_nodes_and_duplicate_references (visual.runtime.test.test_candidate_count_matched.ExpectedCoverageTests.test_expected_unique_exhaustive_shared_nodes_and_duplicate_references) ... oktest_invalid_ranges_are_rejected_without_clipping (visual.runtime.test.test_candidate_count_matched.ExpectedCoverageTests.test_invalid_ranges_are_rejected_without_clipping) ... oktest_monotone_saturating_curve_and_full_set (visual.runtime.test.test_candidate_count_matched.ExpectedCoverageTests.test_monotone_saturating_curve_and_full_set) ... oktest_stable_tiny_coverage_probability (visual.runtime.test.test_candidate_count_matched.ExpectedCoverageTests.test_stable_tiny_coverage_probability) ... oktest_duplicate_pairs_do_not_count_as_multiple_nodes (visual.runtime.test.test_candidate_count_matched.MatchingAndPreservationTests.test_duplicate_pairs_do_not_count_as_multiple_nodes) ... oktest_inclusive_pair_boundaries_and_node_reference_distinction (visual.runtime.test.test_candidate_count_matched.MatchingAndPreservationTests.test_inclusive_pair_boundaries_and_node_reference_distinction) ... oktest_preservation_failure_detects_changed_file (visual.runtime.test.test_candidate_count_matched.MatchingAndPreservationTests.test_preservation_failure_detects_changed_file) ... oktest_same_pair_different_nodes_cannot_jointly_match_reference (visual.runtime.test.test_candidate_count_matched.MatchingAndPreservationTests.test_same_pair_different_nodes_cannot_jointly_match_reference) ... oktest_summary_uses_sample_standard_deviation (visual.runtime.test.test_candidate_count_matched.MatchingAndPreservationTests.test_summary_uses_sample_standard_deviation) ... oktest_all_preregistered_draws_unique_fixed_k_and_membership (visual.runtime.test.test_candidate_count_matched.UniformSubsetTests.test_all_preregistered_draws_unique_fixed_k_and_membership) ... oktest_empty_full_and_invalid_count (visual.runtime.test.test_candidate_count_matched.UniformSubsetTests.test_empty_full_and_invalid_count) ... oktest_exact_pcg64_seedsequence_rule_and_independent_order (visual.runtime.test.test_candidate_count_matched.UniformSubsetTests.test_exact_pcg64_seedsequence_rule_and_independent_order) ... oktest_selector_has_no_gt_geometry_roi_score_or_result_access (visual.runtime.test.test_candidate_count_matched.UniformSubsetTests.test_selector_has_no_gt_geometry_roi_score_or_result_access) ... oktest_source_membership_and_xyz_preserved (visual.runtime.test.test_candidate_count_matched.UniformSubsetTests.test_source_membership_and_xyz_preserved) ... oktest_joint_tolerance_requires_same_pair (visual.runtime.test.test_sampling_evaluation.SamplingEvaluationTests.test_joint_tolerance_requires_same_pair) ... oktest_tracking_and_sampling_losses_have_separate_denominators (visual.runtime.test.test_sampling_evaluation.SamplingEvaluationTests.test_tracking_and_sampling_losses_have_separate_denominators) ... oktest_empty_reference_is_undefined_not_perfect (visual.runtime.test.test_sampling_evaluation.SamplingEvaluationTests.test_empty_reference_is_undefined_not_perfect) ... oktest_reference_overlap_union_and_surface_outside_candidates (visual.runtime.test.test_sampling_evaluation.StagedCoverageTests.test_reference_overlap_union_and_surface_outside_candidates) ... oktest_two_different_nodes_cannot_satisfy_one_reference_pair (visual.runtime.test.test_sampling_evaluation.StagedCoverageTests.test_two_different_nodes_cannot_satisfy_one_reference_pair) ... oktest_empty_points_zero_observation_and_zero_visible (visual.runtime.test.test_sampling_evaluation.StagedCoverageTests.test_empty_points_zero_observation_and_zero_visible) ... oktest_invalid_nodes_and_non_partition_are_rejected (visual.runtime.test.test_sampling_evaluation.StagedCoverageTests.test_invalid_nodes_and_non_partition_are_rejected) ... oktest_negative_union_deduplicates_and_depth_bands_cover_paths (visual.runtime.test.test_sampling_evaluation.StagedCoverageTests.test_negative_union_deduplicates_and_depth_bands_cover_paths) ... oktest_historical_evaluation_changes_fail_closed (visual.runtime.test.test_sampling_evaluation.StagedCoverageTests.test_historical_evaluation_changes_fail_closed) ... ok
----------------------------------------------------------------------Ran 24 tests in 0.045s
OK123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102# Task03-H — Candidate Count-Matched Structural Evidence Analysis
실행 UUID: `79358cfd00bd409f837b713972fba2ca`. 동일 후보 수에서도 PCA5의 기대 rim coverage가 FD2보다 높다. 후보 수 증가만으로 원래 coverage 차이를 설명할 수 없다.
Primary: PCA5 297개 정확한 expected unique reference는 **79.898700/103 (77.57%)**, FD2 original은 **57/103**이며 차이는 **+22.898700 reference**다.
| 조건 | 후보 node 수 | rim matching node | rim matching fraction | unique rim reference /103 || --- | ---: | ---: | ---: | ---: || fd2 original | 297 | 101 | 34.01% | 57/103 || pca5 original | 599 | 127 | 21.20% | 91/103 || pca5_matched exact expectation | 297 | 62.9699 | 21.20% | 79.898700/103 || observed_random exact expectation | 297 | 3.8955 | 1.31% | 9.342834/103 |
정확한 기대값 행의 matching node/reference 수는 비정수 기대값이다. 실제 subset의 정수 count 및 16회 표본 평균과 구분한다. Rim matching fraction은 이 특정 rim에 대한 후보 집중도이며 일반적인 detector precision이 아니다.
## 고정 조건과 선택 독립성
ep000 Frame 0 Box, base_camera, 동일 관측 11,665개, 저장 FD2/PCA5 orientation-only 20° 후보 297/599개, 같은 103개 reference, 동일 pair의 ≤2px AND ≤3mm다. 원본 source index·XYZ·reference를 그대로 사용했으며 normal/candidate/backprojection/FPS를 재실행하지 않았다.
GT·ROI·score·XYZ를 받지 않는 uniform_rows(N,k,seed,stream)으로 비복원 선택했다. PCG64 + SeedSequence([seed,stream]), seed 20261024–20261039, PCA5 stream=0/observed stream=1, 조건별 16회, 대표 overlay는 사전 고정 r=0이다. 선택 배열은 GT matching annotation 전에 저장했다. 전체 관측 control은 candidate/normal-valid filtering을 하지 않았다.
## 후보 수 효과와 공간 분포
PCA5 original 91개와 FD2 original 57개의 차이는 34 reference다. 같은 PCA5 모집단을 297개로 줄일 때 기대 coverage 감소는 **11.101300 reference**이고, 줄인 뒤 FD2와의 차이는 **+22.898700 reference**다. 이는 고정 모집단에서의 기술적 비교이며 독립적인 인과 기여율이나 estimator 효과의 비율 분해가 아니다.
동일 297개에서 PCA5의 기대 rim matching node는 62.9699개로 FD2의 실제 101개보다 적지만, 덮는 reference는 더 많다. 따라서 높은 coverage를 rim matching node가 더 많아서 얻은 것으로도 설명할 수 없다. FD2는 특정 rim 위치에 더 집중되고 PCA5는 더 넓은 reference 위치를 포함한다. 이 차이는 특정 rim에 대한 집중도와 rim 전체의 위치 분포가 서로 다른 지표임을 보여준다.
Observed random 297개의 기대값은 **9.342834/103**, 기대 matching node는 **3.8955/297**다. 두 estimator의 rim 집중도와 임의 관측점 선택의 차이를 보는 대조군이다.
Expected unique coverage는 reference별 multiplicity h에 대한 1−C(N−h,k)/C(N,k)를 합산했다. 짧은 유한곱의 log1p, math.fsum 및 −expm1을 사용했다. Reference 간 독립성을 가정하지 않는다. 정확한 분산은 계산하지 않았고, 아래 변동은 고정 후보 집합의 부분추출 변동이다. Curve는 고정 후보의 analytic rarefaction으로 추가 실험/threshold sweep이 아니다.
| 조건 | 16회 실제 unique refs mean | sample SD | min–max | matching nodes mean || --- | ---: | ---: | ---: | ---: || pca5_matched | 79.0625 | 4.8093 | 68–86 | 62.8125 || observed_random | 8.8125 | 3.9870 | 1–18 | 3.8125 |
## 중복·누락과 reference 집합
| 모집단 | h=0 refs | h=1 refs | h≥2 refs | joint pairs | matching nodes || --- | ---: | ---: | ---: | ---: | ---: || fd2 | 46 | 2 | 55 | 231 | 101 || pca5 | 12 | 4 | 87 | 312 | 127 || observed | 0 | 0 | 103 | 381 | 153 |
한 node가 여러 reference를 덮을 수 있고 여러 node가 같은 reference에 집중될 수 있다. Pair 수를 node 수나 unique reference 수로 읽지 않는다. h가 높은 reference는 작은 k에서 포화되고, h=0인 위치는 원래 후보 전체를 사용해도 누락된다.
Original reference 교집합 56개, FD2-only 1개, PCA5-only 35개를 ID까지 재확인했다. Candidate source index 집합 관계는 252개 공통, FD2-only 45개, PCA5-only 347개다. 두 종류의 집합 관계는 서로 다르다.
| 원래 reference 그룹 | reference 수 | PCA5 matched의 기대 보존 수 || --- | ---: | ---: || 공통 | 56 | 50.620339 || FD2-only | 1 | 0 || PCA5-only | 35 | 29.278361 |
PCA5가 추가로 덮던 35개 위치 중 기대 29.278361개는 후보 수를 맞춰도 유지된다. 공통 reference의 일부 손실과 FD2-only 1개의 미검출을 함께 반영한 순차이가 primary의 +22.898700개다. 아래 구간별 결과에서도 `rim_axis1_+1`과 `rim_axis2_+1`의 추가 위치가 남는 것을 확인할 수 있다.
| 기존 rim 구간 | 구간 reference 수 | FD2 original covered | PCA5 original covered | PCA5 297 expected covered | Observed 297 expected covered || --- | ---: | ---: | ---: | ---: | ---: || rim_axis1_+1 | 25 | 3/103 | 24/103 | 19.8074/103 | 1.8851/103 || rim_axis1_-1 | 26 | 26/103 | 26/103 | 23.8141/103 | 2.7031/103 || rim_axis2_+1 | 26 | 2/103 | 15/103 | 11.9551/103 | 2.0061/103 || rim_axis2_-1 | 26 | 26/103 | 26/103 | 24.3221/103 | 2.7485/103 |
구간 크기는 별도 count이며 모든 coverage 비율의 분모는 103이다. 원래 56/1/35 reference 그룹별 기대 보존과 16회 실제 보존, reference 103행별 multiplicity/확률/누락 ID는 JSON/NPZ에 보존했다.
## 기존 ROI와 depth
| 조건 | negative union nodes / 전체 | depth median m | depth p95 m | max m || --- | ---: | ---: | ---: | ---: || fd2 original | 59/297 | 0.5000 | 0.6320 | 0.6900 || pca5 original | 281/599 | 0.4880 | 0.6665 | 1.4260 || pca5_matched 16회 mean | 139.8125/297 | 0.4874 | 0.6595 | 1.4191 || observed_random 16회 mean | 268.1250/297 | 0.4956 | 0.5411 | 3.5001 |
개별 ROI는 중첩되므로 합계와 union을 구분한다. ROI 점유는 오검출 정답이 아니며, 원거리 positive depth 자체도 오염 정답이 아니다. X의 median/p95로 고정한 depth bands, 개별 ROI count/fraction과 camera XY/XZ/source UV 분포를 별도 저장·시각화했다.
## 확인된 사실과 미확인 범위
동일 후보 수에서도 PCA5의 기대 rim coverage가 FD2보다 높다. 후보 수 증가만으로 원래 coverage 차이를 설명할 수 없다.이 결과는 고정 Frame 0 Box에서 후보 수를 통제한 rim coverage와 후보 위치·중복 분포의 근거다. PCA5의 모든 구조/형상에 대한 우월성, 모든 edge의 precision, 추가 후보가 noise인지 여부, 독립 episode 일반화, Graph/GNN/BC 효용은 검증하지 않았다. 후속 sampling 정책이나 Voxel 설계는 채택하지 않는다.
## 검증·재현성·산출물
작은 N 전수열거·exact rational 대조, same-pair tolerance·중복/집합·GT 독립성 계약 테스트를 통과했다. 입력 support/camera/XYZ와 저장 pair, 원래 103/57/91 coverage 및 56/1/35 집합을 재확인했다. 기존 source/input/artifact/sidecar와 초기 dirty 파일의 SHA-256 불변을 확인했다. 상세 PASS와 테스트 목록은 verification.json/tests.log를 따른다.
필수 계약 테스트는 **24개 PASS**다. 보호 대상 1,202개 파일의 SHA-256 불변, 결과 NPZ readback, Markdown↔HTML 및 결과 상대 링크, PNG 5개 decode와 Chrome headless의 이미지 5개 로드를 확인했다. 실제 검증 전 hash 목록 병합 코드의 초기화 오류가 한 번 있었으며 UUID·subset·coverage 생성 전 수정했다. [초기화 오류 기록](../../experiments/79358cfd00bd409f837b713972fba2ca/task03h_preflight_failure.json)에 남겼다. 실제 입력 gate 실패나 tolerance/source 조정은 없었다.
ExperimentLogger(team=visual, job_type=evaluate), WANDB_MODE=disabled와 기존 로컬 artifact 등록을 재사용했다. UUID/project/group 규칙은 유지했다. Git dirty 상태는 source snapshot/input hashes/implementation diff와 함께 보존했다. CPU NumPy/SciPy offline 분석이며 simulator·renderer·CUDA/MPS/GPU, 외부 업로드·dependency 설치·Git commit은 실행하지 않았다.
[승인된 계획](03h_candidate_count_matched_plan.md) · [정적 HTML](../../experiments/79358cfd00bd409f837b713972fba2ca/candidate_count_matched.html) · [결과 JSON](../../experiments/79358cfd00bd409f837b713972fba2ca/candidate_count_matched.json) · [결과 NPZ](../../experiments/79358cfd00bd409f837b713972fba2ca/candidate_count_matched.npz) · [검증](../../visual/results/diagnostic_previews/03h/verification.json) · [테스트](../../experiments/79358cfd00bd409f837b713972fba2ca/tests.log) · [hash](../../experiments/79358cfd00bd409f837b713972fba2ca/source_hashes.json) · [implementation diff](../../experiments/79358cfd00bd409f837b713972fba2ca/implementation.patch)





구현·진단·검증·보고를 완료했으며 추가 알고리즘 변경 없이 중단한다.12345678{ "status": " M docs/visual-graph-integration/03_sampling.md\n M visual/runtime/test/sampling_evaluation.py\n M visual/runtime/test/test_sampling_evaluation.py\n?? docs/visual-graph-integration/03ab_adaptive_node_budget.md\n?? docs/visual-graph-integration/03ab_adaptive_node_budget_plan.md\n?? docs/visual-graph-integration/03d_box_rim_bottleneck_phase1.md\n?? docs/visual-graph-integration/03d_priority_fps_seed_control_phase3.md\n?? docs/visual-graph-integration/03d_priority_fps_seed_control_phase3_plan.md\n?? docs/visual-graph-integration/03d_priority_fps_trace_phase2.md\n?? docs/visual-graph-integration/03d_priority_fps_trace_phase2_plan.md\n?? docs/visual-graph-integration/03e_priority_fps_metric_control.md\n?? docs/visual-graph-integration/03e_priority_fps_metric_control_plan.md\n?? docs/visual-graph-integration/03f_local_structural_sampling.md\n?? docs/visual-graph-integration/03f_local_structural_sampling_plan.md\n?? docs/visual-graph-integration/03g_geometry_aware_sampling.md\n?? docs/visual-graph-integration/03g_geometry_aware_sampling_plan.md\n?? docs/visual-graph-integration/03h_candidate_count_matched.md\n?? docs/visual-graph-integration/03h_candidate_count_matched_plan.md\n?? visual/runtime/test/run_adaptive_node_budget.py\n?? visual/runtime/test/run_candidate_count_matched.py\n?? visual/runtime/test/run_geometry_aware_sampling.py\n?? visual/runtime/test/run_local_structural_sampling.py\n?? visual/runtime/test/run_priority_fps_metric_control.py\n?? visual/runtime/test/run_priority_fps_seed_control.py\n?? visual/runtime/test/run_priority_fps_trace.py\n?? visual/runtime/test/run_rim_bottleneck.py\n?? visual/runtime/test/test_adaptive_node_budget.py\n?? visual/runtime/test/test_candidate_count_matched.py\n?? visual/runtime/test/test_geometry_aware_sampling.py\n?? visual/runtime/test/test_local_structural_sampling.py\n?? visual/runtime/test/test_priority_fps_metric_control.py\n?? visual/runtime/test/test_priority_fps_seed_control.py\n?? visual/runtime/test/test_priority_fps_trace.py\n", "initial_dirty_files_preserved": { "status": "PASS", "protected_file_count": 30, "all_sha256_unchanged": true }}123456789101112131415161718192021222324252627282930313233343536{ "git_status": " M docs/visual-graph-integration/03_sampling.md\n M visual/runtime/test/sampling_evaluation.py\n M visual/runtime/test/test_sampling_evaluation.py\n?? docs/visual-graph-integration/03ab_adaptive_node_budget.md\n?? docs/visual-graph-integration/03ab_adaptive_node_budget_plan.md\n?? docs/visual-graph-integration/03d_box_rim_bottleneck_phase1.md\n?? docs/visual-graph-integration/03d_priority_fps_seed_control_phase3.md\n?? docs/visual-graph-integration/03d_priority_fps_seed_control_phase3_plan.md\n?? docs/visual-graph-integration/03d_priority_fps_trace_phase2.md\n?? docs/visual-graph-integration/03d_priority_fps_trace_phase2_plan.md\n?? docs/visual-graph-integration/03e_priority_fps_metric_control.md\n?? docs/visual-graph-integration/03e_priority_fps_metric_control_plan.md\n?? docs/visual-graph-integration/03f_local_structural_sampling.md\n?? docs/visual-graph-integration/03f_local_structural_sampling_plan.md\n?? docs/visual-graph-integration/03g_geometry_aware_sampling.md\n?? docs/visual-graph-integration/03g_geometry_aware_sampling_plan.md\n?? docs/visual-graph-integration/03h_candidate_count_matched_plan.md\n?? visual/runtime/test/run_adaptive_node_budget.py\n?? visual/runtime/test/run_geometry_aware_sampling.py\n?? visual/runtime/test/run_local_structural_sampling.py\n?? visual/runtime/test/run_priority_fps_metric_control.py\n?? visual/runtime/test/run_priority_fps_seed_control.py\n?? visual/runtime/test/run_priority_fps_trace.py\n?? visual/runtime/test/run_rim_bottleneck.py\n?? visual/runtime/test/test_adaptive_node_budget.py\n?? visual/runtime/test/test_geometry_aware_sampling.py\n?? visual/runtime/test/test_local_structural_sampling.py\n?? visual/runtime/test/test_priority_fps_metric_control.py\n?? visual/runtime/test/test_priority_fps_seed_control.py\n?? visual/runtime/test/test_priority_fps_trace.py\n", "git_diff": "diff --git a/docs/visual-graph-integration/03_sampling.md b/docs/visual-graph-integration/03_sampling.md\nindex acb3c0f..ac76cf2 100644\n--- a/docs/visual-graph-integration/03_sampling.md\n+++ b/docs/visual-graph-integration/03_sampling.md\n@@ -7,6 +7,10 @@ S4 depth-only \uc6b0\uc120 \uc120\ud0dd\uc740 \uc774 \uc870\uac74\uc5d0\uc11c Peg \ubcf4\uc874\uc744 \ub0ae\ucd94\uace0 \uac00\ub9bc\u00b7\n \uc774 \uc218\uce58\ub294 **Tracker\uac00 \ud604\uc7ac \uad00\uce21\ud55c reference \ub300\ube44 Sampling \ubcf4\uc874\uc728**\uc774\ub2e4.\n \ucd5c\uc885 detector, threshold, ratio \ub610\ub294 feature \ud45c\ud604\uc744 \ucc44\ud0dd\ud55c \uacb0\uacfc\ub294 \uc544\ub2c8\ub2e4.\n \n+\ud6c4\uc18d [Task03-D Box rim \ubcd1\ubaa9 \ubd84\uc11d Phase 1](03d_box_rim_bottleneck_phase1.md)\uc740 \uc800\uc7a5\ub41c frame 0/120\uc758\n+\uad00\uce21\u00b7\ud6c4\ubcf4\u00b7priority\u00b7Surface coverage\ub97c \ubd84\ub9ac\ud55c\ub2e4. Frame 0\uc758 S3\ub294 \ud6c4\ubcf4 coverage\uac00 \ub354 \ub192\uc9c0\ub9cc\n+priority\uc640 \ucd5c\uc885 coverage\ub294 \ub354 \ub0ae\uc558\ub2e4. \uc624\uc5fc\u00b7\uc6d0\uac70\ub9ac depth\u00b7FPS \uac70\ub9ac \uacbd\uc7c1\uc758 \uc778\uacfc \uae30\uc5ec\uc728\uc740 \ubbf8\ud655\uc778\uc774\ub2e4.\n+\n \ucd5c\uc885 run: `2551448b0fae4c6bbce3caf48774275f`.\n [\uc804\uccb4 HTML](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/comparison.html), [\uc804\uccb4 summary\u00b7\uc124\uc815\u00b7fidelity JSON](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/comparison.json),\n [\uac80\uc99d \uae30\ub85d](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/verification.json), [budget/ratio/false selection/latency \uadf8\ub9bc](../../visual/results/sampling/2551448b0fae4c6bbce3caf48774275f/tradeoffs.png),\ndiff --git a/visual/runtime/test/sampling_evaluation.py b/visual/runtime/test/sampling_evaluation.py\nindex ea0f223..e242ecc 100644\n--- a/visual/runtime/test/sampling_evaluation.py\n+++ b/visual/runtime/test/sampling_evaluation.py\n@@ -44,6 +44,25 @@ class CoverageMatcher:\n @staticmethod\n def key(px,m): return f'{px:g}px_{m*1000:g}mm'\n \n+ def reference_hits(self, selected_flat, px=2., m=.003):\n+ \"\"\"Reference IDs and matched source nodes from the existing joint adjacency.\n+\n+ IDs are row positions in the saved reference arrays, not rounded pixels.\n+ A node can cover multiple IDs; multiple nodes covering one ID count once.\n+ \"\"\"\n+ selected_flat = np.asarray(selected_flat)\n+ if selected_flat.ndim != 1 or selected_flat.dtype.kind not in 'iu':\n+ raise ValueError('source indices must be a one-dimensional integer array')\n+ if len(np.unique(selected_flat)) != len(selected_flat):\n+ raise ValueError('duplicate source nodes')\n+ rows = np.searchsorted(self.flat, selected_flat)\n+ if len(rows) and ((rows >= len(self.flat)).any()\n+ or not np.array_equal(self.flat[rows], selected_flat)):\n+ raise ValueError('evaluation points outside observed support')\n+ adjacency = self.adjacencies[self.key(px, m)][rows]\n+ return (np.flatnonzero(adjacency.getnnz(axis=0)),\n+ selected_flat[adjacency.getnnz(axis=1) > 0])\n+\n def score(self, selected_flat):\n rows = np.searchsorted(self.flat, selected_flat)\n if len(rows) and ((rows >= len(self.flat)).any() or not np.array_equal(self.flat[rows], selected_flat)):\n@@ -78,6 +97,61 @@ class CoverageMatcher:\n return out, arrays\n \n \n+def count_ratio(numerator, denominator):\n+ \"\"\"Preserve raw counts, including undefined zero-denominator fractions.\"\"\"\n+ return dict(numerator=int(numerator), denominator=int(denominator),\n+ value=numerator/denominator if denominator else None)\n+\n+\n+def staged_reference_coverage(matcher, candidates, priority, surface, final):\n+ \"\"\"Saved-set diagnosis only; no candidate extraction or selection is run.\n+\n+ C/P are None for the General FPS control, rather than empty candidate sets.\n+ Set differences overlap and must not be summed as causal loss fractions.\n+ \"\"\"\n+ if (candidates is None) != (priority is None):\n+ raise ValueError('candidate and priority applicability must agree')\n+ nodes = dict(X=matcher.flat, C=candidates, P=priority, S=surface, F=final)\n+ hits, stages = {}, {}\n+ for name, flat in nodes.items():\n+ if flat is None:\n+ hits[name] = None\n+ stages[name] = None\n+ continue\n+ ids, matched = matcher.reference_hits(flat)\n+ hits[name] = set(ids.tolist())\n+ stages[name] = dict(node_count=len(flat), matched_node_count=len(matched),\n+ unique_reference_count=len(ids))\n+ p = np.asarray(priority if priority is not None else [], dtype=np.int64)\n+ if np.intersect1d(p, surface).size or set(final) != set(p) | set(surface):\n+ raise ValueError('final nodes must be the disjoint priority/surface union')\n+ if candidates is not None and not set(p) <= set(candidates):\n+ raise ValueError('priority nodes outside candidate support')\n+ v, o = set(range(matcher.nref)), hits['X']\n+ c, p, s, f = hits['C'], hits['P'], hits['S'], hits['F']\n+ if not f <= o or (c is not None and not c <= o):\n+ raise AssertionError('covered references outside observable references')\n+ if f != (p or set()) | s:\n+ raise AssertionError('final reference union differs from priority/surface')\n+ differences = {'V_minus_O': v-o, 'O_minus_F': o-f}\n+ if c is not None:\n+ differences.update(O_minus_C=o-c, C_minus_P=c-p, C_minus_F=c-f,\n+ P_intersect_S=p&s, S_minus_P=s-p, S_minus_C=s-c,\n+ C_minus_P_intersect_S=(c-p)&s)\n+ else:\n+ differences.update({key: None for key in ('O_minus_C', 'C_minus_P', 'C_minus_F',\n+ 'P_intersect_S', 'S_minus_P', 'S_minus_C', 'C_minus_P_intersect_S')})\n+ coverage = dict(observation=count_ratio(len(o), len(v)))\n+ for name, key in [('C', 'candidate'), ('P', 'priority'), ('S', 'surface'), ('F', 'final_retention')]:\n+ coverage[key] = count_ratio(len(hits[name]), len(o)) if hits[name] is not None else None\n+ return dict(stages=stages, coverage=coverage,\n+ gt_final_coverage=count_ratio(len(f), len(v)),\n+ reference_ids={k: sorted(ids) if ids is not None else None\n+ for k, ids in dict(V=v, O=o, **hits).items()},\n+ differences={k: dict(count=len(ids), reference_ids=sorted(ids)) if ids is not None else None\n+ for k, ids in differences.items()})\n+\n+\n def evaluation_context(frame, evidence, gt, camera, robot_ids):\n \"\"\"Reuse unchanged Task02 visible seam/rim definition; GT read after extraction.\"\"\"\n truths, regions, maps = real_truth(frame, evidence.frame, gt, camera)\ndiff --git a/visual/runtime/test/test_sampling_evaluation.py b/visual/runtime/test/test_sampling_evaluation.py\nindex 798172c..6975e66 100644\n--- a/visual/runtime/test/test_sampling_evaluation.py\n+++ b/visual/runtime/test/test_sampling_evaluation.py\n@@ -13,7 +13,10 @@ from visual.runtime.rgbd import PEG, BOX\n from visual.runtime.sampling import extract_sampling_evidence, sample_points, SamplingConfig\n from visual.runtime.test.normal_diagnostics import synthetic_frame, oracle, box_primitives, rim_region\n from visual.runtime.test.run_structural_edges import rim_reference\n-from visual.runtime.test.sampling_evaluation import CoverageMatcher\n+from visual.runtime.test.sampling_evaluation import CoverageMatcher, staged_reference_coverage\n+from visual.runtime.test.run_rim_bottleneck import (\n+ geometry_evidence, validate_saved_selection, occupancy, source_contract,\n+)\n from visual.runtime.test.run_sampling import conditions, evaluate\n \n \n@@ -110,4 +113,135 @@ class SamplingEvaluationTests(unittest.TestCase):\n with self.assertRaises(ValueError):evaluate(episode,masks,root/'out',camera='camera',selected=(),make_plots=False)\n \n \n+class StagedCoverageTests(unittest.TestCase):\n+ def fixture(self):\n+ mask = np.zeros((16, 16), bool)\n+ mask[5, [3, 6, 10]] = True\n+ k = np.array([[1000., 0, 8], [0, 1000., 8], [0, 0, 1]])\n+ frame = synthetic_frame(np.full((16, 16), .3, np.float32), k, mask)\n+ geometry = build_organized_geometry(frame)\n+ uv = np.array([[2., 5], [4.5, 5], [7., 5], [10., 5]])\n+ xyz = np.tile(geometry.xyz[5, 6], (4, 1))\n+ matcher = CoverageMatcher(geometry, PEG, (uv, xyz))\n+ return frame, geometry, matcher\n+\n+ def test_reference_overlap_union_and_surface_outside_candidates(self):\n+ _, _, matcher = self.fixture()\n+ c, p, s, f = [np.array(a, np.int64) for a in ([83, 86], [83], [86, 90], [90, 83, 86])]\n+ row = staged_reference_coverage(matcher, c, p, s, f)\n+ self.assertEqual(row['reference_ids']['C'], [0, 1, 2])\n+ self.assertEqual(row['reference_ids']['P'], [0, 1])\n+ self.assertEqual(row['reference_ids']['S'], [1, 2, 3])\n+ self.assertEqual(row['reference_ids']['F'], [0, 1, 2, 3])\n+ self.assertEqual(row['stages']['C'], dict(node_count=2, matched_node_count=2, unique_reference_count=3))\n+ expected = dict(V_minus_O=0, O_minus_C=1, C_minus_P=1, C_minus_F=0,\n+ P_intersect_S=1, S_minus_P=2, S_minus_C=1,\n+ C_minus_P_intersect_S=1, O_minus_F=0)\n+ self.assertEqual({k: v['count'] for k, v in row['differences'].items()}, expected)\n+ self.assertEqual(row['coverage']['candidate'], dict(numerator=3, denominator=4, value=.75))\n+\n+ def test_two_different_nodes_cannot_satisfy_one_reference_pair(self):\n+ frame, _, _ = self.fixture()\n+ intrinsic = frame.intrinsic.copy(); intrinsic[0, 0] = 100.\n+ geometry = build_organized_geometry(replace(frame, intrinsic=intrinsic))\n+ # Node 83 satisfies 2D only; node 90 satisfies 3D only.\n+ matcher = CoverageMatcher(geometry, PEG, (np.array([[3., 5]]), geometry.xyz[5, 10][None]))\n+ ids, matched = matcher.reference_hits(np.array([83, 90]))\n+ self.assertEqual((len(ids), len(matched)), (0, 0))\n+\n+ def test_empty_points_zero_observation_and_zero_visible(self):\n+ frame, geometry, matcher = self.fixture()\n+ empty = np.array([], np.int64)\n+ row = staged_reference_coverage(matcher, empty, empty, empty, empty)\n+ self.assertEqual(row['coverage']['final_retention'], dict(numerator=0, denominator=4, value=0.))\n+ geometry = build_organized_geometry(replace(frame, masks={PEG: np.zeros_like(frame.depth, bool)}))\n+ for refs in ((matcher.ref_uv, matcher.ref_xyz), (np.empty((0, 2)), np.empty((0, 3)))):\n+ row = staged_reference_coverage(CoverageMatcher(geometry, PEG, refs), empty, empty, empty, empty)\n+ self.assertEqual(row['coverage']['final_retention'], dict(numerator=0, denominator=0, value=None))\n+ self.assertEqual(row['coverage']['observation']['numerator'], 0)\n+ self.assertEqual(row['coverage']['observation']['denominator'], len(refs[0]))\n+\n+ def test_general_fps_candidate_and_priority_are_inapplicable(self):\n+ _, _, matcher = self.fixture()\n+ flat = matcher.flat\n+ row = staged_reference_coverage(matcher, None, None, flat, flat)\n+ for name in ('C', 'P'):\n+ self.assertIsNone(row['stages'][name])\n+ self.assertIsNone(row['coverage']['candidate'])\n+ self.assertIsNone(row['coverage']['priority'])\n+ self.assertIsNone(row['differences']['O_minus_C'])\n+ self.assertEqual(row['coverage']['surface'], row['coverage']['final_retention'])\n+\n+ def test_invalid_nodes_and_non_partition_are_rejected(self):\n+ _, _, matcher = self.fixture()\n+ for flat in (np.array([0]), np.array([83, 83]), np.array([256]), np.array([-1]), np.array([83.])):\n+ with self.assertRaises(ValueError):\n+ matcher.reference_hits(flat)\n+ with self.assertRaises(ValueError):\n+ staged_reference_coverage(matcher, np.array([83]), np.array([86]), np.array([90]), np.array([86, 90]))\n+ with self.assertRaises(ValueError):\n+ staged_reference_coverage(matcher, matcher.flat, np.array([83]), np.array([83, 90]), np.array([83, 90]))\n+ with self.assertRaises(ValueError):\n+ staged_reference_coverage(matcher, matcher.flat, np.array([83]), np.array([90]), matcher.flat)\n+\n+ def test_geometry_alignment_invalid_depth_overlap_and_pixel_centres(self):\n+ frame, _, _ = self.fixture()\n+ depth = frame.depth.copy()\n+ depth[5, 6] = 0\n+ depth[2, 2] = np.nan\n+ box = np.zeros_like(depth, bool)\n+ box[5, 10] = True # ambiguous in BOTH masks\n+ frame = replace(frame, depth=depth, masks={PEG: frame.masks[PEG], BOX: box})\n+ evidence = geometry_evidence(frame)\n+ geometry = evidence.frame.geometry\n+ self.assertEqual(np.flatnonzero(geometry.observed_mask(PEG)).tolist(), [83])\n+ self.assertFalse(geometry.observed_mask(BOX).any())\n+ self.assertTrue(np.isnan(geometry.xyz[5, 6]).all())\n+ z = float(depth[5, 3])\n+ np.testing.assert_allclose(geometry.xyz[5, 3], [(3.5-8)*z/1000, (5.5-8)*z/1000, z], rtol=1e-7)\n+ # Minimal evaluation adapter has exactly the existing validity ROI field.\n+ from visual.runtime.geometry import compute_geometric_features, GeometryParameters\n+ for oid in (PEG, BOX):\n+ features = compute_geometric_features(geometry, oid, np.full_like(geometry.xyz, np.nan),\n+ np.zeros_like(depth, bool), GeometryParameters())\n+ np.testing.assert_array_equal(evidence.frame.objects[oid].depth_validity_boundary,\n+ features.depth_validity_boundary)\n+ key = 'saved'\n+ archive = {'source_frame': np.array(frame.source_frame), 'shape': np.array(depth.shape),\n+ key+'/flat_index': np.array([83]), key+'/pixels_vu': np.array([[5, 3]]),\n+ key+'/object_id': np.array([PEG]), key+'/points': geometry.xyz[5, 3][None].copy(),\n+ key+'/priority_selected': np.array([False]), key+'/depth_priority_selected': np.array([False])}\n+ self.assertTrue(validate_saved_selection(archive, key, frame, geometry)['xyz_exact'])\n+ for field, corrupted in [('points', archive[key+'/points']+.001), ('pixels_vu', np.array([[5, 4]])),\n+ ('object_id', np.array([BOX]))]:\n+ with self.assertRaises((ValueError, AssertionError)):\n+ validate_saved_selection(dict(archive, **{key+'/'+field: corrupted}), key, frame, geometry)\n+ with self.assertRaises(ValueError):\n+ validate_saved_selection(dict(archive, source_frame=np.array(frame.source_frame+1)), key, frame, geometry)\n+\n+ def test_negative_union_deduplicates_and_depth_bands_cover_paths(self):\n+ frame, _, matcher = self.fixture()\n+ a = np.zeros_like(frame.depth, bool); b = a.copy()\n+ a[5, [3, 6]] = True; b[5, [6, 10]] = True\n+ row = occupancy(frame, dict(X=matcher.flat, C=None, P=None, S=matcher.flat, F=matcher.flat), dict(a=a, b=b))\n+ roi = row['negative_roi']\n+ self.assertEqual(roi['a']['F']['count']+roi['b']['F']['count'], 4)\n+ self.assertEqual(roi['known_negative_union']['F']['count'], 3)\n+ self.assertIsNone(roi['known_negative_union']['P'])\n+ self.assertEqual(sum(v['numerator'] for v in row['depth_quantile_occupancy']['F'].values()), 3)\n+\n+ def test_historical_evaluation_changes_fail_closed(self):\n+ import hashlib\n+ with tempfile.TemporaryDirectory() as directory:\n+ root = Path(directory)\n+ relative = 'visual/runtime/test/sampling_evaluation.py'\n+ snapshot = root/'evaluated_source'/relative\n+ snapshot.parent.mkdir(parents=True)\n+ source = Path(relative).read_text().replace('<= m', '<= m*2', 1)\n+ snapshot.write_text(source)\n+ config = {'source_sha256': {relative: hashlib.sha256(snapshot.read_bytes()).hexdigest()}}\n+ with self.assertRaisesRegex(ValueError, 'historical evaluation definition'):\n+ source_contract(root, config)\n+\n+\n if __name__=='__main__':unittest.main()\n", "hashes": { "docs/visual-graph-integration/03_sampling.md": "c6f539f387e83e901e3c9a5644122e085aad73cdce3ce469f41a1e8a4f6499c4", "visual/runtime/test/sampling_evaluation.py": "daebf8834d2c0d4ca7f95e927c87ed3d6c7fc3777909a49504e265443585d60b", "visual/runtime/test/test_sampling_evaluation.py": "8ec490314b6e55b3d4c0bc2b05f37036bf07fa3462039fd8b1676227d0a3b0bd", "docs/visual-graph-integration/03ab_adaptive_node_budget.md": "50af20b5d8176b1d7e978fd9afeec5abfa276bb6458797eeb81a2dc74abf524a", "docs/visual-graph-integration/03ab_adaptive_node_budget_plan.md": "105d04864be65f5a446efe4922697795042056f20f236681c514381b48cd9cd5", "docs/visual-graph-integration/03d_box_rim_bottleneck_phase1.md": "6b36dc9b9ed9aec8db5f4ccced8fe3cc76a1b9a8f1f66a75a0f8a1d88602d53d", "docs/visual-graph-integration/03d_priority_fps_seed_control_phase3.md": "707614a32fad479c78cb688b2fa021c83c338dfb08c760e5859d6b4650341ffd", "docs/visual-graph-integration/03d_priority_fps_seed_control_phase3_plan.md": "4525eb882015429b10dc03bebc9419063afac8ca70037a476f20437e60eb5334", "docs/visual-graph-integration/03d_priority_fps_trace_phase2.md": "20ae27422f260d39fc8dbab95a001d7b8ef11ddabe00e402f7051b889450ef9e", "docs/visual-graph-integration/03d_priority_fps_trace_phase2_plan.md": "c30a54a98318bad05c4ff17435fbac47bab4c146d32e69d586d4f6765d4b2a56", "docs/visual-graph-integration/03e_priority_fps_metric_control.md": "c6efd9bca1a47c385ae689cc6e159e3e4a00c60c598989f573e07eb9b724f0a7", "docs/visual-graph-integration/03e_priority_fps_metric_control_plan.md": "295b57ac3dc03abb2e390d1cd1f88e0a37b3d00d035fa6bec6e025b6467e7996", "docs/visual-graph-integration/03f_local_structural_sampling.md": "f62f565d703c687002e77ec8c2e0e618e6d589a62fd4dd261f413ad7db0cd794", "docs/visual-graph-integration/03f_local_structural_sampling_plan.md": "a918ac186a9de5c78a718911b60d3dc5b56488a1e74e7fc746cd0a33561e1d31", "docs/visual-graph-integration/03g_geometry_aware_sampling.md": "df7a2b9a9182dd1924d6914853045fc03268fc7bc442be0e47de95e388bfd18b", "docs/visual-graph-integration/03g_geometry_aware_sampling_plan.md": "5572b9b5611df1f57fcf3dda71f585bcb0c572c7ccfd20e8989d7364d569100e", "docs/visual-graph-integration/03h_candidate_count_matched_plan.md": "52656b41311bb85c185c872f1c33d436f0033a59980c85ee27b270621f14885d", "visual/runtime/test/run_adaptive_node_budget.py": "3ddfa394bb81e7a82d0a0f8d65e4146caad3243c4fe13359eb4dd4233b2b0cc9", "visual/runtime/test/run_geometry_aware_sampling.py": "6fcfd638a929e793ba920297942f2b85eb6b00b066058dd0133d32a358648276", "visual/runtime/test/run_local_structural_sampling.py": "4f65391c281fa8143d4be35bec957f979b11440be3178b7ae903a66fc7bc525f", "visual/runtime/test/run_priority_fps_metric_control.py": "c01afcd516f3cf2b1f1d34d5878be2376e849e50dc7c1b809854d8f5231d1ca9", "visual/runtime/test/run_priority_fps_seed_control.py": "e9ecf5d8d4fb140242063c341711cff787d14dada2cb362f50706def372b7a26", "visual/runtime/test/run_priority_fps_trace.py": "f41905efd42b375f74da5baaac770ade914df21f192bda3a6182792edae68f3b", "visual/runtime/test/run_rim_bottleneck.py": "8323bd3048438be9c90b663f1bc03ef6fdfd67d10eb123c1fd4930538428fda3", "visual/runtime/test/test_adaptive_node_budget.py": "d74c250c7380fc92a0b7983be773743531eb5acd6d6d631ab423fb7cb07d4189", "visual/runtime/test/test_geometry_aware_sampling.py": "cf2bd9fd5a1915b6d9fc3194898342745d6c0ba28355a306c303149f0b9eaf5f", "visual/runtime/test/test_local_structural_sampling.py": "d6758da4be04c7622a40ed9226503e6d2884de89f08992fc731200c8d21d7994", "visual/runtime/test/test_priority_fps_metric_control.py": "92977784be3da1c7151d2a032acefa1009e1ccf930d8514eec5623086613b565", "visual/runtime/test/test_priority_fps_seed_control.py": "69c8b3a1c420bec843bd8a3d948db009cd78c9ea6c99cb1376e15b60c3f47645", "visual/runtime/test/test_priority_fps_trace.py": "60e7a8a69c538c325cd59cf81527b52b09b19f1fdd4464025e02de39744c8f0a" }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155{ "artifacts": [ { "kind": "metrics", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/metrics/6d11e318b99a73e7fd91b2a023834884dfc5caec95e13f93c2248df290e0d44a/metrics.json", "sha256": "6d11e318b99a73e7fd91b2a023834884dfc5caec95e13f93c2248df290e0d44a", "size": 274 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/0b09856a9eb4095c10b3ab84b78796161990ec4cbfaa6bfc278e9bda0d287f3e/candidate_count_matched.html", "sha256": "0b09856a9eb4095c10b3ab84b78796161990ec4cbfaa6bfc278e9bda0d287f3e", "size": 5457 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/c36ddd01f6567f59398bd5ee2f6bfc914ab88744cb40f2a50d2cbef14aede2c9/candidate_count_matched.json", "sha256": "c36ddd01f6567f59398bd5ee2f6bfc914ab88744cb40f2a50d2cbef14aede2c9", "size": 1051933 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/a8e40e2c2bed6f39c79d615cdcfc16f8f4913aedf689b196e17c11a89505da27/candidate_matched.png", "sha256": "a8e40e2c2bed6f39c79d615cdcfc16f8f4913aedf689b196e17c11a89505da27", "size": 402325 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/70122d8d460c58006717ee94e671693207056d0400fdafd81d0d1998a7ff94c3/candidate_original.png", "sha256": "70122d8d460c58006717ee94e671693207056d0400fdafd81d0d1998a7ff94c3", "size": 322015 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9cabfb70a117866f17b57b05734b3c6655f253c8c5a0c540c98a0705bcae584b/expected_coverage.png", "sha256": "9cabfb70a117866f17b57b05734b3c6655f253c8c5a0c540c98a0705bcae584b", "size": 149482 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9f943e6647f621b507943d1744c24c1deab9f26f7ea552dcfb67b677f976ca9e/git_end.json", "sha256": "9f943e6647f621b507943d1744c24c1deab9f26f7ea552dcfb67b677f976ca9e", "size": 2161 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2a85e21142786e54bff67b4ce38cac8234f97f2581fe5fffcc8c13ae1e8331c5/git_start.diff", "sha256": "2a85e21142786e54bff67b4ce38cac8234f97f2581fe5fffcc8c13ae1e8331c5", "size": 15981 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/cf1d50c687f97c1310578c151b2541037910dfe2a3a27eca890b0cfd7b7d93e2/git_start.json", "sha256": "cf1d50c687f97c1310578c151b2541037910dfe2a3a27eca890b0cfd7b7d93e2", "size": 22528 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4f29eddf6ce14a045b15df9b3b862adf2ecd13098bc13ec15a510d6e223e348c/implementation.patch", "sha256": "4f29eddf6ce14a045b15df9b3b862adf2ecd13098bc13ec15a510d6e223e348c", "size": 81491 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4bdad8c9377dd3e2d314bb9455ec9f39957a7c61450dcbbac3e1f907d500dcd0/reference_multiplicity.png", "sha256": "4bdad8c9377dd3e2d314bb9455ec9f39957a7c61450dcbbac3e1f907d500dcd0", "size": 183745 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/29418a5e383dfd117e12e3301493095175a4e50f6babdfd5d4faa41155f39e47/roi_depth_spatial.png", "sha256": "29418a5e383dfd117e12e3301493095175a4e50f6babdfd5d4faa41155f39e47", "size": 412911 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/31c0914d201cda1604c3a2154af56cb0e2f6a7571b3eb6248777fa26dc23d29c/selection_before_annotation.json", "sha256": "31c0914d201cda1604c3a2154af56cb0e2f6a7571b3eb6248777fa26dc23d29c", "size": 159009 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2ebba979105ea42827b60a76f2002ba6671c353c0a87e6a72a7198c8c32a5abb/source_hashes.json", "sha256": "2ebba979105ea42827b60a76f2002ba6671c353c0a87e6a72a7198c8c32a5abb", "size": 576154 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/5ef74e80ebb59abc9a7252b14821543c3143c14657b3bf48a7f2f2f19a745d71/task03h_preflight_failure.json", "sha256": "5ef74e80ebb59abc9a7252b14821543c3143c14657b3bf48a7f2f2f19a745d71", "size": 397 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/932d1b3f751b1263aafd53079fac6800330c31a0c1150af26a9065042def9dde/tests.log", "sha256": "932d1b3f751b1263aafd53079fac6800330c31a0c1150af26a9065042def9dde", "size": 4499 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/65a2abdcf1b82ade8efbc6ad20b60ba63b8ebfaf8844bbcc502b3029801aed44/verification.json", "sha256": "65a2abdcf1b82ade8efbc6ad20b60ba63b8ebfaf8844bbcc502b3029801aed44", "size": 2113 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9c8e2db57eca489aa4e4d0176de411462341a4bf8292ca0a02583b3417289017/03h_candidate_count_matched.md", "sha256": "9c8e2db57eca489aa4e4d0176de411462341a4bf8292ca0a02583b3417289017", "size": 9561 }, { "kind": "reports", "path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480/report-8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480.zip", "sha256": "8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480", "size": 2242343 } ], "config_path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/config/47dd5619991eaa019f78087ef054eefa35b4431058c22da92f852d76e64d4009/config.yaml", "environment": null, "episode_metadata_paths": [], "git_commit": "2e10a51736826aa980f2fe79a801eb6c9da8e288", "git_dirty": true, "metrics_path": "visual/79358cfd00bd409f837b713972fba2ca/artifacts/metrics/6d11e318b99a73e7fd91b2a023834884dfc5caec95e13f93c2248df290e0d44a/metrics.json", "model_name": "task03h_candidate_count_matched", "random_seed": 20261024, "report_paths": [ "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/0b09856a9eb4095c10b3ab84b78796161990ec4cbfaa6bfc278e9bda0d287f3e/candidate_count_matched.html", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/c36ddd01f6567f59398bd5ee2f6bfc914ab88744cb40f2a50d2cbef14aede2c9/candidate_count_matched.json", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/a8e40e2c2bed6f39c79d615cdcfc16f8f4913aedf689b196e17c11a89505da27/candidate_matched.png", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/70122d8d460c58006717ee94e671693207056d0400fdafd81d0d1998a7ff94c3/candidate_original.png", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9cabfb70a117866f17b57b05734b3c6655f253c8c5a0c540c98a0705bcae584b/expected_coverage.png", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9f943e6647f621b507943d1744c24c1deab9f26f7ea552dcfb67b677f976ca9e/git_end.json", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2a85e21142786e54bff67b4ce38cac8234f97f2581fe5fffcc8c13ae1e8331c5/git_start.diff", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/cf1d50c687f97c1310578c151b2541037910dfe2a3a27eca890b0cfd7b7d93e2/git_start.json", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4f29eddf6ce14a045b15df9b3b862adf2ecd13098bc13ec15a510d6e223e348c/implementation.patch", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4bdad8c9377dd3e2d314bb9455ec9f39957a7c61450dcbbac3e1f907d500dcd0/reference_multiplicity.png", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/29418a5e383dfd117e12e3301493095175a4e50f6babdfd5d4faa41155f39e47/roi_depth_spatial.png", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/31c0914d201cda1604c3a2154af56cb0e2f6a7571b3eb6248777fa26dc23d29c/selection_before_annotation.json", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2ebba979105ea42827b60a76f2002ba6671c353c0a87e6a72a7198c8c32a5abb/source_hashes.json", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/5ef74e80ebb59abc9a7252b14821543c3143c14657b3bf48a7f2f2f19a745d71/task03h_preflight_failure.json", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/932d1b3f751b1263aafd53079fac6800330c31a0c1150af26a9065042def9dde/tests.log", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/65a2abdcf1b82ade8efbc6ad20b60ba63b8ebfaf8844bbcc502b3029801aed44/verification.json", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9c8e2db57eca489aa4e4d0176de411462341a4bf8292ca0a02583b3417289017/03h_candidate_count_matched.md", "visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480/report-8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480.zip" ], "run_id": "79358cfd00bd409f837b713972fba2ca", "schema_version": 1, "selection": [ "metrics", "reports" ], "task": null, "team": "visual", "wandb_run_id": "79358cfd00bd409f837b713972fba2ca"}visual/79358cfd00bd409f837b713972fba2ca/artifacts/config/47dd5619991eaa019f78087ef054eefa35b4431058c22da92f852d76e64d4009/config.yamlAdded
visual/79358cfd00bd409f837b713972fba2ca/artifacts/metrics/6d11e318b99a73e7fd91b2a023834884dfc5caec95e13f93c2248df290e0d44a/metrics.jsonAdded+12
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/0b09856a9eb4095c10b3ab84b78796161990ec4cbfaa6bfc278e9bda0d287f3e/candidate_count_matched.htmlAdded+1
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/29418a5e383dfd117e12e3301493095175a4e50f6babdfd5d4faa41155f39e47/roi_depth_spatial.pngAdded

Large File Pointer Details
- SHA256: 29418a5e383dfd117e12e3301493095175a4e50f6babdfd5d4faa41155f39e47
- Pointer size: 131 Bytes
- Size of remote file: 413 kB
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2a85e21142786e54bff67b4ce38cac8234f97f2581fe5fffcc8c13ae1e8331c5/git_start.diffAdded+259
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/2ebba979105ea42827b60a76f2002ba6671c353c0a87e6a72a7198c8c32a5abb/source_hashes.jsonAdded
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/31c0914d201cda1604c3a2154af56cb0e2f6a7571b3eb6248777fa26dc23d29c/selection_before_annotation.jsonAdded
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4bdad8c9377dd3e2d314bb9455ec9f39957a7c61450dcbbac3e1f907d500dcd0/reference_multiplicity.pngAdded

Large File Pointer Details
- SHA256: 4bdad8c9377dd3e2d314bb9455ec9f39957a7c61450dcbbac3e1f907d500dcd0
- Pointer size: 131 Bytes
- Size of remote file: 184 kB
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/4f29eddf6ce14a045b15df9b3b862adf2ecd13098bc13ec15a510d6e223e348c/implementation.patchAdded+1153
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/5ef74e80ebb59abc9a7252b14821543c3143c14657b3bf48a7f2f2f19a745d71/task03h_preflight_failure.jsonAdded+9
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/65a2abdcf1b82ade8efbc6ad20b60ba63b8ebfaf8844bbcc502b3029801aed44/verification.jsonAdded+81
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/70122d8d460c58006717ee94e671693207056d0400fdafd81d0d1998a7ff94c3/candidate_original.pngAdded

Large File Pointer Details
- SHA256: 70122d8d460c58006717ee94e671693207056d0400fdafd81d0d1998a7ff94c3
- Pointer size: 131 Bytes
- Size of remote file: 322 kB
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480/report-8deb4342b75b0bb3f48cb83be44138944c4b89553c176b77566610d377b92480.zipAdded+3
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/932d1b3f751b1263aafd53079fac6800330c31a0c1150af26a9065042def9dde/tests.logAdded+29
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9c8e2db57eca489aa4e4d0176de411462341a4bf8292ca0a02583b3417289017/03h_candidate_count_matched.mdAdded+102
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9cabfb70a117866f17b57b05734b3c6655f253c8c5a0c540c98a0705bcae584b/expected_coverage.pngAdded

Large File Pointer Details
- SHA256: 9cabfb70a117866f17b57b05734b3c6655f253c8c5a0c540c98a0705bcae584b
- Pointer size: 131 Bytes
- Size of remote file: 149 kB
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/9f943e6647f621b507943d1744c24c1deab9f26f7ea552dcfb67b677f976ca9e/git_end.jsonAdded+8
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/a8e40e2c2bed6f39c79d615cdcfc16f8f4913aedf689b196e17c11a89505da27/candidate_matched.pngAdded

Large File Pointer Details
- SHA256: a8e40e2c2bed6f39c79d615cdcfc16f8f4913aedf689b196e17c11a89505da27
- Pointer size: 131 Bytes
- Size of remote file: 402 kB
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/c36ddd01f6567f59398bd5ee2f6bfc914ab88744cb40f2a50d2cbef14aede2c9/candidate_count_matched.jsonAdded
visual/79358cfd00bd409f837b713972fba2ca/artifacts/reports/cf1d50c687f97c1310578c151b2541037910dfe2a3a27eca890b0cfd7b7d93e2/git_start.jsonAdded+36
visual/79358cfd00bd409f837b713972fba2ca/manifests/757ff7470aaca181f0f2efa9e70a6b0b55f276123197746caf766fa35dac703e/manifest.jsonAdded+155