executeOp: zero the Phase-2 raw for accumulate-style kernels (scatter correctness is stack-layout-dependent)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- documentation, embedded-iot, testing-qa
Research direction
Start with ExecuteOp.c:486 and the funnel contract in docs/conventions/, then read the PR4 wave-2 report and the dx-test comments in test/unit/layer/UnitTest{AvgPool1d,AdaptiveAvgPool1d,MaxPool1d}.c. Compare the listed scatter kernels and evaluate the two zeroing options. Done means the contract decision is recorded, the chosen behavior is implemented consistently, and tests can reliably detect a missing zeroing step.
Written by the indexing model from the issue text.
Description
Design decision surfaced by the BFP epic PR4 wave-2 review (FU-1): the correctness of every scatter-style backward kernel currently depends on the kernel remembering to memset the funnel's Phase-2 raw — and a FORGOTTEN memset is not reliably testable.
Mechanism: executeOp sizes the Phase-2 raw as a stack VLA (ExecuteOp.c:486 on the PR4 branch) and hands it to the kernel uninitialized. Scatter kernels (the three PR4 BFP dx kernels, the SYM backward kernels in all three pool layers, Conv1d's weight-grad kernel) accumulate into it and must zero it first. Whether a dropped memset is observable depends on what the prologue's callee frames left at that stack depth — PR4's instrumented builds saw both all-zeros AND garbage (−1.0e31) on a FIRST call, so a green test proves nothing about the memset. PR4's dx value tests mitigate by calling the backward twice (pinning OUT_WRITE idempotence — a real contract, but a probabilistic kill).
Options:
executeOpzeroes the raw for accumulate-style kernels (simplest; costs a memset per op for kernels that overwrite anyway), or- an
opSpec_tflag (zeroRaw/accumulatesIntoRaw) so only scatter kernels pay, with the flag itself testable.
Repo-wide question (touches the funnel contract in docs/conventions/), so it needs a deliberate decision rather than a drive-by fix. Evidence and per-layer kill-status notes: PR4 wave-2 report + the dx-test comments in test/unit/layer/UnitTest{AvgPool1d,AdaptiveAvgPool1d,MaxPool1d}.c.
🤖 Generated with Claude Code
- Dominant language
- C
- Stars
- 2
- Forks
- 3
- Avg merge
- 13h 6m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No 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 es-ude/OnDeviceTraining
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
es-ude/OnDeviceTraining#549 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
es-ude/OnDeviceTraining#547 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
es-ude/OnDeviceTraining#536 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
es-ude/OnDeviceTraining#478 ·
Maintainers usually reply within 1 day
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
es-ude/OnDeviceTraining#459 ·
Maintainers usually reply within 1 day
All issues in es-ude/OnDeviceTraining
Similar issues
-
issue: bug report
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
BasedHardware/omi#26486 ·
Maintainers usually reply within 1 day
-
The LLVM object can build before collection_config.h is generatedPossibly taken @Vonng claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
aws/pgcollection#51 ·
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yugabyte/yugabyte-db#39462 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
libreswan/libreswan#3185 · 1 comment ·
Maintainers usually reply within 1 day