[Refact] Rename JitArgument & DslType interfaces, support SimpleNamespace as DslType#478
Merged
[Refact] Rename JitArgument & DslType interfaces, support SimpleNamespace as DslType#478
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors FlyDSL’s Python-side type/argument protocols by renaming the __fly_* dunder methods and the fly_* helper functions, and extends the protocol layer to treat types.SimpleNamespace as a composite DSL value (flattening/reconstruction of IR values/types/pointers).
Changes:
- Renames DslType/JitArgument protocol methods to
__extract_to_ir_values__/__construct_from_ir_values__and__get_ir_types__/__get_c_pointers__, and updates core compiler call sites accordingly. - Adds
SimpleNamespacesupport incompiler/protocol.pyfor flattening (get_ir_types,get_c_pointers,extract_to_ir_values) and reconstruction (construct_from_ir_values). - Updates/introduces tests and documentation to reflect the renamed protocol surface and validates
SimpleNamespacebuilt inside@flyc.jit.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_vector.py | Updates protocol roundtrip test to new __extract_to_ir_values__ / __construct_from_ir_values__ names. |
| tests/unit/test_simple_namespace.py | Adds a GPU test validating SimpleNamespace created inside @flyc.jit can be passed to a kernel. |
| tests/kernels/test_flydsl_shmem.py | Updates helper unwrapping to use __extract_to_ir_values__. |
| python/flydsl/expr/typing.py | Renames DslType-related dunder methods on IR wrapper types; removes old construct hook. |
| python/flydsl/expr/numeric.py | Renames protocol methods for Numeric types and updates wrapping/unwrapping helpers; adds log_width. |
| python/flydsl/expr/meta.py | Updates primitive arg unwrapping to the new extraction dunder. |
| python/flydsl/expr/extern.py | Updates FFI argument unwrapping to the new extraction dunder. |
| python/flydsl/compiler/protocol.py | Introduces new helper names and adds SimpleNamespace flatten/rebuild support. |
| python/flydsl/compiler/kernel_function.py | Switches kernel emission/launch plumbing to the renamed protocol helpers. |
| python/flydsl/compiler/jit_function.py | Switches JIT argument typing/caching and DSL arg reconstruction to renamed protocol helpers. |
| python/flydsl/compiler/jit_executor.py | Switches runtime pointer extraction helper; minor error message formatting cleanup. |
| python/flydsl/compiler/jit_argument.py | Updates protocol detection to new dunder names; minor formatting/quoting tweaks. |
| docs/layout_system_guide.md | Updates documentation references to the renamed extraction dunder. |
| docs/kernel_authoring_guide.md | Updates custom adaptor documentation to the renamed JitArgument dunders. |
| docs/architecture_guide.md | Updates protocol/API references and file map entry to the new names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
coderfeli
previously approved these changes
May 8, 2026
9a696e8 to
078ff3a
Compare
coderfeli
approved these changes
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…pace as DslType
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist