Missed event across a year boundary silently blocks later events
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 73/100
Research direction
Start with processEventsForCarbon() and trace the date checks in nitrogen processing and event output, as the issue proposes. Build SIPNET with make and reproduce using the supplied climate and event records; add regression coverage for cross-year misses, same-year misses, and valid schedules. Done when an overdue event reports the missing climate record and exits with an error, while valid events still run.
Written by the indexing model from the issue text.
Description
Description:
An event without a matching climate record can block later events across a year boundary while SIPNET exits successfully.
Reproduced on master at 6c2193470f48076206eeea74b3a20c0753a55d9e.
Relationship to #74 / #77
This is a follow-up to #74 and #77. That PR fixed event ordering checks in the reader, but left the runtime date comparison unchanged. This reproducer uses correctly ordered events; the failure occurs when a climate date passes an unmatched event.
Steps to reproduce
From the repository root, build SIPNET and create an isolated run:
make
repo_dir="$(pwd)"
run_dir="$(mktemp -d)"
cp tests/sipnet/test_restart_infrastructure/restart.param \
"$run_dir/run.param"
cat > "$run_dir/run.in" <<'EOF'
FILE_NAME run
EVENTS 1
EOF
cat > "$run_dir/run.clim" <<'EOF'
2016 100 0.00 1.0 20.0 15.0 0.0 0.0 1000.0 500.0 1000.0 2.0
2017 10 0.00 1.0 20.0 15.0 0.0 0.0 1000.0 500.0 1000.0 2.0
EOF
cat > "$run_dir/events.in" <<'EOF'
2016 200 till 0.2
2017 10 till 0.3
EOF
(
cd "$run_dir" || exit 1
"$repo_dir/sipnet" -i run.in --no-do-main-output
printf 'Exit status: %s\n' "$?"
cat events.out
)
Actual: Exit status is 0. events.out contains only its header; neither tillage is applied.
Expected: SIPNET should report the missing climate record for the event on 2016/200 and exit with an error when climate advances to 2017/10.
For comparison, removing the 2016/200 event allows the 2017/10 tillage to run successfully.
Cause and impact
processEventsForCarbon() uses:
event->year <= climYear && event->day <= climDay
For event 2016/200 and climate 2017/10, the day comparison is false, so the existing missing-climate error is never reached. The stale event remains at the front of the queue and blocks later events.
This can let automated runs accept results with missing management actions. If a later climate record reaches the blocked event’s day-of-year, the error is reported late instead.
Proposed approach
I propose comparing the complete (year, day) date so an overdue event triggers the existing error immediately. I will also review the matching predicates in nitrogen processing and event output for consistency, and add regression tests for missed events across year boundaries, same-year misses, and valid event schedules.
I would like to work on this issue and submit a fix PR.
- Dominant language
- C
- Stars
- 42
- Forks
- 38
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PecanProject/sipnet
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PecanProject/sipnet#435 · 1 comment ·
Maintainers usually reply within 2 days
-
Make sure that documentation of sipnet.out header reflects implementationPossibly taken @TianHengZhuang claimed this 19 days ago. Opendocumentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
PecanProject/sipnet#345 · 8 comments · 1 reaction ·
Maintainers usually reply within 2 days
-
Remove unused `Tracker` fieldsMay be free again @ANAMASGARD claimed this 9 days ago, and no pull request is open. Opengood first issue on hold
Difficulty 4/5 3-5 days Newbie friendliness 45/100
PecanProject/sipnet#430 · 1 comment · 1 reaction ·
Maintainers usually reply within 2 days
-
Event checks ignore every events.in record after the firstPossibly taken @ANAMASGARD claimed this 9 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 70/100
PecanProject/sipnet#429 · 3 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
Events: revamp handling of "big delta" events to post-pool-updatePossibly taken @Alomir claimed this 11 days ago. Open
PecanProject/sipnet#423 · 1 assignee ·
Maintainers usually reply within 2 days
All issues in PecanProject/sipnet
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kmod-project/kmod#492 ·
Maintainers usually reply within 4 days
-
SDL_GPU Vulkan: wrong screen orientation on OpenHarmony (preTransform set without pre-rotation)Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
libsdl-org/SDL#16670 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
要トリアージ 辞書
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
yksr-melt/Meltype#1625 · 1 reaction ·
Maintainers usually reply within 1 day
-
kind/bug priority/medium qa_automation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
yugabyte/yugabyte-db#37324 ·
Maintainers usually reply within 1 day