[REFACTOR][TVMScript] Simplify annotation capture and transpiler contexts - #20447
Merged
Merged
Conversation
tlopex
approved these changes
Sep 25, 2026
Name shared translation inputs and generated helpers by their roles. Capture definition values through original-name helper defaults while preserving lazy annotation reads and source body scopes. Resolve construction through qualified definition-site decorators and retain evaluated root options. Document public capture and JIT helper contracts.
Retain registered function and macro namespaces for deferred source reconstruction without retaining owners of unrelated Python decorators. Document construction syntax and source-inspection errors.
Use const_args for the fixed parameter map and its generated binding while preserving scoped JIT selection and specialization caching. Keep constexpr argument validation beside the transpiler parameter construction that consumes it.
Place constexpr argument checks and optional annotation unwrapping beside generated parameter construction. Keep scoped fixed-argument transport in jit_support and document both private runtime helper contracts.
Parse indented definitions inside a temporary AST suite so continuation lines and multiline literals retain their original whitespace. Remove the synthetic suite and restore source line coordinates for both parsed nodes and syntax errors.
tqchen
force-pushed
the
script/transpiler-context
branch
from
September 25, 2026 11:38
b2a4720 to
1ccc335
Compare
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.
Simplify annotation construction around explicit function-header generics and concrete
I.dynamic/T.dynamicvalues. Remove captured runtimetyping.TypeVaradaptation, per-read annotation guards, and their obsolete bookkeeping while preserving definition-site scope, shadowing, and symbol identity.Clarify shared transpiler inputs and generated body metadata, and capture definition values through original-name helper defaults while preserving lazy annotations, declaration timing, globals, and closures.
Resolve function construction through qualified definition-site decorators and preserve already-evaluated root options. Name fixed JIT arguments
const_args, keep parameter construction helpers private to the transpiler, and document context consumers and helper contracts.