Skip to content

acamd: the deliberate-offset allowance may be consumed only by the correction that used it (wrong-object exposure, stacked on #484) - #488

Closed
cfremling wants to merge 1 commit into
fix/deliberate-offset-capfrom
fix/deliberate-offset-consume-race
Closed

cfremling wants to merge 1 commit into
fix/deliberate-offset-capfrom
fix/deliberate-offset-consume-race

Conversation

@cfremling

Copy link
Copy Markdown
Collaborator

Problem (one sentence): an offsetgoal that lands while an ordinary guide correction's blocking pt_offset is still in flight has its large-offset allowance cleared by that correction's post-send store(false), so the science offset is then refused against the 60″ guide cap and the exposure is taken on the offset star.

Trace, UT 2026-10-06, ZTF26abydudp (acamd + tcsd logs):

09:10:40.694  (Acam::Target::do_acquire) [ACQUIRE] offset=0.137761 (arcsec)
09:10:40.695  (TCS::Server::doit) received command on port 9007 ... offset -0.081694 0.110924 40
09:10:41.026  (Acam::Server::doit) received command on fd 24 (274): offsetgoal 0.035329 0.013534
09:10:41.031  (TcsDaemonClient::pt_offset) success DONE
09:10:49.411  (Acam::Target::do_acquire) [ACQUIRE] offset=136.193 (arcsec)
09:10:49.411  (Acam::Target::do_acquire) [WARNING] calculated offset 136.193 not below max 60 and will not be sent to the TCS
09:11:04.118  (Acam::Target::do_acquire) [WARNING] calculated offset 136.033 not below max 60 and will not be sent to the TCS

The 136″ star→target offset was armed at .026 and consumed at .031 by the 0.14″ correction that was already being sent; the telescope never moved and 09:10:50–09:14:12 exposed the star.

Fix: latch the allowance into large when the cap is chosen and clear it only when large is true, at both consume sites (send and reject). A correction decided under the ordinary cap can no longer clear an allowance armed during its send. Stacked on #484, which fixes the other race on the same flag (the mode gate); base is fix/deliberate-offset-cap, retarget to main once #484 merges.

…rrection that used it

An offsetgoal that lands while an ordinary guide correction's blocking
pt_offset is in flight had its allowance cleared by that correction's
post-send store(false); the science offset was then refused against the
60" cap and the exposure was taken on the offset star (UT 2026-10-06
09:10:41, ZTF26abydudp). Latch the allowance into `large` when the cap is
chosen and clear it only when `large` is true, at both consume sites.
Stacked on #484 (same block).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T18:08:30.375472Z b92e042 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b92e042768

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread acamd/acam_interface.cpp
// offset_goal armed while that correction's blocking pt_offset was still
// in flight (UT 2026-10-06 09:10:41, ZTF26abydudp: armed at .026,
// cleared at .031, the 136" science offset refused against 60").
const bool large = this->allow_large_offset.load();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Tie the allowance to the goal generation

If offset_goal updates acam_goal and arms the flag after ra_off/offset were calculated but before this load, the stale ordinary correction is incorrectly classified as large; it can be sent under the expanded cap and then clear the allowance at line 3704. The next iteration computes the actual deliberate science offset without its allowance, so an offset above 60″ is rejected and exposure can remain on the offset star. A boolean snapshot cannot associate an allowance with the goal that created it; this needs synchronization or a generation/token captured alongside the goal.

Useful? React with 👍 / 👎.

@cfremling

Copy link
Copy Markdown
Collaborator Author

Withdrawn: a boolean snapshot cannot bind the allowance to the goal that armed it (see review), and the complete fix is a goal-generation token rather than a one-line change. The defect and trace stay in Jira PAL-171 for the acamd owner.

@cfremling cfremling closed this Oct 6, 2026
@cfremling
cfremling deleted the fix/deliberate-offset-consume-race branch October 6, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant