Preserve typed dispatch preconditions through package and loader contracts
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by reading docs/REFLECTION_JSON_SCHEMA.md and runtime/README.md at the cited compiler revision to understand the current reflection and metadata-only loader contracts. Then trace package verify/inspect and source-free loader plan entry points for the Metal, DirectX, OpenGL, and Vulkan metadata paths. Done means a versioned contract, round-trip coverage, boundary and compatibility tests, and a source-free consumer fixture demonstrate outstanding runtime obligations and rejected invalid payloads.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Repository ports need to carry typed host-metadata preconditions alongside generated kernels. A source-to-target conversion may be legal only when an immutable dispatch scalar, metadata element or record field lies in a checked range. Package admission alone cannot establish that a future caller will supply values in that range.
At compiler dev revision d43047c2a407a9bd1a90f21d1df0dd94507a698d, reflection retains source resource identities, target bindings and layouts, but its versioned schema has no dispatch-value-precondition record. The loader contract is explicitly metadata-only and does not consume actual dispatch values. That boundary is useful and should remain explicit.
Please add a versioned metadata contract that a compiler can emit or preserve and a downstream runtime can enforce. This is not a request to add device execution to the compiler package reader or to treat existing package loadable status as numerical/runtime validation.
Concrete Consumer
CrossGL/crosstl#2179 distinguishes caller-trusted index assertions from runtime-enforced metadata bounds. Its minimal case reads index = indices[0] from a uint64 resource and uses it to address a four-element uint32 resource. A declared [0, 3] assertion currently authorizes index conversion, but the application remains responsible for enforcing it. A runtime-owned dispatch contract needs to reject payloads 4 and 4294967296 before execution, without truncating or clamping them.
The same requirement appears in the MLX port at pin 9c3d35571ac450a8ecf5c17b4d0e3fac52c08bc8: reverse scans compose a row origin, axis size and block offset; GEMM forms batch-stride pointers from metadata. These are integration examples, not repository-specific schema requirements. The contract must work for arbitrary source repositories and target backends.
Requested Contract
- Identify the source entry, resource and optional immutable element/record-field path independently of generated helper names. Connect them to reflected target bindings and physical layout.
- Preserve integer width, signedness, byte offset, element stride and inclusive bounds. Define overflow and unit semantics for composed offset constraints rather than checking independent values whose sum may overflow.
- Distinguish statically proven facts, caller-trusted assertions and requirements that must be checked against actual dispatch values. Metadata presence or a package hash must never promote the latter to an already-enforced fact.
- Bind the contract to the appropriate artifact, entry and layout identities. Inspect/verify and loader plans must retain it and reject malformed, stale or unsupported mandatory contracts with structured diagnostics.
- Let metadata-only loader admission report outstanding runtime obligations without claiming to evaluate host payloads. A consuming runtime must explicitly support and enforce those obligations before dispatch. Unknown obligations must not be silently discarded.
- Mark the supported immutability boundary. A host snapshot must not authorize GPU-produced or subsequently mutated metadata; those require a separate validation strategy.
- Define backward compatibility for packages without the new optional contract and explicit version handling for packages that require it.
Acceptance
- Document and schema-test source identity, scalar/field paths, type/layout information, bound semantics, trust classification and enforcement state.
- Round-trip the contract through reflection or a declared sidecar, package verify/inspect and source-free loader plans on Metal, DirectX, OpenGL and Vulkan metadata paths.
- Test renamed resources, duplicate/unknown identities, type and layout drift, unsupported versions, offset views, negative/oversized boundaries and integer-overflow constraints. Admission must not reinterpret trusted assertions as enforced preconditions.
- Supply a small source-free consumer fixture demonstrating the separation between a valid package contract, a valid dispatch payload and a rejected payload. Device execution need not be implemented in this repository for this contract to be useful.
CrossTL can implement its runtime enforcement independently and align with this schema when available. No compiler release or stable published dependency is required to continue the translator work.
- Ngôn ngữ chính
- C++
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CrossGL/compiler
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Track CrossTL project-porting report and source-remap compatibilityCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Tất cả issue của CrossGL/compiler
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
foxglove/mcap#1907 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
telegramdesktop/tdesktop#31505 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ll-builder shell completions omit existing lockfile commands and --lockedCó thể đã có người làm @project-nju-learner đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
OpenAtom-Linyaps/linyaps#2291 ·
Maintainer thường phản hồi trong vòng 1 ngày