Skip to content

[PTOAS] finalize pipe init nosplit semantics#469

Open
TaoTao-real wants to merge 3 commits intohw-native-sys:codex/pipe-init-nosplitfrom
TaoTao-real:codex/explicit-pipe-nosplit
Open

[PTOAS] finalize pipe init nosplit semantics#469
TaoTao-real wants to merge 3 commits intohw-native-sys:codex/pipe-init-nosplitfrom
TaoTao-real:codex/explicit-pipe-nosplit

Conversation

@TaoTao-real
Copy link
Copy Markdown
Contributor

Summary

  • add explicit frontend nosplit support for aic/aiv_initialize_pipe
  • infer missing internal init nosplit from downstream split usage for backward compatibility
  • validate mixed split usage / explicit-nosplit conflicts before memory planning
  • align A3/A5 EmitC TPipe template argument order with the updated pto-isa layout

Motivation

  • follow up on PR infer pipe init nosplit from split-0 users #452 without burying more semantics in ResolveReservedBuffers
  • preserve compatibility for older IR such as test/samples/TPushTPop/test3/kernel.pto that omits init-level nosplit
  • let newer IR spell nosplit explicitly and fail early when user intent conflicts with downstream split

Design

  • frontend ops now accept optional nosplit and forward it during pto-lower-frontend-pipe-ops
  • new pto-infer-validate-pipe-init module pass runs before memory planning to:
    • infer nosplit=true/false from tpush/tpop/tfree split usage when missing
    • reject split=0 mixed with split=1/2 on the same logical pipe
    • reject explicit nosplit mismatches and peer-pipe conflicts
    • propagate the resolved nosplit across peer init pairs
  • pto-resolve-reserved-buffers is narrowed back to flag-base alignment + reserve/import address materialization
  • EmitC now emits:
    • A3/A2: TPipe<flag, dir, slotSize, slotNum, nosplit, localSlotNum>
    • A5: TPipe<flag, dir, slotSize, slotNum, nosplit>

Testing

  • build: ninja -C build ptoas
  • targeted regressions:
    • test/basic/tpush_tpop_emitc.pto
    • test/basic/tpush_tpop_frontend_lowering_a3.pto
    • test/basic/tpush_tpop_frontend_lowering_a5.pto
    • test/basic/tpush_tpop_frontend_nosplit_a5.pto
    • test/basic/tpush_tpop_frontend_mixed_split_a5.pto
    • test/basic/tpush_tpop_frontend_nosplit_conflict_a5.pto
    • test/basic/resolve_reserved_buffers_reject_incomplete_peer_group_a5.pto
    • test/basic/resolve_reserved_buffers_reject_non_peer_init_a5.pto
  • sample compatibility:
    • ptoas --pto-arch=a5 --enable-insert-sync test/samples/TPushTPop/test3/kernel.pto
    • verified generated C++ still contains TPipe<0, Direction::DIR_BOTH, 1024, 4, true> plus matching TPUSH/TPOP/TFREE for the round-trip path

Risk / Rollback

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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