Skip to content

feat(ccu): add core microcode planning - #72

Open
Kur0x wants to merge 3 commits into
mainfrom
codex/ccu-stack-01-core
Open

feat(ccu): add core microcode planning#72
Kur0x wants to merge 3 commits into
mainfrom
codex/ccu-stack-01-core

Conversation

@Kur0x

@Kur0x Kur0x commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • add TileXR-owned CCU runtime task types and ABI constants
  • add microcode, barrier, memory, producer-plan, allocator, and spec layers
  • keep the code independent from communicator and collective-backend behavior

Stack

1 of 9. Base: main.

Validation

  • git diff --check
  • python3 -m unittest tests.ccu.test_tilexr_ccu_barrier_program tests.ccu.test_tilexr_ccu_memory_program tests.ccu.test_tilexr_ccu_microcode tests.ccu.test_tilexr_ccu_producer_plan tests.ccu.test_tilexr_ccu_resource_allocator tests.ccu.test_tilexr_ccu_runtime_boundary tests.ccu.test_tilexr_ccu_specs
  • 48 tests passed

Scope

Host-only validation. No direct CCU data-plane claim.

@Kur0x
Kur0x marked this pull request as ready for review July 28, 2026 06:28
@Kur0x
Kur0x requested a review from a team as a code owner July 28, 2026 06:28

@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: 4a21ed788f

ℹ️ 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 src/comm/ccu/tilexr_ccu_resource_allocator.cpp
Comment thread src/comm/ccu/tilexr_ccu_microcode.cpp Outdated
Comment on lines +199 to +200
if ((spec.ckeId == 0 || spec.mask == 0) && (spec.waitCkeId == 0 || spec.waitMask == 0)) {
return TILEXR_ERROR_PARA_CHECK_FAIL;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject incomplete CKE identifier and mask pairs

When either the set pair or wait pair is complete, this condition accepts a malformed second pair such as ckeId != 0, mask == 0, and the encoder emits that partial operation into the instruction. The transfer encoders already require each ID/mask pair to be either fully present or fully absent; the SetCKE and analogous ClearCKE path should enforce the same rule so malformed synchronization requests cannot produce invalid microcode.

Useful? React with 👍 / 👎.

Comment thread src/comm/ccu/tilexr_ccu_resource_allocator.cpp
Comment thread tests/ccu/test_tilexr_ccu_runtime_boundary.py
Comment thread src/comm/ccu/tilexr_ccu_producer_plan.cpp
Comment thread src/comm/ccu/tilexr_ccu_barrier_program.cpp
Comment on lines +212 to +213
const uint32_t localXnCount = std::max(localSqeXnCount, request.syncResourceCount);
const uint32_t remoteXnCount = request.syncResourceCount;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip XN allocation for CKE-only barrier modes

With no SQE-load task, SyncCke, SyncCkePostOnly, and the local-CKE modes encode no XN operations—the barrier builder explicitly omits XNs from their required resources—yet the allocator still reserves one local and one remote XN per sync resource. A valid CKE-only request can therefore fail with insufficient XN resources despite having enough CKE and channel capacity; derive these counts from barrierMode instead of allocating them unconditionally.

Useful? React with 👍 / 👎.

Comment thread src/comm/ccu/tilexr_ccu_memory_program.cpp
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.

3 participants