Repository navigation
gate: the count check reads the xsources against its own SExtractor catalog, and no check reads another job - #693
Merged
Merged
Conversation
…atalog, and no check reads another job A packet set is held when its difference's n_xsources_snr_gt20 (kept positive xsources with PSF-fit S/N above 20) is above [gate] snr_gt20_fraction_max (0.5) times n_xsources_read_positive (positive SExtractor rows before the edge cut and prefilter), judged only when that catalog read at least snr_gt20_min_read (100) rows. snr_gt20_factor (the run-median count) and min_epochs are retired, so every check applies from a run's first difference; decide_all reads two statements and no run median. The difference stage records the two counts (metrics.xsource_counts). Implements rapid_docs decision-gate-xsources-fraction. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RussLaher
requested review from
abostroem,
eramey16,
jjencson91 and
rusholme
as code owners
December 4, 2026 16:20
Collaborator
Author
|
My plan for later is to store n_xsources_snr_gt20 and n_xsources_read_positive from the gate test in the database, so these quantities can be easily analyzed for tuning the snr_gt20_fraction_max threshold. |
…ferences Replayed on runs 264 to 306 (read-only, from each job's manifest and xsources.parquet): the fraction is at most 0.288 but for two epochs, at 0.352 and 0.401, whose n_sources_snr_gt20 was 13 and 33 times their run's median. At 0.5 the check held nothing. The 100-row floor stays the ruling's: no recorded catalog read fewer than 291 rows. The runbook's two descriptions of the gate now state the new rule. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements rapid_docs
decision-gate-xsources-fraction(Caltech-IPAC/rapid_docs#254:decisions.md, the quality gate section offoundation.md, anddifference.md).Change.
rapidpipe/foundation/gate.py:n_xsources_snr_gt20(kept positive xsources with PSF-fit S/N > 20) is above[gate] snr_gt20_fraction_max(0.32) timesn_xsources_read_positive(positive SExtractor rows before the edge cut and prefilter).snr_gt20_min_read(100) rows.min_epochsare removed.judgeno longer takes a median or epoch count, anddecide_allreads only the set's own difference job (two statements).rapidpipe/science/difference/metrics.py(xsource_counts) andrapidpipe/stages/difference.py: the difference job records the two counts.foundation-thin.toml[gate]: addssnr_gt20_fraction_max = 0.32andsnr_gt20_min_read = 100, and removessnr_gt20_factorandmin_epochs. A run body that still carries the removed keys is ignored, not refused.Reason. The packets come from the xsources, so the count should describe that catalog, and no check should depend on the run's history. The old check 3 had these weak points:
Consequences:
Testing. All run locally (Python 3.14, PostgreSQL 17):
tests/unit/test_gate.py,test_quality_metrics.py,test_difference_stage.py,test_dependency_direction.pyandtest_ported_from.py: 183 passed.tests/dbandtests/cliagainst a freshschema.sql: 211 passed.test_publish_poolwas not run, as it needs pgbouncer.tests/unit: 1414 passed, 1 failed. The failure istest_run_job_workdir, which also fails on the unmodified baseline on macOS.check-public-safety.sh: clean.0.32 is read on 3,794 recorded difference jobs (runs 264 to 306, replayed read-only from each job's manifest and
xsources.parquet): the fraction is at most 0.288 but for two epochs, at 0.352 and 0.401, whosen_sources_snr_gt20was 13 and 33 times their run's median. At the first draft's 0.5 the check held nothing. 100 is the ruling's value; no recorded catalog read fewer than 291 rows.🤖 Generated with Claude Code