vx-lang / vx-lang/Vx

Heterogeneous targets · P1-3: longer Scope ladder + lateral shared_with spaces

Open
#247 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core-lang enhancement
Dominant language
Rust
Stars
14
Forks
2
Avg merge
12h 42m
Merged PRs (30d)
61

Description

P1-3 — Longer Scope ladder and lateral spaces

Scope is Device / Sm / Cta / Thread — pre-Hopper. scope: cluster is a parse error today. B200 needs clusters + DSMEM (a CTA addressing a peer CTA's SMEM); the TPU's VMemShared (cross-subcore) has the same lateral shape. within: is strict containment with capacity checks — neither is nested.

Proposed — extend the ladder + add a lateral facet distinct from within:
// B200: thread block cluster + distributed shared memory
Memory DSMEM {
  within: Memory::L2, capacity: 3648 KB, managed: explicit,
  scope: cluster,                    // NEW level, between sm and device
  shared_with: peers(16)             // NEW: lateral, 16 CTAs address each other
}
// TPU: cross-subcore shared VMEM
Memory VMemShared {
  within: Memory::HBM, capacity: 16 MB, managed: explicit,
  scope: subcore,                    // NEW level, below sm
  shared_with: peers(2)
}

Scope becomes Device | Cluster | Sm | Cta | Subcore | Thread, ordered broadest→narrowest so the existing narrowing check keeps working unchanged.

Diagnostic
E60xx: 'DSMEM' is shared with 16 peers but 'SMEM' (scope: sm) is not;
  a peer-shared space cannot be narrower than the scope it is shared across
Where it lands

src/syntax/decl.rs (Scope, shared_with on MemoryDecl), src/parser/decl.rs (scope match arms), src/hir/memory.rs (narrowing + peer coherence).


From the Heterogeneous Target Gap Analysis (§9). Status tracked there and in the P0 decision log. Sibling to the landed P0 work (P0-1 fa056b4e, P0-3 33ce0b64, P0-4 5e10637a, P1-4a-core 34b31902).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read §9 of docs/discussions/heterogeneous_target_gap_analysis.md and the P0 decision log first. Then inspect Scope and shared_with in src/syntax/decl.rs, scope parsing in src/parser/decl.rs, and narrowing and peer coherence in src/hir/memory.rs. Done means the new scope levels parse and preserve ordering, lateral peer sharing is distinct from within:, and the stated coherence diagnostic is enforced.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.