Repository navigation
auto-hunt: CDC - 4 fixes (S3 2, S4 2) - #1236
Conversation
…moves them The package is held (reference: worse): the patch applies the removal as the loop is written, testing only hits later in the list (higher channels) than the saturated one, so its result depends on the hit order, which today's output does not. The issue reports the mismatch of option and code and asks the CDC experts to choose: retire the option (no output change) or apply it to hits on both sides. `patches/master.patch` is kept as the reference of the measured effect. Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-3-cdc-correlated-hits-never-removed/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-3-cdc-correlated-hits-never-removed Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One line in `libraries/CDC/DCDCTrackHit_factory.cc`, `BeginRun`: `cdc_drift_table.clear();` before the CCDB table is read into it, so a run's table replaces the previous run's. Nothing else changes. `patches/master.patch` applies unchanged to release 5.9.0. Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-9a-cdc-drift-table-appended-per-run/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-9a-cdc-drift-table-appended-per-run Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…et_amp unsigned wrap `libraries/CDC/DCDCHit_factory_Calib.cc`, `FindRogueHits`: `ABIT` and `PBIT` take the defaults 3 and 0 when the config word is `0xffff`, the same mapping `Process` already uses (`:293-294`). Two lines. The patch applies to release 5.9.0 without offset. Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-18-cdc-rogue-hits-config-bits-unguarded/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-18-cdc-rogue-hits-config-bits-unguarded Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…FDC, SC, TOF) - `libraries/CDC/DCDCHit_factory_Calib.cc`, three overloads: the straw bound is `Nstraws[ring-1]`. - `libraries/FDC/DFDCHit_factory.cc`, two overloads: the element bound is `the_table[gPlane-1].size()`. One more hunk corrects the error message of the wire-count check in `BeginRun`, which printed the size of another chamber's entry (message only). - `libraries/START_COUNTER/DSCHit_factory.cc`, two overloads: sectors are checked as 1..`MAX_SECTORS` and read at `sector-1`. - `libraries/TOF/DTOFHit_factory.cc`, the plane, bar, end overload: planes are checked as 0..`TOF_NUM_PLANES`-1 and bars read at `bar-1`. The indexing then matches the factories' own processing paths. `patches/master.patch` applies unchanged to release 5.9.0. Card: https://pages.jlab.org/halld/auto-hunt/cards/r4-20-getconstant-overloads-off-by-one/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/CDC/r4-20-getconstant-overloads-off-by-one Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R4-3 S3 (commit 8de0fb9)A CDC option to remove hits after a saturated hit is on by default and removes nothingWhat is wrong. An option, on by default, says "remove hits correlated in time with saturation hits". The code The code. Shortened (on GitHub): What it does. Run 132404 (2025-01), 998 events; "fixed" skips the flagged hits:
Plot: CDC hits on the connector of a saturated hit, by time after it Who is affected. Anyone who relies on the option: the flagged hits are in every output today. If the removal is Who is not. Simulation (0 of 1041 simulated eta -> gamma gamma events change). The fix. For the CDC experts: retire the option and its flagging, or skip the flagged hits. Skipping as coded tests only hits on higher channels than Grade S3 (third of four levels, S1 the widest), measured with the removal applied: hits change in 18% of events, Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-3-cdc-correlated-hits-never-removed/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R4-9a S3 (commit 291fe5a)In a job over two runs, the CDC drift table of the second run is appended to the firstWhat is wrong. At each run start the CDC hit step adds the drift-time table (78 rows, 0.01 cm apart) to a list The code, shortened (on GitHub): Fixed, before the loop: What it does (simulated events: 300 of run 132404 read after 300 of another run, against run 132404 alone):
In those 13 events the tracks are unchanged (the fit computes its own distance); the dE/dx particle-ID chi2 Plot: BH-927: in a two-run job 14 CDC hits get a distance 0.78 cm too large today, none with the fix BH-927. Two-run job minus run alone, per CDC hit. Who is affected. Jobs over several runs that rebuild CDC hits: CDC dE/dx of some tracks. Who is not.
The fix. Empty the list before reading the table. Grade S3 (third of four) on jobs over several runs: CDC hits change in 13 of the job's 600 events, dE/dx in Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-9a-cdc-drift-table-appended-per-run/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R4-18 S4 (commit dd09d8d)CDC afterpulse removal goes wrong when the readout's scale words are missingWhat is wrong. The CDC hit step removes afterpulses, small hits after a saturated hit on the same board. It scales The code, shortened (on GitHub): Fixed, as the main hit code already does: What it does (the afterpulse finder called directly; one x86 build):
On 1000 raw events of a 2025-01 run the finder finds no configuration and uses 3 and 0: 0 of 998 events change. BH-955. The afterpulse finder on test hits, with and without the scale words. Who is affected. Nobody with today's raw-data reader. The guard matters only if the finder ever gets the Who is not.
The fix. Replace 0xffff by 3 and 0, as the main hit code does. Grade S4 (lowest of four): the branch runs in no sample (0 of 998 events). Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-18-cdc-rogue-hits-config-bits-unguarded/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R4-20 S4 (commit cd686a5)Unused calibration look-ups of four hit steps read the neighbouring channel or past the tableWhat is wrong. The CDC, FDC, start-counter and TOF hit steps each have helper functions that check a channel The code, start counter, shortened (on GitHub): Fixed: The TOF helper lacks the same "minus one"; the CDC and FDC helpers lack it where they read a ring or plane size. What it does (each helper called directly with tables that hold their own channel number):
Plot: BH-956: 16 of 19 test cases wrong today, 0 with the fix; one case per detector shown BH-956. The look-ups called directly, one case per detector shown. Who is affected. Nobody today. Code written later that calls one of these helpers would get the neighbour's Who is not. Every output: nothing calls these helpers, no sample executed them, and no benchmark can reach The fix. Subtract one where the channel number indexes a table, in all four detectors. Grade S4 (lowest of four): no caller, so no event reaches the defect. Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r4-20-getconstant-overloads-off-by-one/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
|
Build status for this pull request: FAILURE Build log: make_auto-hunt_cdc.log |
|
R4-20 S4 : YES, the method GetConstant() is not used at all in CDC, FDC and Start_Counter, but it is used in TOF. While all the corrections to the code are legit, fortunately non of that code is actually used in the main classes. |
|
R4-9a S3 (commit 291fe5a): |
|
R4-3 S3 (commit 8de0fb9) Could you remove this commit please? We do need to retire the older afterpulse filter, but I cannot see that that's what the commit does. Oh. I see that that must be in R4-26 but it's not included in this PR, so we need that one instead, please. |
|
R4-18 S4 (commit dd09d8d) Yes. |
|
R4-3 S3 This code correction is |
…rt asked The older afterpulse filter in DCDCHit_factory::RemoveCorrelationHits is to be retired, and this commit did not do that. The file is back to master for this function; R4-9a, R4-18 and R4-20 are unchanged. Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test status for this pull request: SUCCESS Summary: summary.txt Build log: make_auto-hunt_cdc.log |
|
Where is R4-26 ? |
|
R4-20 S4 - Beni pointed out above that the incorrect function DCDCHit_factory_Calib::GetConstant is not used anywhere. I would prefer to remove this function. Is there a separate PR to fix the GetConstant function for the TOF? Changes to the TOF code should not be in the CDC PR. |
…e CDC correlated-hit removal is dead Retires the old correlated-hit (afterpulse) removal of DCDCHit_factory. The removal was switched off in 600d779 and deleted in 07ea0e0. The JANA2 port brought the block back without the code that read Mark4Removal, so it ran on every event and changed nothing. The afterpulse filter of DCDCHit_factory_Calib (CDC:ECHO_OPT) does this job. - Removes the Mark4Removal loop and the hit_info_vec it was built from. - Removes the options CDCHit:RemoveCorrelationHits, CDCHit:CorrelationHitsCut and CDCHit:CorrelatedHitPeak, the cdchit_info_t struct and the ttab member. - Removes event->Get(ttab) from BeginRun. ttab grew on every run change and ttab[0] then pointed to a deleted table (ASan heap-use-after-free at DCDCHit_factory.cc:134). Output is unchanged. Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and TOF parts move to their own pull request - Removes the three DCDCHit_factory_Calib::GetConstant overloads from the .cc and their declarations (and one commented-out declaration) from the .h. Nothing in halld_recon calls them. This replaces the indexing fix of cd686a5 for the CDC. - Reverts the FDC, SC and TOF parts of cd686a5. They move to a separate pull request, so this one changes only CDC code. Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
R4-26 is now in this PR as commit 6b813fa. It retires the old correlated-hit (afterpulse) removal in The unused The FDC, SC and TOF fixes are reverted here and moved to a separate PR, #1271. This PR now changes only CDC code. Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
|
Test status for this pull request: SUCCESS Summary: summary.txt Build log: make_auto-hunt_cdc.log |
…SC, TOF) - `libraries/FDC/DFDCHit_factory.cc`, two overloads: the element bound is `the_table[gPlane-1].size()`. One more hunk corrects the error message of the wire-count check in `BeginRun`, which printed the size of another chamber's entry (message only). - `libraries/START_COUNTER/DSCHit_factory.cc`, two overloads: sectors are checked as 1..`MAX_SECTORS` and read at `sector-1`. - `libraries/TOF/DTOFHit_factory.cc`, the plane, bar, end overload: planes are checked as 0..`TOF_NUM_PLANES`-1 and bars read at `bar-1`. The indexing then matches the factories' own processing paths. These overloads have no callers in halld_recon today. Split from JeffersonLab#1236, which now carries only the CDC part (the CDC overloads are removed there). Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These fixes come from the Hall D bug hunt, an autonomous campaign that read the GlueX software, built a test for every suspect line, and kept only findings confirmed by a measurement: a test run of the program on data or simulation, or a direct call of the code against a known answer. Each commit below fixes one finding and is named by its finding id and grade (S1 most serious, S4 least). Every commit has a comment in this pull request with the finding's card: what is wrong, the code, the measured effect, who is affected and the fix. Full cards with plots are on the campaign pages (JLab login): https://pages.jlab.org/halld/auto-hunt/index.html, by library: https://pages.jlab.org/halld/auto-hunt/libraries.html
Overall gains
4 confirmed bugs fixed in this pull request (S3 2, S4 2), one commit each, in the order of the commits (most serious first).
Related findings and commits that belong together
How it was tested
Each finding's card says how it was confirmed (a run of the program before and after the fix on the same events, or a direct call of the function). The commits were rebased on the current default branch; every changed source file compiles (syntax check against the release headers). A full build and a physics benchmark of this combination of commits has not been run on the new base.
Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)