Skip to content

Fix: prevent L2 swimlane records from crossing buffers - #1513

Merged
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
indigo1973:swim_0725
Jul 27, 2026
Merged

Fix: prevent L2 swimlane records from crossing buffers#1513
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
indigo1973:swim_0725

Conversation

@indigo1973

Copy link
Copy Markdown
Contributor

Reserve each AICore record slot before ACK so an AICPU buffer rotation after FIN cannot redirect the completed task into the next buffer generation. Commit timestamps and task identity to the reserved address after FIN without reading the active head again.

Capture end_time immediately after task execution and before FIN. Keep the existing ACK gate responsible only for old-buffer lifetime and host collection.

Validated with the Qwen3-14B warmup-only serving workload: 860265 Prefill and 19264 Decode AICPU/AICore records matched one-to-one, with no zero start times, duplicate keys, join gaps, sequence breaks, or invalid buffer boundaries.

Reserve each AICore record slot before ACK so an AICPU buffer rotation after FIN cannot redirect the completed task into the next buffer generation. Commit timestamps and task identity to the reserved address after FIN without reading the active head again.

Capture end_time immediately after task execution and before FIN. Keep the existing ACK gate responsible only for old-buffer lifetime and host collection.

Validated with the Qwen3-14B warmup-only serving workload: 860265 Prefill and 19264 Decode AICPU/AICore records matched one-to-one, with no zero start times, duplicate keys, join gaps, sequence breaks, or invalid buffer boundaries.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b4f1c01f-33be-4637-be07-61aa7121d379

📥 Commits

Reviewing files that changed from the base of the PR and between f7909e2 and 9a4ad16.

📒 Files selected for processing (3)
  • src/a2a3/runtime/host_build_graph/aicore/aicore_executor.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/aicore/aicore_executor.cpp
  • src/common/platform/include/aicore/l2_swimlane_collector_aicore.h

📝 Walkthrough

Walkthrough

The L2 swimlane recording path now separates record-slot reservation from record population. Both AICore executors reserve records before acknowledgement, capture execution end time earlier, and commit timing and task identity afterward.

Changes

L2 swimlane recording

Layer / File(s) Summary
Split swimlane reservation and commit helpers
src/common/platform/include/aicore/l2_swimlane_collector_aicore.h
Adds helpers for reserving task slots and committing timestamps and identity, while preserving l2_swimlane_aicore_record_task as a wrapper.
Host-build AICore reservation and timing integration
src/a2a3/runtime/host_build_graph/aicore/aicore_executor.cpp
Reserves records before acknowledgement, captures end_time immediately after execution, and commits the reserved record after FIN handling.
Tensormap AICore reservation and FIN ordering
src/a2a3/runtime/tensormap_and_ringbuffer/aicore/aicore_executor.cpp
Reserves records before acknowledgement, captures end_time before FIN, and uses the commit helper for swimlane updates.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AICoreExecutor
  participant ReserveHelper
  participant AICPU
  participant ExecuteTask
  participant CommitHelper
  AICoreExecutor->>ReserveHelper: reserve L2 swimlane record
  AICoreExecutor->>AICPU: issue task ACK
  AICoreExecutor->>ExecuteTask: execute task
  ExecuteTask-->>AICoreExecutor: return execution result
  AICoreExecutor->>AICPU: write task FIN
  AICoreExecutor->>CommitHelper: commit reserved record with timing and identity
Loading

Poem

I’m a rabbit with records in rows,
Reserving each slot before ACK flows.
End time tucked near the task’s little run,
FIN follows neatly when work is done.
Then commit flushes data bright—
Hop, hop, swimlane, out of sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: preventing L2 swimlane records from crossing buffer generations.
Description check ✅ Passed The description directly matches the implemented reserve-before-ACK and commit-after-FIN L2 swimlane flow changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ChaoZheng109
ChaoZheng109 merged commit a53cc16 into hw-native-sys:main Jul 27, 2026
15 of 16 checks passed
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.

2 participants