You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2026/10/01 12:16:24 UTC

(tvm) branch tqchen/printer-doc-translation updated (9a082e1eb4 -> 3d73d4524d)

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch tqchen/printer-doc-translation
in repository https://gitbox.apache.org/repos/asf/tvm.git


    from 9a082e1eb4 [REFACTOR][Script] Replace docsifier with typed Doc translation
     new 1849c01ccf [REFACTOR][Script] Simplify native translation and type construction
     new b2b513f966 [REFACTOR][Script] Use the value builder in buffer value fixtures
     new 3d73d4524d [FIX][Script] Reserve configured module names before metadata names

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CMakeLists.txt                                     |   2 +-
 docs/arch/tvmscript.rst                            |   5 +
 include/tvm/ir/expr.h                              |   4 +-
 include/tvm/ir/op.h                                |   6 +
 include/tvm/script/printer/config.h                |  12 +-
 include/tvm/script/printer/doc_translator.h        |  21 +-
 include/tvm/script/printer/printer.h               |  34 +-
 python/tvm/backend/cuda/ptx/engine.py              |   6 +-
 python/tvm/ir/expr.py                              |   4 +-
 python/tvm/relax/base_py_module.py                 |   2 -
 python/tvm/runtime/script_printer.py               |  17 +-
 python/tvm/tirx/script/ir_builder/ir.py            |  87 +++-
 src/backend/cuda/codegen/codegen_cuda.cc           |  14 +-
 src/backend/cuda/codegen/intrin_rule_cuda.cc       |  42 +-
 src/backend/cuda/op/iket.cc                        |  12 +-
 src/backend/cuda/op/target_builtin.cc              | 247 +----------
 src/backend/metal/codegen/intrin_rule_metal.cc     |  28 --
 src/backend/webgpu/codegen/intrin_rule_webgpu.cc   |  30 --
 src/ir/expr.cc                                     |   4 +
 src/ir/prim/builtin.cc                             |   5 +-
 src/relax/script/printer/binding.cc                |  94 ++--
 src/relax/script/printer/call.cc                   |  39 +-
 src/relax/script/printer/dependent_type.cc         |  35 +-
 src/relax/script/printer/distributed.cc            |  18 +-
 src/relax/script/printer/expr.cc                   |  25 +-
 src/relax/script/printer/function.cc               |  25 +-
 src/relax/script/printer/global_info.cc            |  32 +-
 src/relax/script/printer/region.cc                 |  23 +-
 src/relax/script/printer/type.cc                   |   6 +-
 src/script/printer/config.cc                       |  11 +-
 src/script/printer/dialect_prefix.h                |   5 +
 src/script/printer/doc_printer.cc                  |  18 +-
 src/script/printer/doc_translator.cc               | 486 +++------------------
 src/script/printer/ir/ir.cc                        |  43 +-
 src/script/printer/ir/misc.cc                      |  20 +-
 src/script/printer/ir/prim_expr.cc                 | 132 +++---
 src/script/printer/ir/prim_type.cc                 |  69 ++-
 src/script/printer/ir/utils.cc                     |  68 +--
 src/script/printer/{entry.cc => printer.cc}        |  51 +--
 src/script/printer/script_printer.cc               |   3 +-
 src/tirx/op/builtin.cc                             | 102 +----
 src/tirx/op/op.cc                                  |  20 -
 src/tirx/script/ir_builder/ir.cc                   |  33 +-
 src/tirx/script/printer/block.cc                   |  32 +-
 src/tirx/script/printer/buffer.cc                  |  63 +--
 src/tirx/script/printer/expr.cc                    | 107 +++--
 src/tirx/script/printer/for_loop.cc                |   6 +-
 src/tirx/script/printer/function.cc                |  23 +-
 src/tirx/script/printer/ir.cc                      |  12 +-
 src/tirx/script/printer/stmt.cc                    |  80 ++--
 src/tirx/script/printer/utils.h                    |   4 +-
 .../s_tir/script/test_s_tir_script_ir_builder.py   |   6 +-
 .../s_tir/script/test_s_tir_script_printer.py      |  59 +--
 .../transform/test_s_tir_transform_thread_sync.py  |   2 +-
 .../tirx/script/test_tirx_script_basic_usage.py    |   4 +-
 .../tirx/script/test_tirx_script_ir_builder.py     |   4 +-
 .../script/test_tirx_script_source_locations.py    |   4 +-
 57 files changed, 743 insertions(+), 1603 deletions(-)
 rename src/script/printer/{entry.cc => printer.cc} (84%)


(tvm) 02/03: [REFACTOR][Script] Use the value builder in buffer value fixtures

Posted by tq...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch tqchen/printer-doc-translation
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit b2b513f9665da702e4f1dd89ad4c78148a2375ce
Author: Tianqi Chen <tq...@users.noreply.github.com>
AuthorDate: Thu Oct 1 03:44:50 2026 +0000

    [REFACTOR][Script] Use the value builder in buffer value fixtures
---
 tests/python/s_tir/script/test_s_tir_script_ir_builder.py        | 6 +++---
 tests/python/s_tir/script/test_s_tir_script_printer.py           | 8 ++++----
 tests/python/s_tir/transform/test_s_tir_transform_thread_sync.py | 2 +-
 tests/python/tirx/script/test_tirx_script_basic_usage.py         | 4 ++--
 tests/python/tirx/script/test_tirx_script_ir_builder.py          | 4 ++--
 tests/python/tirx/script/test_tirx_script_source_locations.py    | 4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/tests/python/s_tir/script/test_s_tir_script_ir_builder.py b/tests/python/s_tir/script/test_s_tir_script_ir_builder.py
index d57c4f9f7f..43195e6c98 100644
--- a/tests/python/s_tir/script/test_s_tir_script_ir_builder.py
+++ b/tests/python/s_tir/script/test_s_tir_script_ir_builder.py
@@ -138,10 +138,10 @@ def test_ir_builder_tir_block_base():
 def test_ir_builder_tir_block_complete():
     with IRBuilder() as ib:
         a = T.int64()
-        b = T.Buffer((128, 128), "float32")
-        c = T.Buffer((128, 128), "float32")
+        b = T.buffer((128, 128), "float32")
+        c = T.buffer((128, 128), "float32")
         d = T.int32()
-        e = T.Buffer((128, 128), "float32")
+        e = T.buffer((128, 128), "float32")
         f = T.int32()
         with Ts.sblock("block"):
             Ts.where(a > 1)
diff --git a/tests/python/s_tir/script/test_s_tir_script_printer.py b/tests/python/s_tir/script/test_s_tir_script_printer.py
index 67827a68a1..7f10971818 100644
--- a/tests/python/s_tir/script/test_s_tir_script_printer.py
+++ b/tests/python/s_tir/script/test_s_tir_script_printer.py
@@ -1399,10 +1399,10 @@ def multiple_commreducer():
     # normal_reduce_temp0 is treated as uninitialized value
     @Ts.prim_func(check_well_formed=False)
     def multiple_commreducer() -> None:
-        normal_reduce_temp0 = T.Buffer([1], dtype="float32", strides=[1], scope="local")
-        normal_reduce_temp1 = T.Buffer([1], dtype="float32", strides=[1], scope="local")
-        reduce_temp0 = T.Buffer([1], dtype="float32", strides=[1], scope="local")
-        reduce_temp1 = T.Buffer([1], dtype="float32", strides=[1], scope="local")
+        normal_reduce_temp0 = T.buffer([1], dtype="float32", strides=[1], scope="local")
+        normal_reduce_temp1 = T.buffer([1], dtype="float32", strides=[1], scope="local")
+        reduce_temp0 = T.buffer([1], dtype="float32", strides=[1], scope="local")
+        reduce_temp1 = T.buffer([1], dtype="float32", strides=[1], scope="local")
         for ax0_1 in T.thread_binding(0, 32, thread="threadIdx.x"):
             with Ts.sblock("T_softmax_maxelem_cross_thread_reduction"):
                 T.attr(
diff --git a/tests/python/s_tir/transform/test_s_tir_transform_thread_sync.py b/tests/python/s_tir/transform/test_s_tir_transform_thread_sync.py
index d1d5469437..93587b8022 100644
--- a/tests/python/s_tir/transform/test_s_tir_transform_thread_sync.py
+++ b/tests/python/s_tir/transform/test_s_tir_transform_thread_sync.py
@@ -45,7 +45,7 @@ def test_sync_read_thread_id_independent_location():
     def func(p0_arg: T.Buffer((1, 2, 1, 1), "float32"), p1: T.Buffer(2, "float32")) -> None:
         threadIdx_x = T.env_thread("threadIdx.x")
         blockIdx_x = T.env_thread("blockIdx.x")
-        p0 = T.Buffer([2], dtype="float32", data=p0_arg.data)
+        p0 = T.buffer([2], dtype="float32", data=p0_arg.data)
         result_local = Ts.sblock_alloc_buffer([1], dtype="float32", scope="local")
         temp_shared = Ts.sblock_alloc_buffer([1], dtype="float32", scope="shared")
         T.launch_thread(blockIdx_x, 8)
diff --git a/tests/python/tirx/script/test_tirx_script_basic_usage.py b/tests/python/tirx/script/test_tirx_script_basic_usage.py
index 351799fd14..d9910eb366 100644
--- a/tests/python/tirx/script/test_tirx_script_basic_usage.py
+++ b/tests/python/tirx/script/test_tirx_script_basic_usage.py
@@ -58,14 +58,14 @@ def test_native_concise_scopes_unwind_with_their_parent():
 def test_tir_buffer_annotation():
     buffer_0 = T.Buffer((128, 128), "float32")
     assert (
-        tirx.is_buffer_var(buffer_0)
+        isinstance(buffer_0, tirx.BufferType)
         and list(buffer_0.shape) == [128, 128]
         and buffer_0.dtype == ir.PrimType("float32")
     )
 
     buffer_1 = T.Buffer((64, 64, 64), "int32")
     assert (
-        tirx.is_buffer_var(buffer_1)
+        isinstance(buffer_1, tirx.BufferType)
         and list(buffer_1.shape) == [64, 64, 64]
         and buffer_1.dtype == ir.PrimType("int32")
     )
diff --git a/tests/python/tirx/script/test_tirx_script_ir_builder.py b/tests/python/tirx/script/test_tirx_script_ir_builder.py
index dfc75f4f73..fc6e80de6c 100644
--- a/tests/python/tirx/script/test_tirx_script_ir_builder.py
+++ b/tests/python/tirx/script/test_tirx_script_ir_builder.py
@@ -194,7 +194,7 @@ def test_ir_builder_tir_if_then_else():
 
 
 def test_ir_builder_tir_buffer_store():
-    buffer_a = T.Buffer((10, 10), "float32")
+    buffer_a = T.buffer((10, 10), "float32")
     i = T.int32()
     with IRBuilder() as ib:
         T.buffer_store(buffer_a, 0.1, [0, i])
@@ -210,7 +210,7 @@ def test_ir_builder_tir_buffer_store():
 
 
 def test_ir_builder_tir_buffer_store_scalable_vec():
-    buffer_a = T.Buffer((30,), "float32")
+    buffer_a = T.buffer((30,), "float32")
     value = T.broadcast(0.11, 4 * tvm.tirx.vscale())
     index = T.ramp(0, 1, 4 * tvm.tirx.vscale())
 
diff --git a/tests/python/tirx/script/test_tirx_script_source_locations.py b/tests/python/tirx/script/test_tirx_script_source_locations.py
index 297a8c52c2..87cec0809c 100644
--- a/tests/python/tirx/script/test_tirx_script_source_locations.py
+++ b/tests/python/tirx/script/test_tirx_script_source_locations.py
@@ -246,7 +246,7 @@ def test_native_view_keeps_producer_identity_name_and_span(monkeypatch):
     from tvm import ir, tirx
     from tvm.script.ir_builder import base
 
-    captured = T.Buffer((4, 4), "float32")
+    captured = T.buffer((4, 4), "float32")
     original = type(captured).view
     seen, produced, observed = [], [], []
     span = ir.Span(ir.SourceName("producer.py"), 7, 7, 2, 19)
@@ -299,7 +299,7 @@ def test_native_binding_preserves_metadata_but_binds_buffer_expressions():
     from tvm.script.ir_builder import base
 
     producer_span = ir.Span(ir.SourceName("producer.py"), 7, 7, 2, 19)
-    buffer = T.Buffer((4,), "float32")
+    buffer = T.buffer((4,), "float32")
     base.at_(producer_span, buffer)
     layout = T.TileLayout(T.S[4])
 


(tvm) 03/03: [FIX][Script] Reserve configured module names before metadata names

Posted by tq...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch tqchen/printer-doc-translation
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 3d73d4524d3342d8a06e54b7e098fc178a8d0bc9
Author: Tianqi Chen <tq...@users.noreply.github.com>
AuthorDate: Thu Oct 1 03:58:05 2026 +0000

    [FIX][Script] Reserve configured module names before metadata names
---
 src/script/printer/doc_translator.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/script/printer/doc_translator.cc b/src/script/printer/doc_translator.cc
index 8fbeef3e12..b28fdca671 100644
--- a/src/script/printer/doc_translator.cc
+++ b/src/script/printer/doc_translator.cc
@@ -157,6 +157,12 @@ details::TranslationResult TranslateComplete(ffi::AnyView obj, TranslationEngine
       engine->AllocId(value.cast<ffi::String>());
   }
   for (const ffi::String& name : binding_names) engine->AllocId(name);
+  if (binding_names.empty()) {
+    if (auto name = engine->GetExtraConfig<ffi::Optional<ffi::String>>("script.module_name",
+                                                                       std::nullopt)) {
+      engine->AllocId(name.value());
+    }
+  }
   // Allocate generated names after all configured names. A dialect or module
   // named tvm/metadata must not shadow the loader or metadata registry.
   IdDoc metadata_id = engine->AllocId("metadata");


(tvm) 01/03: [REFACTOR][Script] Simplify native translation and type construction

Posted by tq...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch tqchen/printer-doc-translation
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 1849c01ccfc9663d5a30c1ae239ca86ba475e3b1
Author: Tianqi Chen <tq...@users.noreply.github.com>
AuthorDate: Thu Oct 1 03:44:50 2026 +0000

    [REFACTOR][Script] Simplify native translation and type construction
    
    Keep variable mappings stable within naming regions and preserve unresolved
    captures in their enclosing scope. Use native hooks for declarations and
    existing origins for generic path recovery.
    
    Keep prefix handling extensible through the existing registry, move script
    entry declarations to their owning header, and separate buffer type syntax
    from the existing value builder. Remove obsolete address display state.
    
    Use fixed result attributes instead of constant inference callbacks and
    retain upstream validation without adding backend operand checks.
---
 CMakeLists.txt                                     |   2 +-
 docs/arch/tvmscript.rst                            |   5 +
 include/tvm/ir/expr.h                              |   4 +-
 include/tvm/ir/op.h                                |   6 +
 include/tvm/script/printer/config.h                |  12 +-
 include/tvm/script/printer/doc_translator.h        |  21 +-
 include/tvm/script/printer/printer.h               |  34 +-
 python/tvm/backend/cuda/ptx/engine.py              |   6 +-
 python/tvm/ir/expr.py                              |   4 +-
 python/tvm/relax/base_py_module.py                 |   2 -
 python/tvm/runtime/script_printer.py               |  17 +-
 python/tvm/tirx/script/ir_builder/ir.py            |  87 +++-
 src/backend/cuda/codegen/codegen_cuda.cc           |  14 +-
 src/backend/cuda/codegen/intrin_rule_cuda.cc       |  42 +-
 src/backend/cuda/op/iket.cc                        |  12 +-
 src/backend/cuda/op/target_builtin.cc              | 247 +----------
 src/backend/metal/codegen/intrin_rule_metal.cc     |  28 --
 src/backend/webgpu/codegen/intrin_rule_webgpu.cc   |  30 --
 src/ir/expr.cc                                     |   4 +
 src/ir/prim/builtin.cc                             |   5 +-
 src/relax/script/printer/binding.cc                |  94 ++--
 src/relax/script/printer/call.cc                   |  39 +-
 src/relax/script/printer/dependent_type.cc         |  35 +-
 src/relax/script/printer/distributed.cc            |  18 +-
 src/relax/script/printer/expr.cc                   |  25 +-
 src/relax/script/printer/function.cc               |  25 +-
 src/relax/script/printer/global_info.cc            |  32 +-
 src/relax/script/printer/region.cc                 |  23 +-
 src/relax/script/printer/type.cc                   |   6 +-
 src/script/printer/config.cc                       |  11 +-
 src/script/printer/dialect_prefix.h                |   5 +
 src/script/printer/doc_printer.cc                  |  18 +-
 src/script/printer/doc_translator.cc               | 482 +++------------------
 src/script/printer/ir/ir.cc                        |  43 +-
 src/script/printer/ir/misc.cc                      |  20 +-
 src/script/printer/ir/prim_expr.cc                 | 132 +++---
 src/script/printer/ir/prim_type.cc                 |  69 ++-
 src/script/printer/ir/utils.cc                     |  68 +--
 src/script/printer/{entry.cc => printer.cc}        |  51 +--
 src/script/printer/script_printer.cc               |   3 +-
 src/tirx/op/builtin.cc                             | 102 +----
 src/tirx/op/op.cc                                  |  20 -
 src/tirx/script/ir_builder/ir.cc                   |  33 +-
 src/tirx/script/printer/block.cc                   |  32 +-
 src/tirx/script/printer/buffer.cc                  |  63 +--
 src/tirx/script/printer/expr.cc                    | 107 +++--
 src/tirx/script/printer/for_loop.cc                |   6 +-
 src/tirx/script/printer/function.cc                |  23 +-
 src/tirx/script/printer/ir.cc                      |  12 +-
 src/tirx/script/printer/stmt.cc                    |  80 ++--
 src/tirx/script/printer/utils.h                    |   4 +-
 .../s_tir/script/test_s_tir_script_printer.py      |  51 ---
 52 files changed, 724 insertions(+), 1590 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80d058ca86..58a296f469 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -317,7 +317,7 @@ tvm_file_glob(GLOB_RECURSE COMPILER_SRCS
     src/script/printer/ir/misc.cc
     src/script/printer/ir/prim_type.cc
     src/script/printer/ir/prim_expr.cc
-    src/script/printer/entry.cc
+    src/script/printer/printer.cc
     src/script/printer/doc_printer.cc
     src/script/printer/script_printer.cc
     src/relax/ir/*.cc
diff --git a/docs/arch/tvmscript.rst b/docs/arch/tvmscript.rst
index 4f703d8be2..d7d64fb3d2 100644
--- a/docs/arch/tvmscript.rst
+++ b/docs/arch/tvmscript.rst
@@ -146,6 +146,11 @@ paths; the private Doc printer formats the tree, annotations and underlines as P
 text. Printer configuration stays read-only throughout. ``DocToPythonScript`` also
 formats an existing Doc directly. This tree is separate from the parser's Python AST.
 
+The public ``Script`` text entry points are declared in
+``tvm/script/printer/printer.h``. Their orchestration and diagnostic path mapping
+live in ``src/script/printer/printer.cc``; ``doc_translator.h`` exposes the
+IR-to-Doc translation protocol.
+
 For example, a small function can be authored, printed and parsed again:
 
 .. code-block:: python
diff --git a/include/tvm/ir/expr.h b/include/tvm/ir/expr.h
index d30833e8a6..a597cfe0a8 100644
--- a/include/tvm/ir/expr.h
+++ b/include/tvm/ir/expr.h
@@ -519,8 +519,8 @@ class Call : public Expr {
   /*! \brief Recompute a result type from the Call's current explicit inputs.
    *
    * This ignores the Call's stored result type and does not mutate the Call.
-   * A context-free inference hook must be registered for the operator. Missing
-   * or invalid inputs are reported by the hook rather than screened here.
+   * The operator must register TFixedReturnType or a context-free FInferType hook.
+   * This does not invoke the operator's validator.
    */
   TVM_DLL static Type ReinferType(const CallNode* call);
 
diff --git a/include/tvm/ir/op.h b/include/tvm/ir/op.h
index 403541a104..dcb985b882 100644
--- a/include/tvm/ir/op.h
+++ b/include/tvm/ir/op.h
@@ -43,6 +43,12 @@ namespace tvm {
 template <typename>
 class OpAttrMap;
 
+/*!
+ * \brief An operator's result type independent of operands, attributes, and type arguments.
+ * When present, this concrete type takes precedence over FInferType.
+ */
+using TFixedReturnType = Type;
+
 /*! \brief Infer a Call's result type from its explicit inputs without builder state. */
 using FInferType = ffi::reflection::NativeFunctionView<Type(const CallNode* call)>;
 
diff --git a/include/tvm/script/printer/config.h b/include/tvm/script/printer/config.h
index 6057e23f14..e770de90f1 100644
--- a/include/tvm/script/printer/config.h
+++ b/include/tvm/script/printer/config.h
@@ -21,8 +21,8 @@
  * \brief Configuration object for the TVMScript printer.
  *
  * Contains PrinterConfig / PrinterConfigNode, GetBuiltinKeywords, GetExtraConfig,
- * and RedirectedReprPrinterMethod. The translation entry points live in
- * doc_translator.h.
+ * and RedirectedReprPrinterMethod. Translation APIs live in doc_translator.h,
+ * and text entry points live in printer.h.
  */
 #ifndef TVM_SCRIPT_PRINTER_CONFIG_H_
 #define TVM_SCRIPT_PRINTER_CONFIG_H_
@@ -49,11 +49,10 @@ class PrinterConfigNode : public ffi::Object {
   /*! \brief The prefix of IR nodes */
   ffi::String ir_prefix = "I";
   /*!
-   * \brief The alias of the current module at cross-function call
-   * \note Directly use module name if it's empty.
+   * \brief Compatibility option; global references use the actual module name.
    */
   ffi::String module_alias = "cls";
-  /*! \brief Default buffer dtype */
+  /*! \brief Compatibility option; buffer hooks print the actual dtype. */
   DLDataType buffer_dtype = DLDataType{kDLFloat, 32, 1};
   /*! \brief Whether or not to verbose print expressions. */
   bool verbose_expr = false;
@@ -65,8 +64,6 @@ class PrinterConfigNode : public ffi::Object {
   int num_context_lines = -1;
   /*! \brief Whether to output with syntax sugar, set false for complete printing. */
   bool syntax_sugar = true;
-  /*! \brief Whether variable names should include the object's address */
-  bool show_object_address = false;
 
   /*! \brief Whether to render access-path context for invisible underlined paths. Defaults true. */
   bool render_invisible_path_info = true;
@@ -118,7 +115,6 @@ class PrinterConfigNode : public ffi::Object {
         .def_ro("print_line_numbers", &PrinterConfigNode::print_line_numbers)
         .def_ro("num_context_lines", &PrinterConfigNode::num_context_lines)
         .def_ro("syntax_sugar", &PrinterConfigNode::syntax_sugar)
-        .def_ro("show_object_address", &PrinterConfigNode::show_object_address)
         .def_ro("render_invisible_path_info", &PrinterConfigNode::render_invisible_path_info)
         .def_ro("path_to_underline", &PrinterConfigNode::path_to_underline)
         .def_ro("path_to_annotate", &PrinterConfigNode::path_to_annotate)
diff --git a/include/tvm/script/printer/doc_translator.h b/include/tvm/script/printer/doc_translator.h
index da97b67960..554338ae0c 100644
--- a/include/tvm/script/printer/doc_translator.h
+++ b/include/tvm/script/printer/doc_translator.h
@@ -31,15 +31,6 @@
 
 namespace tvm {
 
-/*!
- * \brief Print an IR object as TVMScript, using repr when no translation hook exists.
- * \param node The input IR object.
- * \param config Optional translation and rendering configuration.
- * \return The rendered script or fallback representation.
- */
-TVM_DLL std::string Script(const ffi::ObjectRef& node,
-                           const ffi::Optional<PrinterConfig>& config = std::nullopt);
-
 namespace script {
 namespace printer {
 
@@ -251,7 +242,10 @@ class DocTranslatorObj : public ffi::Object {
     ffi::details::ExpectedUnsafe::MoveFromTVMFFIAny<void>(vtable_->begin_var_scope(this)).value();
   }
   /*!
-   * \brief End the latest lexical variable scope, retaining the root scope.
+   * \brief End the latest naming region, retaining the root region.
+   * Explicit local bindings expire. Unresolved implicit references and their
+   * identifiers remain pending in the enclosing region, preserving captures
+   * shared by sibling functions.
    */
   void EndVarScope() {
     ffi::details::ExpectedUnsafe::MoveFromTVMFFIAny<void>(vtable_->end_var_scope(this)).value();
@@ -426,13 +420,6 @@ class DocTranslator : public ffi::ObjectRef {
  */
 TVM_DLL Doc DocTranslate(ffi::AnyView ir, ffi::Dict<Doc, ffi::ObjectRef>* doc_origins = nullptr,
                          ffi::Map<ffi::String, ffi::Any> extra_config = {});
-/*!
- * \brief Translate IR, recover diagnostic paths, and render Python text.
- * \param obj The input IR object.
- * \param config The translation and rendering options.
- * \return The rendered script.
- */
-TVM_DLL ffi::String Script(const ffi::ObjectRef& obj, const PrinterConfig& config);
 
 }  // namespace printer
 }  // namespace script
diff --git a/include/tvm/script/printer/printer.h b/include/tvm/script/printer/printer.h
index bab8adca96..83f313013b 100644
--- a/include/tvm/script/printer/printer.h
+++ b/include/tvm/script/printer/printer.h
@@ -18,11 +18,41 @@
  */
 /*!
  * \file tvm/script/printer/printer.h
- * \brief Compatibility include for the TVMScript translation entry points.
+ * \brief TVMScript text entry points.
  */
 #ifndef TVM_SCRIPT_PRINTER_PRINTER_H_
 #define TVM_SCRIPT_PRINTER_PRINTER_H_
 
-#include <tvm/script/printer/doc_translator.h>
+#include <tvm/ffi/optional.h>
+#include <tvm/script/printer/config.h>
+
+#include <optional>
+#include <string>
+
+namespace tvm {
+
+/*!
+ * \brief Print an IR object as TVMScript, using repr when no translation hook exists.
+ * \param node The input IR object.
+ * \param config Optional translation and rendering configuration.
+ * \return The rendered script or fallback representation.
+ */
+TVM_DLL std::string Script(const ffi::ObjectRef& node,
+                           const ffi::Optional<PrinterConfig>& config = std::nullopt);
+
+namespace script {
+namespace printer {
+
+/*!
+ * \brief Translate IR, recover diagnostic paths, and render Python text.
+ * \param obj The input IR object.
+ * \param config The translation and rendering options.
+ * \return The rendered script.
+ */
+TVM_DLL ffi::String Script(const ffi::ObjectRef& obj, const PrinterConfig& config);
+
+}  // namespace printer
+}  // namespace script
+}  // namespace tvm
 
 #endif  // TVM_SCRIPT_PRINTER_PRINTER_H_
diff --git a/python/tvm/backend/cuda/ptx/engine.py b/python/tvm/backend/cuda/ptx/engine.py
index c59ec064d1..957081c384 100644
--- a/python/tvm/backend/cuda/ptx/engine.py
+++ b/python/tvm/backend/cuda/ptx/engine.py
@@ -108,7 +108,7 @@ def register_table(table: dict[str, InstructionEntry]) -> None:
         register_op_attr(entry.op_name, "TScriptPrinterName", f"ptx.{family}")
         register_op_attr(entry.op_name, "TIRxOpCategory", "device_intrin")
         register_op_attr(entry.op_name, "TDeviceIntrinsicNamespace", "ptx")
-        register_op_attr(entry.op_name, "FInferType", _infer_void_type)
+        register_op_attr(entry.op_name, "TFixedReturnType", PrimType("void"))
         register_codegen(f"ptx.{entry.name}")(_make_codegen(entry))
 
 
@@ -136,10 +136,6 @@ def _infer_addr_type(call):
     return call.args[0].ty
 
 
-def _infer_void_type(_call):
-    return PrimType("void")
-
-
 # ---------------------------------------------------------------------------
 # Codegen (compile time): table -> asm volatile helper
 # ---------------------------------------------------------------------------
diff --git a/python/tvm/ir/expr.py b/python/tvm/ir/expr.py
index 6129ea8c50..9c261c38c3 100644
--- a/python/tvm/ir/expr.py
+++ b/python/tvm/ir/expr.py
@@ -596,8 +596,8 @@ class Call(_CallableExprWithOp):
 def reinfer_type(call: Call) -> "tvm.ir.Type":
     """Derive a Call's result type from its current inputs without changing the Call.
 
-    The operator must have a context-free inference rule. Invalid inputs and
-    missing rules raise errors.
+    The operator must register a fixed return type or a context-free inference
+    rule. This does not invoke the operator's validator.
     """
     return _ffi_api.reinfer_type(call)
 
diff --git a/python/tvm/relax/base_py_module.py b/python/tvm/relax/base_py_module.py
index f1acdeb169..0db6a57659 100644
--- a/python/tvm/relax/base_py_module.py
+++ b/python/tvm/relax/base_py_module.py
@@ -549,7 +549,6 @@ class BasePyModule:
         print_line_numbers: bool = False,
         num_context_lines: int = -1,
         syntax_sugar: bool = True,
-        show_object_address: bool = False,
         show_all_ty: bool = True,
         extra_config: dict | None = None,
     ) -> str:
@@ -571,7 +570,6 @@ class BasePyModule:
             print_line_numbers=print_line_numbers,
             num_context_lines=num_context_lines,
             syntax_sugar=syntax_sugar,
-            show_object_address=show_object_address,
             show_all_ty=show_all_ty,
             extra_config=extra_config,
         )
diff --git a/python/tvm/runtime/script_printer.py b/python/tvm/runtime/script_printer.py
index af52b987b5..45874a8e49 100644
--- a/python/tvm/runtime/script_printer.py
+++ b/python/tvm/runtime/script_printer.py
@@ -33,7 +33,7 @@ class PrinterConfig(Object):
     """Configuration of TVMScript printer.
 
     The ``int_dtype`` and ``float_dtype`` arguments populate the string-valued
-    ``script.int_dtype`` and ``script.float_dtype`` entries in ``extra_config``.
+    ``ir.int_dtype`` and ``script.float_dtype`` entries in ``extra_config``.
     Explicit entries in ``extra_config`` override those arguments.
     """
 
@@ -47,7 +47,6 @@ class PrinterConfig(Object):
     print_line_numbers: bool
     num_context_lines: int
     syntax_sugar: bool
-    show_object_address: bool
     extra_config: dict
     path_to_underline: list[AccessPath] | None
     path_to_annotate: dict[AccessPath, str] | None
@@ -69,7 +68,6 @@ class PrinterConfig(Object):
         print_line_numbers: bool = False,
         num_context_lines: int | None = None,
         syntax_sugar: bool = True,
-        show_object_address: bool = False,
         show_all_ty: bool = True,
         extra_config: dict | None = None,
         path_to_underline: list[AccessPath] | None = None,
@@ -84,14 +82,13 @@ class PrinterConfig(Object):
             "ir_prefix": ir_prefix,
             "module_alias": module_alias,
             "buffer_dtype": buffer_dtype,
-            "script.int_dtype": int_dtype,
+            "ir.int_dtype": int_dtype,
             "script.float_dtype": float_dtype,
             "verbose_expr": verbose_expr,
             "indent_spaces": indent_spaces,
             "print_line_numbers": print_line_numbers,
             "num_context_lines": num_context_lines,
             "syntax_sugar": syntax_sugar,
-            "show_object_address": show_object_address,
             "path_to_underline": path_to_underline,
             "path_to_annotate": path_to_annotate,
             "obj_to_underline": obj_to_underline,
@@ -136,7 +133,6 @@ class Scriptable:
         print_line_numbers: bool = False,
         num_context_lines: int = -1,
         syntax_sugar: bool = True,
-        show_object_address: bool = False,
         show_all_ty: bool = True,
         extra_config: dict | None = None,
         path_to_underline: list[AccessPath] | None = None,
@@ -170,8 +166,6 @@ class Scriptable:
             The number of lines of context to print before and after the line to underline.
         syntax_sugar: bool = True
             Whether to output with syntax sugar, set false for complete printing.
-        show_object_address: bool = False
-            Whether to include the object's address as part of the TVMScript name
         show_all_ty: bool = True
             If True (default), annotate all variable bindings with the struct
             info of that variable.  If False, only add annotations where
@@ -250,7 +244,6 @@ class Scriptable:
                 print_line_numbers=print_line_numbers,
                 num_context_lines=num_context_lines,
                 syntax_sugar=syntax_sugar,
-                show_object_address=show_object_address,
                 show_all_ty=show_all_ty,
                 extra_config=merged_extra if merged_extra else None,
                 path_to_underline=path_to_underline,
@@ -274,7 +267,6 @@ class Scriptable:
         print_line_numbers: bool = False,
         num_context_lines: int = -1,
         syntax_sugar: bool = True,
-        show_object_address: bool = False,
         extra_config: dict | None = None,
         path_to_underline: list[AccessPath] | None = None,
         path_to_annotate: dict[AccessPath, str] | None = None,
@@ -300,7 +292,6 @@ class Scriptable:
                 print_line_numbers=print_line_numbers,
                 num_context_lines=num_context_lines,
                 syntax_sugar=syntax_sugar,
-                show_object_address=show_object_address,
                 extra_config=merged_extra,
                 path_to_underline=path_to_underline,
                 path_to_annotate=path_to_annotate,
@@ -325,7 +316,6 @@ class Scriptable:
         print_line_numbers: bool = False,
         num_context_lines: int = -1,
         syntax_sugar: bool = True,
-        show_object_address: bool = False,
         show_all_ty: bool = True,
         extra_config: dict | None = None,
         path_to_underline: list[AccessPath] | None = None,
@@ -382,8 +372,6 @@ class Scriptable:
             The number of lines of context to print before and after the line to underline.
         syntax_sugar: bool = True
             Whether to output with syntax sugar, set false for complete printing.
-        show_object_address: bool = False
-            Whether to include the object's address as part of the TVMScript name
         show_all_ty: bool = True
             If True (default), annotate all variable bindings with the struct
             info of that variable.  If False, only add annotations where
@@ -419,7 +407,6 @@ class Scriptable:
                 print_line_numbers=print_line_numbers,
                 num_context_lines=num_context_lines,
                 syntax_sugar=syntax_sugar,
-                show_object_address=show_object_address,
                 show_all_ty=show_all_ty,
                 extra_config=extra_config,
                 path_to_underline=path_to_underline,
diff --git a/python/tvm/tirx/script/ir_builder/ir.py b/python/tvm/tirx/script/ir_builder/ir.py
index 6fded429fe..3b7725991b 100644
--- a/python/tvm/tirx/script/ir_builder/ir.py
+++ b/python/tvm/tirx/script/ir_builder/ir.py
@@ -210,6 +210,90 @@ def _record_meta_resource(value: Any, skip_frames: int = 2) -> None:
 
 @_register_mutable_decl("tirx.Buffer", syntax="parameter")
 @_annotation_constructor
+def _buffer_type(
+    shape: list[Expr] | tuple[Expr] | Expr | Integral,
+    dtype: str = "float32",
+    data: Var = None,
+    strides: list[Expr] | None = None,
+    elem_offset: Expr = None,
+    byte_offset: Expr = None,
+    scope: str = "global",
+    align: int = 0,
+    offset_factor: int = 0,
+    layout: str | Layout | None = MISSING,
+    allocated_addr: int | tuple[int, ...] | None = None,
+    *,
+    span=None,
+) -> tir.BufferType:
+    """Construct a buffer type for annotations and explicit type-valued fields.
+
+    Parameters
+    ----------
+    shape : Union[List[Expr], Tuple[Expr], Expr, Integral]
+        The shape of the buffer prior to flattening.
+
+    dtype : str
+        The data type in the content of the buffer.
+
+    data : Var
+        An optional pointer whose storage scope determines the buffer type scope.
+
+    strides : List[Expr]
+        The strides of each dimension.
+
+    elem_offset : Expr
+        The offset in terms of number of dtype elements (including lanes).
+
+    byte_offset : Expr, optional
+        The offset in bytes, as an alternative to elem_offset.
+
+    scope : str
+        The optional storage scope of buffer data pointer.
+
+    align : int
+        The alignment requirement of data pointer in bytes.
+
+    offset_factor : int
+        The factor of elem_offset field.
+
+    layout : str or Layout, optional
+        The buffer layout. "default" constructs the shape's default TileLayout;
+        omission uses the enclosing dialect and scope default. None omits a layout.
+
+    allocated_addr : int or tuple of int, optional
+        Addresses assigned to the buffer allocation.
+
+    Returns
+    -------
+    res : BufferType
+        The buffer type. Function annotations introduce variables of this type;
+        allocation and declaration operations construct buffer variables.
+    """
+    shape = (shape,) if is_prim_expr(shape) or isinstance(shape, Integral) else shape
+    shape = tuple(shape)
+    if strides is None:
+        strides = []
+    if allocated_addr is None:
+        allocated_addr = []
+    if not isinstance(allocated_addr, list | tuple):
+        allocated_addr = [allocated_addr]
+    result = _ffi_api.BufferType(  # type: ignore[attr-defined] # pylint: disable=no-member
+        shape,
+        dtype,
+        data,
+        strides,
+        _get_elem_offset(elem_offset, byte_offset, dtype),
+        scope,
+        align,
+        offset_factor,
+        _get_layout(layout, shape, scope),
+        allocated_addr,
+    )
+    return _at(span, result)
+
+
+@_register_mutable_decl("tirx.buffer", syntax="parameter")
+@_annotation_constructor
 def buffer(
     shape: list[Expr] | tuple[Expr] | Expr | Integral,
     dtype: str = "float32",
@@ -1619,8 +1703,7 @@ def Ptr(dtype, storage_scope="global", *, span=None):
     return _at(span, ptr(dtype, storage_scope))
 
 
-Buffer = buffer
-_register_mutable_decl("tirx.buffer", syntax="parameter")(buffer)
+Buffer = _buffer_type
 
 __all__ = [
     "Buffer",
diff --git a/src/backend/cuda/codegen/codegen_cuda.cc b/src/backend/cuda/codegen/codegen_cuda.cc
index 66cf5e8cf1..471cba6edc 100644
--- a/src/backend/cuda/codegen/codegen_cuda.cc
+++ b/src/backend/cuda/codegen/codegen_cuda.cc
@@ -1295,19 +1295,7 @@ void CodeGenCUDA::Dispatch_(const CallNode* op, std::ostream& os) {
     std::string global_buffer =
         this->PrintExpr(addr_buffer->source.as_or_throw<tvm::tirx::BufferVar>().data());
     std::string local_addr = this->PrintExpr(op->args[3]);
-    std::string destination = reg + "[" + local_addr + "]";
-    if (const auto* load = op->args[0].as<TensorLoadNode>()) {
-      const auto* offset = op->args[3].as<IntImmNode>();
-      auto offset_type = op->args[3]->ty.as<PrimType>();
-      TVM_FFI_CHECK(
-          load->indices.size() == 1 && load->ty.as_or_throw<PrimType>() == PrimType::Float(32) &&
-              load->source.as_or_throw<tvm::tirx::BufferVar>()->dtype == PrimType::Float(32) &&
-              offset && offset->value == 0 && offset_type && offset_type.value().IsScalar() &&
-              offset_type.value().MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt),
-          ValueError)
-          << "s_tir.ldg32 buffer-load destination requires scalar float32 and a zero local offset";
-      destination = reg;
-    }
+    std::string destination = op->args[0].as<TensorLoadNode>() ? reg : reg + "[" + local_addr + "]";
     this->stream << "asm volatile (\n";
     this->stream << "\"{.reg .pred p;\\n\"\n";
     this->stream << "\" setp.ne.b32 p, %2, 0;\\n\"\n";
diff --git a/src/backend/cuda/codegen/intrin_rule_cuda.cc b/src/backend/cuda/codegen/intrin_rule_cuda.cc
index 70c5a1bf21..3c1c12decc 100644
--- a/src/backend/cuda/codegen/intrin_rule_cuda.cc
+++ b/src/backend/cuda/codegen/intrin_rule_cuda.cc
@@ -26,8 +26,6 @@
 #include <tvm/tirx/builtin.h>
 #include <tvm/tirx/op_attr_types.h>
 
-#include <initializer_list>
-
 #include "../../../target/intrin_rule.h"
 
 namespace tvm {
@@ -36,38 +34,12 @@ namespace intrin {
 // Add float suffix to the intrinsics, CUDA fast math.
 using tirx::FLowerIntrinsic;
 
-Type InferTypeCudaActiveMask(const CallNode*) { return PrimType::UInt(32); }
-
 Type InferTypeCudaShuffle(const CallNode* call) {
   TVM_FFI_CHECK_GE(call->args.size(), 2U, ValueError)
       << "CUDA warp shuffle inference requires a value operand";
   return call->args[1]->ty;
 }
 
-void ValidateCudaShuffle(const CallNode* call) {
-  for (size_t index : {0U, 2U, 3U}) {
-    PrimType control = call->args[index]->ty.as_or_throw<PrimType>();
-    TVM_FFI_CHECK(
-        control.IsScalar() && control.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt),
-        ValueError)
-        << "CUDA warp shuffle mask, lane and width must be scalar integers";
-  }
-  if (const auto* width = call->args[3].as<IntImmNode>()) {
-    TVM_FFI_CHECK(
-        width->value > 0 && width->value <= 32 && (width->value & (width->value - 1)) == 0,
-        ValueError)
-        << "CUDA warp shuffle width must be a power of two no greater than 32";
-  }
-  PrimType value = call->args[1]->ty.as_or_throw<PrimType>();
-  bool integer = value.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt) &&
-                 (value.bits() == 32 || value.bits() == 64);
-  bool floating = value.MatchesCode(DLDataTypeCode::kDLFloat) &&
-                  (value.bits() == 16 || value.bits() == 32 || value.bits() == 64);
-  bool bfloat = value.MatchesElementType(DLDataTypeCode::kDLBfloat, 16);
-  TVM_FFI_CHECK(value.IsScalar() && (integer || floating || bfloat), ValueError)
-      << "CUDA warp shuffle expects a supported scalar numeric value";
-}
-
 struct CUDAMath {
   std::string operator()(const PrimType& ty, std::string name) const {
     if (ty.MatchesCode(DLDataTypeCode::kDLFloat)) {
@@ -361,8 +333,7 @@ void RegisterCudaIntrinRules() {
       .set_attr<bool>("cuda.need_warp_shuffle", true);
 
   OpDef("tirx.cuda.__activemask")
-      .signature()
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeCudaActiveMask>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::UInt(32))
       .set_attr<tirx::TIRxOpCategory>("TIRxOpCategory", ffi::String("device_intrin"))
       .set_attr<tirx::TDeviceIntrinsicNamespace>("TDeviceIntrinsicNamespace", ffi::String("cuda"))
       .set_attr<tirx::TScriptPrinterName>("TScriptPrinterName", ffi::String("cuda.__activemask"))
@@ -370,17 +341,6 @@ void RegisterCudaIntrinRules() {
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kPure))
       .set_attr<bool>("cuda.need_warp_shuffle", true);
   // clang-format on
-  for (const char* name : {"tirx.cuda.__shfl_sync", "tirx.cuda.__shfl_up_sync",
-                           "tirx.cuda.__shfl_down_sync", "tirx.cuda.__shfl_xor_sync"}) {
-    OpDef def(name);
-    auto signature =
-        def.op()->validator.cast<ffi::reflection::NativeFunction<void(const CallNode*)>>();
-    ffi::TypedFunction<void(const CallNode*)> validator([signature](const CallNode* call) {
-      signature(call);
-      ValidateCudaShuffle(call);
-    });
-    def.set_validator(validator, true);
-  }
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() { RegisterCudaIntrinRules(); }
diff --git a/src/backend/cuda/op/iket.cc b/src/backend/cuda/op/iket.cc
index 155cb1afde..a6827d464f 100644
--- a/src/backend/cuda/op/iket.cc
+++ b/src/backend/cuda/op/iket.cc
@@ -27,16 +27,10 @@
 namespace tvm {
 namespace tirx {
 
-namespace {
-Type InferTypeVoid(const CallNode*) { return PrimType::Void(); }
-
-Type InferTypeUInt32(const CallNode*) { return PrimType::UInt(32); }
-}  // namespace
-
 TVM_FFI_STATIC_INIT_BLOCK() {
   OpDef("tirx.cuda.iket_mark")
       .signature(sig::arg("name", "The name."), sig::var_args("args"))
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeVoid>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Void())
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("device_intrin"))
       .set_attr<TDeviceIntrinsicNamespace>("TDeviceIntrinsicNamespace", ffi::String("cuda"))
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("cuda.iket."
@@ -45,7 +39,7 @@ TVM_FFI_STATIC_INIT_BLOCK() {
 
   OpDef("tirx.cuda.iket_range_start")
       .signature(sig::arg("name", "The name."), sig::var_args("args"))
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeUInt32>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::UInt(32))
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("device_intrin"))
       .set_attr<TDeviceIntrinsicNamespace>("TDeviceIntrinsicNamespace", ffi::String("cuda"))
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("cuda.iket."
@@ -54,7 +48,7 @@ TVM_FFI_STATIC_INIT_BLOCK() {
 
   OpDef("tirx.cuda.iket_range_end")
       .signature(sig::arg("token", "The token."), sig::var_args("args"))
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeVoid>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Void())
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("device_intrin"))
       .set_attr<TDeviceIntrinsicNamespace>("TDeviceIntrinsicNamespace", ffi::String("cuda"))
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("cuda.iket."
diff --git a/src/backend/cuda/op/target_builtin.cc b/src/backend/cuda/op/target_builtin.cc
index 81cdd7d976..3fba986e1f 100644
--- a/src/backend/cuda/op/target_builtin.cc
+++ b/src/backend/cuda/op/target_builtin.cc
@@ -40,175 +40,6 @@ namespace builtin {
 namespace {
 void RegisterDeviceIntrinsicAliases();
 
-Type InferTypeVoid(const CallNode*) { return PrimType::Void(); }
-
-Type InferTypeInt32(const CallNode*) { return PrimType::Int(32); }
-
-Type InferTypeUInt32(const CallNode*) { return PrimType::UInt(32); }
-
-Type InferTypeFloat32(const CallNode*) { return PrimType::Float(32); }
-
-void CheckScalarInteger(const Expr& arg) {
-  PrimType type = arg->ty.as_or_throw<PrimType>();
-  bool integer = type.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt) &&
-                 (type.bits() == 8 || type.bits() == 16 || type.bits() == 32 || type.bits() == 64);
-  TVM_FFI_CHECK(type.IsScalar() && (integer || type.MatchesElementType(DLDataTypeCode::kDLBool, 8)),
-                ValueError)
-      << "Device intrinsic expects a scalar integer argument";
-}
-
-PrimType CheckPointerArgument(const Expr& arg) {
-  const auto* pointer = arg->ty.as<PointerTypeNode>();
-  TVM_FFI_CHECK(pointer, ValueError) << "Device intrinsic expects a pointer argument";
-  PrimType element = pointer->element_type.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(element.IsVoid() || element.IsScalar(), ValueError)
-      << "Device intrinsic expects a void or scalar element pointer";
-  return element;
-}
-
-void CheckPointerElement(const Expr& arg, PrimType expected) {
-  PrimType element = CheckPointerArgument(arg);
-  TVM_FFI_CHECK(element.IsVoid() || element.MatchesElementType(expected.code(), expected.bits()),
-                ValueError)
-      << "Device intrinsic pointer element type does not match its value type";
-}
-
-void CheckStringChoice(const Expr& arg, std::initializer_list<const char*> choices) {
-  const auto* value = arg.as<StringImmNode>();
-  TVM_FFI_CHECK(value, ValueError) << "Device intrinsic expects a literal string argument";
-  for (const char* choice : choices) {
-    if (value->value == choice) return;
-  }
-  TVM_FFI_THROW(ValueError) << "Unsupported device intrinsic string argument: " << value->value;
-}
-
-void CheckNvshmemRmaArguments(const CallNode* call) {
-  CheckPointerArgument(call->args[0]);
-  CheckPointerArgument(call->args[1]);
-  CheckScalarInteger(call->args[2]);
-}
-
-void CheckNvshmemSignalArguments(const CallNode* call, size_t offset) {
-  CheckPointerElement(call->args[offset], PrimType::UInt(64));
-  CheckScalarInteger(call->args[offset + 1]);
-  CheckStringChoice(call->args[offset + 2], {"set", "add"});
-  CheckScalarInteger(call->args[offset + 3]);
-}
-
-void ValidateCudaPrintf(const CallNode* call) {
-  TVM_FFI_CHECK(call->args[0].as<StringImmNode>(), ValueError)
-      << "cuda.printf expects a literal format string";
-  for (size_t i = 1; i < call->args.size(); ++i) {
-    PrimType arg = call->args[i]->ty.as_or_throw<PrimType>();
-    bool integer = arg.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt) &&
-                   (arg.bits() == 8 || arg.bits() == 16 || arg.bits() == 32 || arg.bits() == 64);
-    bool floating =
-        arg.MatchesCode(DLDataTypeCode::kDLFloat) && (arg.bits() == 32 || arg.bits() == 64);
-    TVM_FFI_CHECK(arg.IsScalar() &&
-                      (integer || floating || arg.MatchesElementType(DLDataTypeCode::kDLBool, 8)),
-                  ValueError)
-        << "cuda.printf expects supported scalar numeric arguments";
-  }
-}
-
-void ValidateCudaSyncthreadsPredicate(const CallNode* call) {
-  PrimType predicate = call->args[0]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(
-      predicate.IsScalar() && predicate.MatchesCode(DLDataTypeCode::kDLBool, DLDataTypeCode::kDLInt,
-                                                    DLDataTypeCode::kDLUInt),
-      ValueError)
-      << "CUDA predicate synchronization expects a scalar integral predicate";
-}
-
-void ValidateCudaMatrixDescriptor(const CallNode* call) {
-  CheckPointerArgument(call->args[0]);
-  CheckPointerArgument(call->args[1]);
-  for (size_t i = 2; i < 5; ++i) CheckScalarInteger(call->args[i]);
-}
-
-template <bool block_scaled>
-void ValidateCudaInstructionDescriptor(const CallNode* call) {
-  constexpr size_t size = block_scaled ? 17 : 14;
-  constexpr size_t dtype_end = block_scaled ? 6 : 4;
-  constexpr size_t fields_begin = block_scaled ? 8 : 4;
-  constexpr size_t cta_group = block_scaled ? 13 : 9;
-  CheckPointerArgument(call->args[0]);
-  for (size_t i = 1; i < dtype_end; ++i) {
-    TVM_FFI_CHECK(call->args[i].as<StringImmNode>(), ValueError)
-        << "CUDA instruction descriptor expects literal dtype names";
-  }
-  if constexpr (block_scaled) {
-    for (size_t i : {6U, 7U}) {
-      if (call->args[i]->ty.as<PointerTypeNode>()) {
-        CheckPointerArgument(call->args[i]);
-      } else {
-        CheckScalarInteger(call->args[i]);
-      }
-    }
-  }
-  for (size_t i = fields_begin; i < size; ++i) CheckScalarInteger(call->args[i]);
-  if (const auto* value = call->args[cta_group].as<IntImmNode>()) {
-    TVM_FFI_CHECK(value->value == 1 || value->value == 2, ValueError)
-        << "CUDA instruction descriptor expects one or two CTA groups";
-  }
-}
-
-void ValidateCudaWgmmaNoopBarrier(const CallNode* call) {
-  PrimType type = call->args[0]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(
-      type.IsScalar() && !type.IsVoid() && !type.MatchesCode(DLDataTypeCode::kDLOpaqueHandle),
-      ValueError)
-      << "WGMMA noop barrier expects a primitive scalar register";
-}
-
-void ValidateCudaNanoSleep(const CallNode* call) { CheckScalarInteger(call->args[0]); }
-
-void ValidateNvshmemRma(const CallNode* call) {
-  CheckNvshmemRmaArguments(call);
-  CheckScalarInteger(call->args[3]);
-}
-
-void ValidateNvshmemSignal(const CallNode* call) { CheckNvshmemSignalArguments(call, 0); }
-
-void ValidateNvshmemWaitUntil(const CallNode* call) {
-  CheckPointerElement(call->args[0], PrimType::UInt(64));
-  CheckStringChoice(call->args[1], {"eq", "ne", "gt", "ge", "lt", "le"});
-  CheckScalarInteger(call->args[2]);
-  CheckStringChoice(call->args[3], {"uint64_t", "uint64"});
-}
-
-void ValidateNvshmemPutmemSignal(const CallNode* call) {
-  CheckNvshmemRmaArguments(call);
-  CheckNvshmemSignalArguments(call, 3);
-}
-
-void ValidateCudaMBarrierWait(const CallNode* call) {
-  const Type& barrier = call->args[0]->ty;
-  if (auto integer = barrier.as<PrimType>()) {
-    const auto* literal = call->args[0].as<IntImmNode>();
-    bool null_pointer = literal && literal->value == 0 &&
-                        integer.value().MatchesElementType(DLDataTypeCode::kDLInt, 32);
-    TVM_FFI_CHECK(
-        integer.value().IsScalar() &&
-            (integer.value().MatchesElementType(DLDataTypeCode::kDLUInt, 32) || null_pointer),
-        ValueError)
-        << "cuda.mbarrier_wait expects a uint32 shared address or pointer";
-  } else {
-    TVM_FFI_CHECK(barrier.as<PointerTypeNode>(), ValueError)
-        << "cuda.mbarrier_wait expects a uint32 shared address or pointer";
-  }
-  PrimType phase = call->args[1]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(
-      phase.IsScalar() && phase.MatchesCode(DLDataTypeCode::kDLBool, DLDataTypeCode::kDLInt,
-                                            DLDataTypeCode::kDLUInt),
-      ValueError)
-      << "cuda.mbarrier_wait expects a scalar phase";
-}
-
-void ValidateCudaLdg(const CallNode* call) {
-  if (call->args.size() == 2) CheckPointerArgument(call->args[0]);
-}
-
 Type InferTypeCudaLdg(const CallNode* call) {
   TVM_FFI_CHECK_EQ(call->args.size(), 2U, ValueError) << "Scalar cuda.ldg expects two arguments";
   const auto* dtype = call->args[1].as<StringImmNode>();
@@ -230,33 +61,6 @@ Type InferTypeCudaAtomic(const CallNode* call) {
   return call->args[1]->ty;
 }
 
-void ValidateCudaAtomicAdd(const CallNode* call) {
-  PrimType value = call->args[1]->ty.as_or_throw<PrimType>();
-  bool integer =
-      value.MatchesElementType(DLDataTypeCode::kDLInt, 32) ||
-      (value.MatchesCode(DLDataTypeCode::kDLUInt) && (value.bits() == 32 || value.bits() == 64));
-  bool floating = value.MatchesCode(DLDataTypeCode::kDLFloat) &&
-                  (value.bits() == 16 || value.bits() == 32 || value.bits() == 64);
-  TVM_FFI_CHECK(value.IsScalar() && (integer || floating ||
-                                     value.MatchesElementType(DLDataTypeCode::kDLBfloat, 16)),
-                ValueError)
-      << "cuda.atomic_add expects a supported scalar value";
-  CheckPointerElement(call->args[0], value);
-}
-
-void ValidateCudaAtomicCas(const CallNode* call) {
-  PrimType compare = call->args[1]->ty.as_or_throw<PrimType>();
-  PrimType replacement = call->args[2]->ty.as_or_throw<PrimType>();
-  bool supported = compare.MatchesElementType(DLDataTypeCode::kDLInt, 32) ||
-                   (compare.MatchesCode(DLDataTypeCode::kDLUInt) &&
-                    (compare.bits() == 16 || compare.bits() == 32 || compare.bits() == 64));
-  TVM_FFI_CHECK(compare.IsScalar() && supported && replacement.IsScalar() &&
-                    replacement.MatchesElementType(compare.code(), compare.bits()),
-                ValueError)
-      << "cuda.atomic_cas expects matching supported scalar values";
-  CheckPointerElement(call->args[0], compare);
-}
-
 }  // namespace
 
 void RegisterCudaTargetBuiltins() {
@@ -472,17 +276,6 @@ void RegisterDeviceIntrinsic(const char* op_name, const char* op_namespace,
   RegisterDeviceIntrinsicAttrs(def, op_namespace, effect_kind, names.printer);
 }
 
-void AddDeviceIntrinsicValidator(const char* name, void (*validate)(const CallNode*)) {
-  OpDef def(name);
-  auto signature =
-      def.op()->validator.cast<ffi::reflection::NativeFunction<void(const CallNode*)>>();
-  ffi::TypedFunction<void(const CallNode*)> validator([signature, validate](const CallNode* call) {
-    signature(call);
-    validate(call);
-  });
-  def.set_validator(validator, true);
-}
-
 void RegisterDeviceIntrinsicAliases() {
   RegisterDeviceIntrinsic("cuda_any_sync", "cuda", CallEffectKind::kPure, sig::arg("mask"),
                           sig::arg("pred"));
@@ -639,36 +432,6 @@ void RegisterDeviceIntrinsicAliases() {
                           sig::arg("b_offset"), sig::arg("acc_ptr"), sig::arg("c_offset"),
                           sig::arg("saturate"), sig::var_args("args"));
 
-  for (const char* name :
-       {"tirx.cuda.tcgen05_encode_matrix_descriptor", "tirx.cuda.wgmma_encode_matrix_descriptor"}) {
-    AddDeviceIntrinsicValidator(name, ValidateCudaMatrixDescriptor);
-  }
-  AddDeviceIntrinsicValidator("tirx.cuda.tcgen05_encode_instr_descriptor",
-                              ValidateCudaInstructionDescriptor<false>);
-  AddDeviceIntrinsicValidator("tirx.cuda.tcgen05_encode_instr_descriptor_block_scaled",
-                              ValidateCudaInstructionDescriptor<true>);
-  AddDeviceIntrinsicValidator("tirx.cuda.wgmma_noop_barrier", ValidateCudaWgmmaNoopBarrier);
-  AddDeviceIntrinsicValidator("tirx.cuda.printf", ValidateCudaPrintf);
-  for (const char* name : {"tirx.cuda.syncthreads_and", "tirx.cuda.syncthreads_or"}) {
-    AddDeviceIntrinsicValidator(name, ValidateCudaSyncthreadsPredicate);
-  }
-  AddDeviceIntrinsicValidator("tirx.cuda.nano_sleep", ValidateCudaNanoSleep);
-  AddDeviceIntrinsicValidator("tirx.cuda.ldg", ValidateCudaLdg);
-  AddDeviceIntrinsicValidator("tirx.cuda.atomic_add", ValidateCudaAtomicAdd);
-  AddDeviceIntrinsicValidator("tirx.cuda.atomic_cas", ValidateCudaAtomicCas);
-  AddDeviceIntrinsicValidator("tirx.cuda.mbarrier_wait", ValidateCudaMBarrierWait);
-  for (const char* name :
-       {"tirx.nvshmem.getmem_nbi", "tirx.nvshmem.getmem_nbi_warp", "tirx.nvshmem.putmem_nbi",
-        "tirx.nvshmem.putmem_nbi_warp", "tirx.nvshmem.putmem_nbi_block"}) {
-    AddDeviceIntrinsicValidator(name, ValidateNvshmemRma);
-  }
-  AddDeviceIntrinsicValidator("tirx.nvshmem.signal_op", ValidateNvshmemSignal);
-  AddDeviceIntrinsicValidator("tirx.nvshmem.wait_until", ValidateNvshmemWaitUntil);
-  for (const char* name : {"tirx.nvshmem.putmem_signal_nbi", "tirx.nvshmem.putmem_signal_nbi_warp",
-                           "tirx.nvshmem.putmem_signal_nbi_block"}) {
-    AddDeviceIntrinsicValidator(name, ValidateNvshmemPutmemSignal);
-  }
-
   for (const char* name : {
            "tirx.cuda.tcgen05_encode_matrix_descriptor",
            "tirx.cuda.wgmma_encode_matrix_descriptor",
@@ -697,18 +460,16 @@ void RegisterDeviceIntrinsicAliases() {
            "tirx.nvshmem.putmem_signal_nbi_warp",
            "tirx.nvshmem.putmem_signal_nbi_block",
        }) {
-    OpDef(name).set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeVoid>());
+    OpDef(name).set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Void());
   }
   for (const char* name : {"tirx.cuda.syncthreads_and", "tirx.cuda.syncthreads_or",
                            "tirx.nvshmem.my_pe", "tirx.nvshmem.n_pes"}) {
-    OpDef(name).set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeInt32>());
+    OpDef(name).set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Int(32));
   }
-  OpDef("tirx.cuda.elect_sync")
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeUInt32>());
+  OpDef("tirx.cuda.elect_sync").set_attr<TFixedReturnType>("TFixedReturnType", PrimType::UInt(32));
   OpDef("tirx.cuda.ldg")
       .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeCudaLdg>());
-  OpDef("tirx.s_tir.ldg32")
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeFloat32>());
+  OpDef("tirx.s_tir.ldg32").set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Float(32));
   OpDef("tirx.cuda.atomic_add")
       .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeCudaAtomic>());
   OpDef("tirx.cuda.atomic_cas")
diff --git a/src/backend/metal/codegen/intrin_rule_metal.cc b/src/backend/metal/codegen/intrin_rule_metal.cc
index f297591ef5..6c920cc501 100644
--- a/src/backend/metal/codegen/intrin_rule_metal.cc
+++ b/src/backend/metal/codegen/intrin_rule_metal.cc
@@ -35,23 +35,6 @@ static Type InferTypeMetalShuffle(const CallNode* call) {
   return call->args[0]->ty;
 }
 
-static void ValidateMetalShuffle(const CallNode* call) {
-  TVM_FFI_CHECK_EQ(call->args.size(), 2U, ValueError)
-      << "Metal simd shuffle expects a value and a lane or delta";
-  PrimType value = call->args[0]->ty.as_or_throw<PrimType>();
-  bool integer =
-      value.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt) && value.bits() == 32;
-  bool floating =
-      value.MatchesCode(DLDataTypeCode::kDLFloat) && (value.bits() == 16 || value.bits() == 32);
-  TVM_FFI_CHECK(value.IsScalar() && (integer || floating), ValueError)
-      << "Metal simd shuffle expects a supported scalar numeric value";
-  PrimType lane = call->args[1]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(lane.IsScalar() && lane.bits() == 32 &&
-                    lane.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt),
-                ValueError)
-      << "Metal simd shuffle expects a scalar integer lane or delta";
-}
-
 struct MetalWarpIntrinsic {
   const Op operator()(PrimType t, const Op& orig_op) const {
     if (orig_op.same_as(builtin::tvm_warp_shuffle())) {
@@ -200,17 +183,6 @@ void RegisterMetalIntrinRules() {
       .set_attr<TGlobalSymbol>("TGlobalSymbol", "simd_shuffle_down")
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kOpaque));
   // clang-format on
-  for (const char* name :
-       {"tirx.metal.simd_shuffle", "tirx.metal.simd_shuffle_up", "tirx.metal.simd_shuffle_down"}) {
-    OpDef def(name);
-    auto signature =
-        def.op()->validator.cast<ffi::reflection::NativeFunction<void(const CallNode*)>>();
-    ffi::TypedFunction<void(const CallNode*)> validator([signature](const CallNode* call) {
-      signature(call);
-      ValidateMetalShuffle(call);
-    });
-    def.set_validator(validator, true);
-  }
 }
 
 }  // namespace intrin
diff --git a/src/backend/webgpu/codegen/intrin_rule_webgpu.cc b/src/backend/webgpu/codegen/intrin_rule_webgpu.cc
index 338c0af676..ec5f24057a 100644
--- a/src/backend/webgpu/codegen/intrin_rule_webgpu.cc
+++ b/src/backend/webgpu/codegen/intrin_rule_webgpu.cc
@@ -37,25 +37,6 @@ static Type InferTypeWebGPUShuffle(const CallNode* call) {
   return call->args[0]->ty;
 }
 
-static void ValidateWebGPUShuffle(const CallNode* call) {
-  TVM_FFI_CHECK_EQ(call->args.size(), 2U, ValueError)
-      << "WebGPU subgroup shuffle expects a value and a lane or delta";
-  PrimType value = call->args[0]->ty.as_or_throw<PrimType>();
-  bool integer =
-      value.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt) && value.bits() == 32;
-  bool floating =
-      value.MatchesCode(DLDataTypeCode::kDLFloat) && (value.bits() == 16 || value.bits() == 32);
-  TVM_FFI_CHECK(!value.IsScalableVector() && value.lanes() >= 1 && value.lanes() <= 4 &&
-                    (integer || floating),
-                ValueError)
-      << "WebGPU subgroup shuffle expects a supported numeric value";
-  PrimType lane = call->args[1]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(lane.IsScalar() && lane.bits() == 32 &&
-                    lane.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt),
-                ValueError)
-      << "WebGPU subgroup shuffle expects a scalar integer lane or delta";
-}
-
 // warp-level primitives. Follows implementation in intrin_rule_metal.cc
 struct WebGPUWarpIntrinsic {
   const Op operator()(PrimType t, const Op& orig_op) const {
@@ -230,17 +211,6 @@ void RegisterWebGPUIntrinRules() {
       .set_attr<TGlobalSymbol>("TGlobalSymbol", "subgroupShuffleDown")
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kOpaque));
   // clang-format on
-  for (const char* name : {"tirx.webgpu.subgroup_shuffle", "tirx.webgpu.subgroup_shuffle_up",
-                           "tirx.webgpu.subgroup_shuffle_down"}) {
-    OpDef def(name);
-    auto signature =
-        def.op()->validator.cast<ffi::reflection::NativeFunction<void(const CallNode*)>>();
-    ffi::TypedFunction<void(const CallNode*)> validator([signature](const CallNode* call) {
-      signature(call);
-      ValidateWebGPUShuffle(call);
-    });
-    def.set_validator(validator, true);
-  }
 }
 
 }  // namespace intrin
diff --git a/src/ir/expr.cc b/src/ir/expr.cc
index 4c1d9da2fc..6b883640e7 100644
--- a/src/ir/expr.cc
+++ b/src/ir/expr.cc
@@ -1208,6 +1208,10 @@ Type Call::ReinferType(const CallNode* call) {
   TVM_FFI_CHECK(call != nullptr, ValueError) << "Call::ReinferType expects a defined Call";
   auto op = call->op.as<Op>();
   TVM_FFI_CHECK(op.has_value(), ValueError) << "Call::ReinferType requires an Op callee";
+  if (Op::HasAttrMap("TFixedReturnType")) {
+    static auto fixed_return_type = Op::GetAttrMap<TFixedReturnType>("TFixedReturnType");
+    if (fixed_return_type.count(op.value())) return fixed_return_type[op.value()];
+  }
   TVM_FFI_CHECK(Op::HasAttrMap("FInferType"), ValueError)
       << "No context-free FInferType hook is registered for " << op.value();
   static auto infer_type = Op::GetAttrMap<FInferType>("FInferType");
diff --git a/src/ir/prim/builtin.cc b/src/ir/prim/builtin.cc
index 3f5af5b849..f4b7e43d57 100644
--- a/src/ir/prim/builtin.cc
+++ b/src/ir/prim/builtin.cc
@@ -23,8 +23,6 @@ namespace tvm {
 namespace prim {
 namespace builtin {
 
-Type InferTypeVScale(const CallNode*) { return PrimType::Int(32); }
-
 #define TVM_DEFINE_CACHED_OP_GETTER(Name, RegisteredName) \
   const Op& Name() {                                      \
     static const Op op = Op::Get(RegisteredName);         \
@@ -54,8 +52,7 @@ TVM_FFI_STATIC_INIT_BLOCK() {
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kPure));
 
   OpDef("prim.vscale")
-      .signature()
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeVScale>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Int(32))
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kPure));
 
   OpDef("prim.ceil")
diff --git a/src/relax/script/printer/binding.cc b/src/relax/script/printer/binding.cc
index b8e750bb55..ac5b99c3c8 100644
--- a/src/relax/script/printer/binding.cc
+++ b/src/relax/script/printer/binding.cc
@@ -17,7 +17,6 @@
  */
 #include <tvm/ffi/extra/structural_equal.h>
 #include <tvm/ir/op.h>
-#include <tvm/relax/block_builder.h>
 #include <tvm/relax/op_attr_types.h>
 #include <tvm/tirx/type.h>
 
@@ -33,8 +32,8 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> EmitRelaxMatchCast(DocTranslatorObj* d, ffi::AnyView input,
-                                          const ffi::Object* destination) {
+ffi::Optional<ExprDoc> MatchCastDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                             const ffi::Object* destination) {
   const auto* binding =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::MatchCastNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -42,15 +41,10 @@ ffi::Optional<ExprDoc> EmitRelaxMatchCast(DocTranslatorObj* d, ffi::AnyView inpu
   ExprDoc rhs =
       NamespaceDoc("relax")
           ->Attr("match_cast")
-          ->Call({d->Translate(binding->value).value(),
-                  (binding->ty.as<tirx::BufferTypeNode>() ? TypeValue(d, binding->ty, false)
-                                                          : d->Translate(binding->ty).value())});
+          ->Call({d->Translate(binding->value).value(), d->Translate(binding->ty).value()});
   IdDoc lhs = VarDoc(d, binding->var);
   ffi::Optional<ExprDoc> annotation = std::nullopt;
-  if (!binding->var->ty.IsMissing())
-    annotation =
-        (binding->var->ty.as<tirx::BufferTypeNode>() ? TypeValue(d, binding->var->ty, false)
-                                                     : d->Translate(binding->var->ty).value());
+  if (!binding->var->ty.IsMissing()) annotation = d->Translate(binding->var->ty).value();
   if (!d->GetExtraConfig<bool>("relax.show_all_ty", true)) annotation = std::nullopt;
   d->Emit(AssignDoc(lhs, rhs, annotation), ffi::GetRef<ffi::ObjectRef>(binding));
   return std::nullopt;
@@ -58,11 +52,11 @@ ffi::Optional<ExprDoc> EmitRelaxMatchCast(DocTranslatorObj* d, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::MatchCastNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitRelaxMatchCast>());
+      kDocTranslate, FDocTranslate::FromNative<&MatchCastDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitRelaxVarBinding(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object* destination) {
+ffi::Optional<ExprDoc> VarBindingDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object* destination) {
   const auto* binding =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::VarBindingNode>(
           input);
@@ -93,67 +87,53 @@ ffi::Optional<ExprDoc> EmitRelaxVarBinding(DocTranslatorObj* d, ffi::AnyView inp
   if (!rhs.has_value()) return std::nullopt;
   ffi::Optional<ExprDoc> annotation = std::nullopt;
   bool infer_vdevice = false;
-  bool explicit_output_type = false;
   if (auto tensor = binding->var->ty.as<relax::TensorTypeNode>();
       tensor && tensor->vdevice.has_value()) {
     if (auto call = binding->value.as<CallNode>()) {
       if (auto op = call->op.as<Op>()) infer_vdevice = op.value()->name == "relax.to_vdevice";
     }
   }
-  if (auto call = binding->value.as<CallNode>(); call && call->ty_args.size() == 1) {
-    if (auto op = call->op.as<Op>()) {
-      const auto& name = op.value()->name;
-      explicit_output_type =
-          (name == "relax.call_tir" || name == "relax.call_dps_packed" ||
-           name == "relax.call_tir_with_grad" || name == "relax.call_tir_inplace" ||
-           name == "relax.dist.call_tir_local_view") &&
-          ffi::StructuralEqual()(binding->var->ty, call->ty_args[0]);
-    }
-  }
-  if (!binding->var->ty.IsMissing() && !infer_vdevice && !explicit_output_type)
-    annotation =
-        (binding->var->ty.as<tirx::BufferTypeNode>() ? TypeValue(d, binding->var->ty, false)
-                                                     : d->Translate(binding->var->ty).value());
-  bool inferable = false;
-  if (annotation.has_value()) {
-    ffi::Optional<Type> inferred = binding->value->ty;
-    if (auto call = binding->value.as<CallNode>()) {
-      inferred = std::nullopt;
-      if (auto op = call->op.as<Op>()) {
-        static const OpAttrMap<FInferType> context_free = Op::GetAttrMap<FInferType>("FInferType");
-        static const OpAttrMap<relax::FInferTypeWithBuilder> with_builder =
-            Op::GetAttrMap<relax::FInferTypeWithBuilder>("relax.FInferTypeWithBuilder");
+  bool show_all_ty = d->GetExtraConfig<bool>("relax.show_all_ty", true);
+  const auto* call = binding->value.as<CallNode>();
+  bool output_type_argument = call && call->ty_args.size() == 1 &&
+                              ffi::StructuralEqual()(binding->var->ty, call->ty_args[0]);
+  ffi::Optional<Type> inferred = std::nullopt;
+  if (!show_all_ty || output_type_argument) {
+    if (!call) {
+      inferred = binding->value->ty;
+    } else if (auto op = call->op.as<Op>()) {
+      static const auto fixed = Op::GetAttrMap<TFixedReturnType>("TFixedReturnType");
+      static const auto context_free = Op::GetAttrMap<FInferType>("FInferType");
+      if (fixed.count(op.value()) || context_free.count(op.value())) {
         try {
-          if (context_free.count(op.value())) {
-            inferred = Call::ReinferType(call);
-          } else if (with_builder.count(op.value())) {
-            auto builder = relax::BlockBuilder::Create(std::nullopt);
-            inferred = with_builder[op.value()](ffi::GetRef<Call>(call), builder);
-          }
+          inferred = Call::ReinferType(call);
         } catch (const ffi::Error&) {
-          inferred = std::nullopt;
+          // Contextual inference remains the parser's responsibility.
         }
       }
     }
-    // Primitive bindings retain their annotation even when the expression's
-    // type is known.  The Relax parser uses it to keep primitive aliases as
-    // typed bindings rather than plain Python assignments.
-    inferable = !binding->var->ty.as<PrimTypeNode>() && inferred.has_value() &&
-                !inferred.value().IsMissing() &&
-                ffi::StructuralEqual()(binding->var->ty, inferred.value());
   }
-  if (inferable && !d->GetExtraConfig<bool>("relax.show_all_ty", true)) annotation = std::nullopt;
+  bool inferable = inferred.has_value() && !inferred.value().IsMissing() &&
+                   ffi::StructuralEqual()(binding->var->ty, inferred.value());
+  bool explicit_output_type = output_type_argument && inferable;
+  // Primitive aliases need their annotation. Without context-free inference,
+  // keep the binding type and let the parser's deferred inference use it.
+  bool elide_annotation = infer_vdevice || explicit_output_type ||
+                          (!show_all_ty && !binding->var->ty.as<PrimTypeNode>() && inferable);
+  if (!binding->var->ty.IsMissing() && !elide_annotation) {
+    annotation = d->Translate(binding->var->ty).value();
+  }
   d->Emit(AssignDoc(lhs, rhs.value(), annotation), ffi::GetRef<ffi::ObjectRef>(binding));
   return std::nullopt;
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::VarBindingNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitRelaxVarBinding>());
+      kDocTranslate, FDocTranslate::FromNative<&VarBindingDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitRelaxIf(DocTranslatorObj* d, ffi::AnyView input,
-                                   const ffi::Object* destination) {
+ffi::Optional<ExprDoc> IfDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                      const ffi::Object* destination) {
   const auto* branch =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::IfNode>(input);
   // A value context needs a usable expression after the conditional.  A
@@ -169,9 +149,7 @@ ffi::Optional<ExprDoc> EmitRelaxIf(DocTranslatorObj* d, ffi::AnyView input,
   Var var = ffi::GetRef<Var>(static_cast<const VarNode*>(destination));
   ffi::Optional<IdDoc> lhs = VarDoc(d, var);
   ffi::Optional<ExprDoc> annotation = std::nullopt;
-  if (!var->ty.IsMissing())
-    annotation = (var->ty.as<tirx::BufferTypeNode>() ? TypeValue(d, var->ty, false)
-                                                     : d->Translate(var->ty).value());
+  if (!var->ty.IsMissing()) annotation = d->Translate(var->ty).value();
   ExprDoc condition = d->Translate(branch->cond).value();
   d->Emit(IfDoc(condition, RelaxSeqBody(d, branch->true_branch.get(), lhs, annotation, destination),
                 RelaxSeqBody(d, branch->false_branch.get(), lhs, annotation, destination)),
@@ -181,7 +159,7 @@ ffi::Optional<ExprDoc> EmitRelaxIf(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::IfNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&EmitRelaxIf>());
+                                                     FDocTranslate::FromNative<&IfDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/call.cc b/src/relax/script/printer/call.cc
index 3bfe88a5be..7752249510 100644
--- a/src/relax/script/printer/call.cc
+++ b/src/relax/script/printer/call.cc
@@ -60,10 +60,7 @@ ffi::Optional<ExprDoc> TranslateRelaxCall(DocTranslatorObj* d, const CallNode* c
     for (const Expr& arg : tuple->fields) packed_args.push_back(d->Translate(arg).value());
     return NamespaceDoc("relax")
         ->Attr("call_py_func")
-        ->Call(packed_args, {"out_ty"},
-               {(call->ty_args[0].as<tirx::BufferTypeNode>()
-                     ? TypeValue(d, call->ty_args[0], false)
-                     : d->Translate(call->ty_args[0]).value())});
+        ->Call(packed_args, {"out_ty"}, {d->Translate(call->ty_args[0]).value()});
   }
 
   if (auto op = call->op.as<Op>(); op.has_value() && op.value()->name == "relax.print" &&
@@ -166,14 +163,10 @@ ffi::Optional<ExprDoc> TranslateRelaxCall(DocTranslatorObj* d, const CallNode* c
            op.value()->name == "relax.call_tir_with_grad") &&
           call->ty_args.size() == 1) {
         keys.push_back("out_ty");
-        values.push_back((call->ty_args[0].as<tirx::BufferTypeNode>()
-                              ? TypeValue(d, call->ty_args[0], false)
-                              : d->Translate(call->ty_args[0]).value()));
+        values.push_back(d->Translate(call->ty_args[0]).value());
       } else {
         ffi::Array<ExprDoc> types;
-        for (const Type& type : call->ty_args)
-          types.push_back((type.as<tirx::BufferTypeNode>() ? TypeValue(d, type, false)
-                                                           : d->Translate(type).value()));
+        for (const Type& type : call->ty_args) types.push_back(d->Translate(type).value());
         keys.push_back("ty_args");
         values.push_back(TupleDoc(types));
       }
@@ -186,19 +179,13 @@ ffi::Optional<ExprDoc> TranslateRelaxCall(DocTranslatorObj* d, const CallNode* c
       if (op.value()->name == "relax.call_tir_inplace") {
         if (auto tuple = call->ty_args[0].as<relax::TupleTypeNode>()) {
           ffi::Array<ExprDoc> fields;
-          for (const Type& field : tuple->fields)
-            fields.push_back((field.as<tirx::BufferTypeNode>() ? TypeValue(d, field, false)
-                                                               : d->Translate(field).value()));
+          for (const Type& field : tuple->fields) fields.push_back(d->Translate(field).value());
           ordered_values.push_back(ListDoc(fields));
         } else {
-          ordered_values.push_back((call->ty_args[0].as<tirx::BufferTypeNode>()
-                                        ? TypeValue(d, call->ty_args[0], false)
-                                        : d->Translate(call->ty_args[0]).value()));
+          ordered_values.push_back(d->Translate(call->ty_args[0]).value());
         }
       } else {
-        ordered_values.push_back((call->ty_args[0].as<tirx::BufferTypeNode>()
-                                      ? TypeValue(d, call->ty_args[0], false)
-                                      : d->Translate(call->ty_args[0]).value()));
+        ordered_values.push_back(d->Translate(call->ty_args[0]).value());
       }
       auto append_key = [&](const ffi::String& key) {
         for (size_t i = 0; i < keys.size(); ++i) {
@@ -247,8 +234,8 @@ ffi::Optional<ExprDoc> TranslateRelaxCall(DocTranslatorObj* d, const CallNode* c
   return std::nullopt;
 }
 
-ffi::Optional<ExprDoc> TranslateCallDefault(DocTranslatorObj* d, ffi::AnyView input,
-                                            const ffi::Object* destination) {
+ffi::Optional<ExprDoc> CallDefaultDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                               const ffi::Object* destination) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   // Eligibility depends on inputs and the registered inference contract, not
@@ -291,12 +278,12 @@ TVM_FFI_STATIC_INIT_BLOCK() {
   for (const char* name : {"relax.call_tir", "relax.call_tir_with_grad", "relax.call_tir_inplace",
                            "relax.call_dps_packed"}) {
     OpDef(name).set_attr<FDocTranslate>(kOpCallTranslate,
-                                        FDocTranslate::FromNative<&TranslateCallDefault>());
+                                        FDocTranslate::FromNative<&CallDefaultDocTranslate>());
   }
 }
 
-ffi::Optional<ExprDoc> TranslateCall(DocTranslatorObj* d, ffi::AnyView input,
-                                     const ffi::Object* destination) {
+ffi::Optional<ExprDoc> CallDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                        const ffi::Object* destination) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   if (auto op = call->op.as<Op>(); op && Op::HasAttrMap(kOpCallTranslate)) {
@@ -317,12 +304,12 @@ ffi::Optional<ExprDoc> TranslateCall(DocTranslatorObj* d, ffi::AnyView input,
           .value();
     }
   }
-  return TranslateCallDefault(d, input, destination);
+  return CallDefaultDocTranslate(d, input, destination);
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<CallNode>().attr(kDocTranslate,
-                                                FDocTranslate::FromNative<&TranslateCall>());
+                                                FDocTranslate::FromNative<&CallDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/dependent_type.cc b/src/relax/script/printer/dependent_type.cc
index e305c857b8..2fccfd3b3b 100644
--- a/src/relax/script/printer/dependent_type.cc
+++ b/src/relax/script/printer/dependent_type.cc
@@ -30,17 +30,17 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateAnyType(DocTranslatorObj*, ffi::AnyView, const ffi::Object*) {
+ffi::Optional<ExprDoc> AnyTypeDocTranslate(DocTranslatorObj*, ffi::AnyView, const ffi::Object*) {
   return NamespaceDoc("relax")->Attr("Any");
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<AnyTypeNode>().attr(kDocTranslate,
-                                                   FDocTranslate::FromNative<&TranslateAnyType>());
+  ffi::reflection::TypeAttrDef<AnyTypeNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&AnyTypeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateShapeType(DocTranslatorObj* d, ffi::AnyView input,
-                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> ShapeTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* ty =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::ShapeTypeNode>(input);
   if (ty->values.has_value()) {
@@ -54,7 +54,7 @@ ffi::Optional<ExprDoc> TranslateShapeType(DocTranslatorObj* d, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::ShapeTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateShapeType>());
+      kDocTranslate, FDocTranslate::FromNative<&ShapeTypeDocTranslate>());
 }
 
 }  // namespace
@@ -95,8 +95,8 @@ ExprDoc RelaxTensorTypeDoc(DocTranslatorObj* d, const relax::TensorTypeNode* ty,
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateRelaxTensorType(DocTranslatorObj* d, ffi::AnyView input,
-                                                const ffi::Object*) {
+ffi::Optional<ExprDoc> TensorTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* ty =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::TensorTypeNode>(
           input);
@@ -105,11 +105,11 @@ ffi::Optional<ExprDoc> TranslateRelaxTensorType(DocTranslatorObj* d, ffi::AnyVie
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::TensorTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateRelaxTensorType>());
+      kDocTranslate, FDocTranslate::FromNative<&TensorTypeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateFuncType(DocTranslatorObj* d, ffi::AnyView input,
-                                         const ffi::Object*) {
+ffi::Optional<ExprDoc> RelaxFuncTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                 const ffi::Object*) {
   const auto* ty =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::FuncTypeNode>(input);
   if (!ty->params.has_value()) {
@@ -117,8 +117,7 @@ ffi::Optional<ExprDoc> TranslateFuncType(DocTranslatorObj* d, ffi::AnyView input
     ffi::Array<ExprDoc> values;
     if (!ty->ret.as<AnyTypeNode>()) {
       keys.push_back("ret");
-      values.push_back((ty->ret.as<tirx::BufferTypeNode>() ? TypeValue(d, ty->ret, false)
-                                                           : d->Translate(ty->ret).value()));
+      values.push_back(d->Translate(ty->ret).value());
     }
     if (ty->purity) {
       keys.push_back("purity");
@@ -132,20 +131,16 @@ ffi::Optional<ExprDoc> TranslateFuncType(DocTranslatorObj* d, ffi::AnyView input
                         : NamespaceDoc("relax")->Attr("Callable")->Call({}, keys, values);
   }
   ffi::Array<ExprDoc> params;
-  for (const Type& param : ty->params.value())
-    params.push_back((param.as<tirx::BufferTypeNode>() ? TypeValue(d, param, false)
-                                                       : d->Translate(param).value()));
+  for (const Type& param : ty->params.value()) params.push_back(d->Translate(param).value());
   return NamespaceDoc("relax")
       ->Attr("Callable")
-      ->Call({TupleDoc(params),
-              (ty->ret.as<tirx::BufferTypeNode>() ? TypeValue(d, ty->ret, false)
-                                                  : d->Translate(ty->ret).value()),
+      ->Call({TupleDoc(params), d->Translate(ty->ret).value(),
               LiteralDoc::Boolean(ty->purity, std::nullopt)});
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::FuncTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateFuncType>());
+      kDocTranslate, FDocTranslate::FromNative<&RelaxFuncTypeDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/distributed.cc b/src/relax/script/printer/distributed.cc
index d2530106a8..7c7b3e95a7 100644
--- a/src/relax/script/printer/distributed.cc
+++ b/src/relax/script/printer/distributed.cc
@@ -29,8 +29,8 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslatePlacement(DocTranslatorObj*, ffi::AnyView input,
-                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> PlacementDocTranslate(DocTranslatorObj*, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* placement = ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<
       const relax::distributed::PlacementNode>(input);
   return LiteralDoc::Str(placement->ToString(), std::nullopt);
@@ -38,11 +38,11 @@ ffi::Optional<ExprDoc> TranslatePlacement(DocTranslatorObj*, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::distributed::PlacementNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslatePlacement>());
+      kDocTranslate, FDocTranslate::FromNative<&PlacementDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateDTensorType(DocTranslatorObj* d, ffi::AnyView input,
-                                            const ffi::Object*) {
+ffi::Optional<ExprDoc> DTensorTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                               const ffi::Object*) {
   const auto* ty = ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<
       const relax::distributed::DTensorTypeNode>(input);
   ffi::Array<ExprDoc> args;
@@ -94,11 +94,11 @@ ffi::Optional<ExprDoc> TranslateDTensorType(DocTranslatorObj* d, ffi::AnyView in
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::distributed::DTensorTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateDTensorType>());
+      kDocTranslate, FDocTranslate::FromNative<&DTensorTypeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateDeviceMesh(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> DeviceMeshDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* mesh = ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<
       const relax::distributed::DeviceMeshNode>(input);
   ffi::Array<ExprDoc> dimensions;
@@ -120,7 +120,7 @@ ffi::Optional<ExprDoc> TranslateDeviceMesh(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::distributed::DeviceMeshNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateDeviceMesh>());
+      kDocTranslate, FDocTranslate::FromNative<&DeviceMeshDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/expr.cc b/src/relax/script/printer/expr.cc
index 9e299ae783..72c04f700a 100644
--- a/src/relax/script/printer/expr.cc
+++ b/src/relax/script/printer/expr.cc
@@ -29,7 +29,8 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateTuple(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> TupleDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                         const ffi::Object*) {
   const auto* tuple =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const TupleNode>(input);
   if (tuple->fields.empty()) return NamespaceDoc("relax")->Attr("tuple")->Call({});
@@ -40,11 +41,11 @@ ffi::Optional<ExprDoc> TranslateTuple(DocTranslatorObj* d, ffi::AnyView input, c
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<TupleNode>().attr(kDocTranslate,
-                                                 FDocTranslate::FromNative<&TranslateTuple>());
+                                                 FDocTranslate::FromNative<&TupleDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateTupleGetItem(DocTranslatorObj* d, ffi::AnyView input,
-                                             const ffi::Object*) {
+ffi::Optional<ExprDoc> TupleGetItemDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                const ffi::Object*) {
   const auto* item =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const TupleGetItemNode>(input);
   return d->Translate(item->tuple).value()[{LiteralDoc::Int(item->index, std::nullopt)}];
@@ -52,11 +53,11 @@ ffi::Optional<ExprDoc> TranslateTupleGetItem(DocTranslatorObj* d, ffi::AnyView i
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<TupleGetItemNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateTupleGetItem>());
+      kDocTranslate, FDocTranslate::FromNative<&TupleGetItemDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateRelaxShapeExpr(DocTranslatorObj* d, ffi::AnyView input,
-                                               const ffi::Object*) {
+ffi::Optional<ExprDoc> ShapeExprDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* shape =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::ShapeExprNode>(input);
   ffi::Array<ExprDoc> dimensions;
@@ -66,17 +67,17 @@ ffi::Optional<ExprDoc> TranslateRelaxShapeExpr(DocTranslatorObj* d, ffi::AnyView
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::ShapeExprNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateRelaxShapeExpr>());
+      kDocTranslate, FDocTranslate::FromNative<&ShapeExprDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateDataflowVar(DocTranslatorObj* d, ffi::AnyView input,
-                                            const ffi::Object* destination) {
-  return TranslateVar(d, input, destination);
+ffi::Optional<ExprDoc> DataflowVarDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                               const ffi::Object* destination) {
+  return VarDocTranslate(d, input, destination);
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::DataflowVarNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateDataflowVar>());
+      kDocTranslate, FDocTranslate::FromNative<&DataflowVarDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/function.cc b/src/relax/script/printer/function.cc
index 70e012bf1f..f0bf0e6405 100644
--- a/src/relax/script/printer/function.cc
+++ b/src/relax/script/printer/function.cc
@@ -24,6 +24,7 @@
 #include <utility>
 #include <vector>
 
+#include "../../../script/printer/dialect_prefix.h"
 #include "../../../script/printer/ir/utils.h"
 #include "utils.h"
 
@@ -34,8 +35,8 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> EmitRelaxFunction(DocTranslatorObj* d, ffi::AnyView input,
-                                         const ffi::Object* destination) {
+ffi::Optional<ExprDoc> FunctionDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object* destination) {
   const auto* func =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::FunctionNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -53,10 +54,10 @@ ffi::Optional<ExprDoc> EmitRelaxFunction(DocTranslatorObj* d, ffi::AnyView input
   for (const Var& param : func->params) {
     IdDoc lhs = param_ids[param_index++];
     ffi::Optional<ExprDoc> annotation = std::nullopt;
-    if (!param->ty.IsMissing())
-      annotation = (param->ty.as<tirx::BufferTypeNode>() ? TypeValue(d, param->ty, false)
-                                                         : d->Translate(param->ty).value());
-    args.push_back(AssignDoc(lhs, std::nullopt, annotation));
+    if (!param->ty.IsMissing()) annotation = d->Translate(param->ty).value();
+    AssignDoc argument(lhs, std::nullopt, annotation);
+    d->RecordOrigin(argument, param);
+    args.push_back(argument);
   }
   auto signature_candidates = CopyImplicitDefs(d);
   ffi::Optional<ExprDoc> ret_type = std::nullopt;
@@ -64,8 +65,7 @@ ffi::Optional<ExprDoc> EmitRelaxFunction(DocTranslatorObj* d, ffi::AnyView input
     if (auto tensor = func->ret_ty.as<relax::TensorTypeNode>()) {
       ret_type = RelaxTensorTypeDoc(d, tensor, true);
     } else {
-      ret_type = (func->ret_ty.as<tirx::BufferTypeNode>() ? TypeValue(d, func->ret_ty, false)
-                                                          : d->Translate(func->ret_ty).value());
+      ret_type = d->Translate(func->ret_ty).value();
     }
   }
   ffi::Array<ffi::String> decorator_keys;
@@ -115,12 +115,13 @@ ffi::Optional<ExprDoc> EmitRelaxFunction(DocTranslatorObj* d, ffi::AnyView input
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
+  RegisterDialectPrefix("relax.prefix", "R");
   ffi::reflection::TypeAttrDef<relax::FunctionNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitRelaxFunction>());
+      kDocTranslate, FDocTranslate::FromNative<&FunctionDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateExternFunc(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> ExternFuncDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* func =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::ExternFuncNode>(
           input);
@@ -143,7 +144,7 @@ ffi::Optional<ExprDoc> TranslateExternFunc(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::ExternFuncNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateExternFunc>());
+      kDocTranslate, FDocTranslate::FromNative<&ExternFuncDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/global_info.cc b/src/relax/script/printer/global_info.cc
index 09ac4f786c..57c0f26121 100644
--- a/src/relax/script/printer/global_info.cc
+++ b/src/relax/script/printer/global_info.cc
@@ -19,7 +19,6 @@
 
 #include <optional>
 #include <string>
-#include <unordered_map>
 
 #include "../../../script/printer/ir/utils.h"
 #include "utils.h"
@@ -34,16 +33,21 @@ using GlobalInfoMap = ffi::Dict<ffi::String, ffi::List<GlobalInfo>>;
 // Selectors are derived from the module's forward registry, never cached as
 // object-to-string state. Definitions and standalone objects keep constructors.
 ffi::Optional<ffi::String> GlobalInfoSelector(DocTranslatorObj* d, const GlobalInfo& info) {
-  auto infos = d->GetOrCreateExtraState<GlobalInfoMap>("ir.global_info_map");
-  if (auto devices = infos.Get("vdevice")) {
-    std::unordered_map<std::string, size_t> indices;
-    for (const GlobalInfo& entry : devices.value()) {
-      if (auto device = entry.as<relax::VDevice>()) {
-        std::string kind = device.value()->target->kind->name;
-        size_t index = indices[kind]++;
-        if (entry.same_as(info)) {
-          return ffi::String(kind + ":" + std::to_string(index) + ":" +
-                             std::string(device.value()->memory_scope));
+  auto scope = d->GetOrCreateExtraState<ffi::Optional<GlobalInfoMap>>("ir.global_info_map");
+  if (!scope.has_value()) return std::nullopt;
+  auto infos = scope.value();
+  if (auto query = info.as<relax::VDevice>()) {
+    if (auto devices = infos.Get("vdevice")) {
+      ffi::String kind = query.value()->target->kind->name;
+      size_t index = 0;
+      for (const GlobalInfo& entry : devices.value()) {
+        if (auto device = entry.as<relax::VDevice>();
+            device && device.value()->target->kind->name == kind) {
+          if (entry.same_as(info)) {
+            return ffi::String(std::string(kind) + ":" + std::to_string(index) + ":" +
+                               std::string(device.value()->memory_scope));
+          }
+          ++index;
         }
       }
     }
@@ -60,14 +64,14 @@ ffi::Optional<ffi::String> GlobalInfoSelector(DocTranslatorObj* d, const GlobalI
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateDummyGlobalInfo(DocTranslatorObj*, ffi::AnyView,
-                                                const ffi::Object*) {
+ffi::Optional<ExprDoc> DummyGlobalInfoDocTranslate(DocTranslatorObj*, ffi::AnyView,
+                                                   const ffi::Object*) {
   return NamespaceDoc("relax")->Attr("dummy_global_info")->Call({});
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::DummyGlobalInfoNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateDummyGlobalInfo>());
+      kDocTranslate, FDocTranslate::FromNative<&DummyGlobalInfoDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/region.cc b/src/relax/script/printer/region.cc
index 3944fb7de8..e5ba817f03 100644
--- a/src/relax/script/printer/region.cc
+++ b/src/relax/script/printer/region.cc
@@ -65,8 +65,8 @@ ffi::Array<StmtDoc> RelaxSeqBody(DocTranslatorObj* d, const relax::SeqExprNode*
 
 namespace {
 
-ffi::Optional<ExprDoc> EmitRelaxSeqExpr(DocTranslatorObj* d, ffi::AnyView input,
-                                        const ffi::Object* destination) {
+ffi::Optional<ExprDoc> SeqExprDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                           const ffi::Object* destination) {
   const auto* seq =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::SeqExprNode>(input);
   for (const relax::BindingBlock& block : seq->blocks) d->Translate(block);
@@ -75,10 +75,7 @@ ffi::Optional<ExprDoc> EmitRelaxSeqExpr(DocTranslatorObj* d, ffi::AnyView input,
       d->VarGetOrAllocId(var.value(), false);
       if (d->GetImplicitDefs().count(var.value()) && !var.value()->ty.as<PrimTypeNode>()) {
         IdDoc id = VarDoc(d, var.value());
-        d->Emit(AssignDoc(id, std::nullopt,
-                          (var.value()->ty.as<tirx::BufferTypeNode>()
-                               ? TypeValue(d, var.value()->ty, false)
-                               : d->Translate(var.value()->ty).value())),
+        d->Emit(AssignDoc(id, std::nullopt, d->Translate(var.value()->ty).value()),
                 ffi::GetRef<ffi::ObjectRef>(var.value().get()));
       }
     }
@@ -88,11 +85,11 @@ ffi::Optional<ExprDoc> EmitRelaxSeqExpr(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::SeqExprNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitRelaxSeqExpr>());
+      kDocTranslate, FDocTranslate::FromNative<&SeqExprDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitRelaxBindingBlock(DocTranslatorObj* d, ffi::AnyView input,
-                                             const ffi::Object* destination) {
+ffi::Optional<ExprDoc> BindingBlockDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                const ffi::Object* destination) {
   const auto* block =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::BindingBlockNode>(
           input);
@@ -104,11 +101,11 @@ ffi::Optional<ExprDoc> EmitRelaxBindingBlock(DocTranslatorObj* d, ffi::AnyView i
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::BindingBlockNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitRelaxBindingBlock>());
+      kDocTranslate, FDocTranslate::FromNative<&BindingBlockDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitRelaxDataflowBlock(DocTranslatorObj* d, ffi::AnyView input,
-                                              const ffi::Object* destination) {
+ffi::Optional<ExprDoc> DataflowBlockDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                 const ffi::Object* destination) {
   const auto* block =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const relax::DataflowBlockNode>(
           input);
@@ -133,7 +130,7 @@ ffi::Optional<ExprDoc> EmitRelaxDataflowBlock(DocTranslatorObj* d, ffi::AnyView
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::DataflowBlockNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitRelaxDataflowBlock>());
+      kDocTranslate, FDocTranslate::FromNative<&DataflowBlockDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/relax/script/printer/type.cc b/src/relax/script/printer/type.cc
index ccd231228a..ce5b01afd1 100644
--- a/src/relax/script/printer/type.cc
+++ b/src/relax/script/printer/type.cc
@@ -26,14 +26,14 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslatePackedFuncType(DocTranslatorObj*, ffi::AnyView,
-                                               const ffi::Object*) {
+ffi::Optional<ExprDoc> PackedFuncTypeDocTranslate(DocTranslatorObj*, ffi::AnyView,
+                                                  const ffi::Object*) {
   return NamespaceDoc("relax")->Attr("PackedFunc");
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<relax::PackedFuncTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslatePackedFuncType>());
+      kDocTranslate, FDocTranslate::FromNative<&PackedFuncTypeDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/script/printer/config.cc b/src/script/printer/config.cc
index d86f8ab84d..518f93bb91 100644
--- a/src/script/printer/config.cc
+++ b/src/script/printer/config.cc
@@ -59,6 +59,8 @@ void RegisterDialectPrefix(const ffi::String& key, const ffi::String& default_pr
       << "Duplicate printer dialect prefix: " << key;
 }
 
+const std::map<ffi::String, ffi::String>& GetDialectPrefixes() { return DialectPrefixes(); }
+
 }  // namespace printer
 }  // namespace script
 
@@ -86,7 +88,7 @@ PrinterConfig::PrinterConfig(ffi::Map<ffi::String, Any> config_dict) {
   }
   if (auto v = get("int_dtype")) {
     n->extra_config.Set(
-        "script.int_dtype",
+        "ir.int_dtype",
         ffi::DLDataTypeToString(ffi::StringToDLDataType(v.value().as_or_throw<ffi::String>())));
   }
   if (auto v = get("float_dtype")) {
@@ -130,9 +132,6 @@ PrinterConfig::PrinterConfig(ffi::Map<ffi::String, Any> config_dict) {
   if (auto v = get("syntax_sugar")) {
     n->syntax_sugar = v.value().cast<bool>();
   }
-  if (auto v = get("show_object_address")) {
-    n->show_object_address = v.value().cast<bool>();
-  }
   if (auto v = get("render_invisible_path_info")) {
     n->render_invisible_path_info = v.value().cast<bool>();
   }
@@ -152,10 +151,12 @@ PrinterConfig::PrinterConfig(ffi::Map<ffi::String, Any> config_dict) {
     }
   }
 
+  n->extra_config.Set("ir.prefix", n->ir_prefix);
+
   // Keep legacy constructor arguments as adapters; explicit extra_config values
   // take precedence. Store validated dtype strings with the existing defaults.
   for (const auto& [key, fallback] :
-       {std::pair{"script.int_dtype", "int32"}, std::pair{"script.float_dtype", "void"}}) {
+       {std::pair{"ir.int_dtype", "int32"}, std::pair{"script.float_dtype", "void"}}) {
     ffi::String value = n->GetExtraConfig<ffi::String>(key, fallback);
     n->extra_config.Set(key, ffi::DLDataTypeToString(ffi::StringToDLDataType(value)));
   }
diff --git a/src/script/printer/dialect_prefix.h b/src/script/printer/dialect_prefix.h
index c656e33243..0eac91b5ea 100644
--- a/src/script/printer/dialect_prefix.h
+++ b/src/script/printer/dialect_prefix.h
@@ -21,6 +21,8 @@
 
 #include <tvm/ffi/string.h>
 
+#include <map>
+
 namespace tvm {
 namespace script {
 namespace printer {
@@ -29,6 +31,9 @@ namespace printer {
 // and reserve the prefix before translation assigns variable names.
 void RegisterDialectPrefix(const ffi::String& key, const ffi::String& default_prefix);
 
+// Read the existing registration table without introducing a second namespace registry.
+const std::map<ffi::String, ffi::String>& GetDialectPrefixes();
+
 }  // namespace printer
 }  // namespace script
 }  // namespace tvm
diff --git a/src/script/printer/doc_printer.cc b/src/script/printer/doc_printer.cc
index 2b2fc495c3..7ab6ed8387 100644
--- a/src/script/printer/doc_printer.cc
+++ b/src/script/printer/doc_printer.cc
@@ -41,6 +41,7 @@
 
 #include "../../support/str_escape.h"
 #include "../../support/utils.h"
+#include "dialect_prefix.h"
 
 namespace tvm {
 namespace script {
@@ -1177,17 +1178,12 @@ void PythonDocPrinter::PrintTypedDoc(const IdDoc& doc) { output_ << doc->name; }
 
 void PythonDocPrinter::PrintTypedDoc(const NamespaceDoc& doc) {
   const ffi::String& name = doc->canonical_name;
-  if (name == "ir") {
-    output_ << config()->ir_prefix;
-  } else if (name == "tirx") {
-    output_ << config()->GetExtraConfig<ffi::String>("tirx.prefix", "T");
-  } else if (name == "s_tir") {
-    output_ << config()->GetExtraConfig<ffi::String>("s_tir.prefix", "Ts");
-  } else if (name == "relax") {
-    output_ << config()->GetExtraConfig<ffi::String>("relax.prefix", "R");
-  } else {
-    TVM_FFI_THROW(ValueError) << "Unknown canonical TVMScript namespace: " << name;
-  }
+  ffi::String key = std::string(name) + ".prefix";
+  const auto& prefixes = GetDialectPrefixes();
+  auto registered = prefixes.find(key);
+  ffi::String fallback = registered == prefixes.end() ? name : registered->second;
+  output_ << (name == "ir" ? config()->ir_prefix
+                           : config()->GetExtraConfig<ffi::String>(key, fallback));
 }
 
 void PythonDocPrinter::PrintTypedDoc(const AttrAccessDoc& doc) {
diff --git a/src/script/printer/doc_translator.cc b/src/script/printer/doc_translator.cc
index 19d5a76c65..8fbeef3e12 100644
--- a/src/script/printer/doc_translator.cc
+++ b/src/script/printer/doc_translator.cc
@@ -19,34 +19,19 @@
 
 #include <tvm/ffi/extra/json.h>
 #include <tvm/ffi/extra/serialization.h>
-#include <tvm/ffi/extra/structural_visit.h>
-#include <tvm/ffi/reflection/accessor.h>
 #include <tvm/ffi/reflection/registry.h>
-#include <tvm/ir/module.h>
-#include <tvm/ir/prim/expr.h>
-#include <tvm/relax/expr.h>
 #include <tvm/runtime/base.h>
-#include <tvm/s_tir/stmt.h>
 #include <tvm/script/printer/doc.h>
 #include <tvm/script/printer/doc_translator.h>
-#include <tvm/te/operation.h>
-#include <tvm/tirx/function.h>
-#include <tvm/tirx/index_map.h>
-#include <tvm/tirx/stmt.h>
-#include <tvm/tirx/tile_primitive.h>
-#include <tvm/tirx/var.h>
 
 #include <algorithm>
 #include <cctype>
-#include <functional>
-#include <sstream>
 #include <string>
-#include <unordered_map>
 #include <unordered_set>
 #include <utility>
 #include <vector>
 
-#include "ir/utils.h"
+#include "dialect_prefix.h"
 
 namespace tvm {
 namespace script {
@@ -59,58 +44,23 @@ namespace {
 struct VariableEnvironment {
   ffi::Dict<Var, IdDoc> mapped;
   ffi::Dict<Var, IdDoc> implicit_defs;
-  std::unordered_set<std::string> allocated{
-      "range", "False", "None",     "True",  "and",    "as",   "assert", "async",  "await",
-      "break", "class", "continue", "def",   "del",    "elif", "else",   "except", "finally",
-      "for",   "from",  "global",   "if",    "import", "in",   "is",     "lambda", "nonlocal",
-      "not",   "or",    "pass",     "raise", "return", "try",  "while",  "with",   "yield"};
+  VariableEnvironment()
+      : allocated{"range",  "False",   "None",     "True",     "and",    "as",   "assert", "async",
+                  "await",  "break",   "class",    "continue", "def",    "del",  "elif",   "else",
+                  "except", "finally", "for",      "from",     "global", "if",   "import", "in",
+                  "is",     "lambda",  "nonlocal", "not",      "or",     "pass", "raise",  "return",
+                  "try",    "while",   "with",     "yield"} {}
+  std::unordered_set<std::string> allocated;
 };
 
-// The engine owns bindings and their lexical undo records; hooks only allocate
-// or promote variables. Reservations survive block exits until function exit.
+// Bindings and reservations stay stable within each function naming region.
 class TranslationEngine : public DocTranslatorObj {
  public:
-  TranslationEngine() : DocTranslatorObj(VTable()) {}
+  explicit TranslationEngine(ffi::Map<ffi::String, ffi::Any> config)
+      : DocTranslatorObj(VTable(), std::move(config)) {}
 
-  static ffi::Optional<ExprDoc> TranslateValue(DocTranslatorObj* d, ffi::AnyView value,
-                                               const ffi::Object* destination) {
-    auto* self = static_cast<TranslationEngine*>(d);
-    const ffi::Object* node = value.as<ffi::Object>();
-    bool scoped =
-        node &&
-        (node->IsInstance<tirx::ForNode>() || node->IsInstance<tirx::WhileNode>() ||
-         node->IsInstance<tirx::IfThenElseNode>() || node->IsInstance<tirx::AttrStmtNode>() ||
-         node->IsInstance<prim::LetNode>() || node->IsInstance<tirx::LambdaExprNode>() ||
-         node->IsInstance<tirx::IndexMapNode>() || node->IsInstance<te::CommReducerNode>() ||
-         node->IsInstance<te::ReduceNode>() || node->IsInstance<s_tir::SBlockNode>() ||
-         node->IsInstance<s_tir::SBlockRealizeNode>());
-    // Each branch gets its own lifetime; SeqStmt itself stays transparent.
-    if (!self->active_nodes_.empty()) {
-      if (auto branch = self->active_nodes_.back().as<tirx::IfThenElseNode>())
-        scoped = scoped || node == branch->then_case.get() ||
-                 (branch->else_case.has_value() && node == branch->else_case.value().get());
-      if (auto branch = self->active_nodes_.back().as<relax::IfNode>())
-        scoped = scoped || node == branch->true_branch.get() || node == branch->false_branch.get();
-    }
-    size_t scope = self->var_scopes_.size() - 1;
-    if (scoped) self->binding_undos_.push_back({scope, {}, {}});
-    self->active_nodes_.push_back(value);
-    ffi::Optional<ExprDoc> result;
-    try {
-      result = d->DefaultTranslate(value, destination);
-    } catch (...) {
-      self->active_nodes_.pop_back();
-      if (scoped) {
-        try {
-          self->RestoreBindings();
-        } catch (...) { /* Preserve the original error. */
-        }
-      }
-      throw;
-    }
-    self->active_nodes_.pop_back();
-    if (scoped) self->RestoreBindings();
-    return result;
+  void InitializeConfig(ffi::Map<ffi::String, ffi::Any> config) {
+    InitializeExtraConfig(std::move(config));
   }
 
   static IdDoc Allocate(DocTranslatorObj* d, ffi::AnyView value) {
@@ -139,29 +89,11 @@ class TranslationEngine : public DocTranslatorObj {
       if (found == frame.mapped.end()) continue;
       IdDoc id = (*found).second;
       if (explicit_def) {
-        self->RememberBinding(i - 1, var);
         frame.implicit_defs.erase(var);
       }
       return id;
     }
-    size_t current = self->var_scopes_.size() - 1;
-    if (explicit_def)
-      self->RememberBinding(current, var);
-    else {
-      for (auto undo = self->binding_undos_.rbegin(); undo != self->binding_undos_.rend(); ++undo) {
-        if (undo->scope == current) {
-          undo->created_implicit.insert(var.get());
-        }
-      }
-    }
-    ffi::String hint = var->name;
-    if (var->ty.as<tirx::BufferTypeNode>() && (hint.empty() || hint == "v")) hint = "buffer";
-    if (self->GetExtraConfig<bool>("script.show_object_address", false)) {
-      std::ostringstream stream;
-      stream << hint << "_" << var.get();
-      hint = stream.str();
-    }
-    IdDoc id = Allocate(d, hint);
+    IdDoc id = Allocate(d, var->name);
     auto& frame = self->var_scopes_.back();
     frame.mapped.Set(var, id);
     if (!explicit_def) frame.implicit_defs.Set(var, id);
@@ -177,70 +109,18 @@ class TranslationEngine : public DocTranslatorObj {
     auto* self = static_cast<TranslationEngine*>(d);
     TVM_FFI_CHECK(self->var_scopes_.size() > 1, ValueError)
         << "printer cannot pop the root variable scope";
-    // Scalar state is keyed by stable IdDoc. Remove only bindings owned here;
-    // captured outer bindings and whole-output accumulators remain untouched.
-    auto scalars =
-        self->GetOrCreateExtraState<ffi::Dict<IdDoc, bool>>("tirx.buffer_as_mutable_var");
-    for (const auto& [var, id] : self->var_scopes_.back().mapped) scalars.erase(id);
+    auto& local = self->var_scopes_.back();
+    auto& parent = self->var_scopes_[self->var_scopes_.size() - 2];
+    // Unbound references remain captures of the enclosing naming region.
+    for (const auto& [var, id] : local.implicit_defs) {
+      parent.mapped.Set(var, id);
+      parent.implicit_defs.Set(var, id);
+      parent.allocated.insert(id->name);
+    }
     self->var_scopes_.pop_back();
   }
 
  private:
-  struct SavedBinding {
-    Var var;
-    ffi::Optional<IdDoc> id;
-    bool implicit;
-    ffi::Optional<bool> scalar_spelling;
-  };
-  struct BindingUndo {
-    size_t scope;
-    std::vector<SavedBinding> saved;
-    std::unordered_set<const ffi::Object*> created_implicit;
-  };
-  void RememberBinding(size_t scope, const Var& var) {
-    for (auto undo = binding_undos_.rbegin(); undo != binding_undos_.rend(); ++undo) {
-      if (undo->scope != scope) continue;
-      for (const auto& saved : undo->saved)
-        if (saved.var.same_as(var)) return;
-      auto& frame = var_scopes_[scope];
-      auto previous = frame.mapped.find(var);
-      bool introduced_here = undo->created_implicit.count(var.get());
-      ffi::Optional<IdDoc> old_id = previous == frame.mapped.end() || introduced_here
-                                        ? ffi::Optional<IdDoc>(std::nullopt)
-                                        : (*previous).second;
-      ffi::Optional<bool> scalar_spelling = std::nullopt;
-      auto scalars = GetOrCreateExtraState<ffi::Dict<IdDoc, bool>>("tirx.buffer_as_mutable_var");
-      if (old_id.has_value() && scalars.count(old_id.value()))
-        scalar_spelling = scalars[old_id.value()];
-      undo->saved.push_back(
-          {var, old_id, !introduced_here && frame.implicit_defs.count(var) != 0, scalar_spelling});
-      return;
-    }
-  }
-  void RestoreBindings() {
-    BindingUndo undo = std::move(binding_undos_.back());
-    binding_undos_.pop_back();
-    auto& frame = var_scopes_[undo.scope];
-    auto scalars = GetOrCreateExtraState<ffi::Dict<IdDoc, bool>>("tirx.buffer_as_mutable_var");
-    for (auto saved = undo.saved.rbegin(); saved != undo.saved.rend(); ++saved) {
-      if (saved->id.has_value()) {
-        frame.mapped.Set(saved->var, saved->id.value());
-        if (saved->scalar_spelling.has_value())
-          scalars.Set(saved->id.value(), saved->scalar_spelling.value());
-        else
-          scalars.erase(saved->id.value());
-        if (saved->implicit)
-          frame.implicit_defs.Set(saved->var, saved->id.value());
-        else
-          frame.implicit_defs.erase(saved->var);
-      } else {
-        auto current = frame.mapped.find(saved->var);
-        if (current != frame.mapped.end()) scalars.erase((*current).second);
-        frame.mapped.erase(saved->var);
-        frame.implicit_defs.erase(saved->var);
-      }
-    }
-  }
   template <typename Signature, auto Function>
   static auto Adapter() {
     using View = ffi::reflection::NativeFunctionView<Signature>;
@@ -250,7 +130,9 @@ class TranslationEngine : public DocTranslatorObj {
   static const DocTranslatorVTable* VTable() {
     static const DocTranslatorVTable table{
         Adapter<ffi::Optional<ExprDoc>(DocTranslatorObj*, ffi::AnyView, const ffi::Object*),
-                &TranslateValue>(),
+                [](DocTranslatorObj* d, ffi::AnyView value, const ffi::Object* destination) {
+                  return d->DefaultTranslate(value, destination);
+                }>(),
         Adapter<IdDoc(DocTranslatorObj*, ffi::AnyView), &Allocate>(),
         Adapter<IdDoc(DocTranslatorObj*, ffi::AnyView, bool), &GetOrAllocate>(),
         Adapter<ffi::Dict<Var, IdDoc>(DocTranslatorObj*), &ImplicitDefinitions>(),
@@ -260,300 +142,29 @@ class TranslationEngine : public DocTranslatorObj {
   }
   /*! \brief Owned variable environments, with a persistent root scope. */
   std::vector<VariableEnvironment> var_scopes_{1};
-  /*! \brief Binding changes restored when each lexical region ends. */
-  std::vector<BindingUndo> binding_undos_;
-  /*! \brief Owning references to inputs on the active translation stack. */
-  std::vector<ffi::Any> active_nodes_;
 };
 
-class DocTranslationEngine : public TranslationEngine {
- public:
-  DocTranslationEngine(ffi::AnyView root, ffi::Map<ffi::String, ffi::Any> config)
-      : TranslationEngine(), root_(root) {
-    InitializeConfig(std::move(config));
-    use_pep695_ = (root.as<relax::FunctionNode>() || root.as<tirx::PrimFuncNode>()) &&
-                  GetExtraConfig<bool>("script.use_pep695", false);
-    if (auto branch = root.as<relax::IfNode>()) {
-      for (const relax::SeqExpr& arm : {branch->true_branch, branch->false_branch}) {
-        if (auto var = arm->body.as<VarNode>(); var && !arm->body.same_as(branch->cond)) {
-          branch_local_.insert(var);
-        }
-      }
-    }
-    std::unordered_set<const ffi::Object*> ancestors;
-    CollectObjects(root, &ancestors);
-  }
-
-  bool UsePEP695() const { return use_pep695_; }
-
-  void InitializeConfig(ffi::Map<ffi::String, ffi::Any> config) {
-    InitializeExtraConfig(std::move(config));
-  }
-
-  void DeclareFreeVariables() {
-    std::unordered_set<const ffi::Object*> defined = branch_local_;
-    for (const auto& object : objects_) {
-      if (auto bind = object.as<tirx::BindNode>()) defined.insert(bind->var.get());
-      if (auto scope = object.as<tirx::ScopeIdDefStmtNode>()) {
-        for (const PrimVar& var : scope->def->def_ids) defined.insert(var.get());
-      }
-      if (auto loop = object.as<tirx::ForNode>()) defined.insert(loop->loop_var.get());
-      if (auto attr = object.as<tirx::AttrStmtNode>()) {
-        if (attr->attr_key == "thread_extent" || attr->attr_key == tirx::attr::virtual_thread) {
-          if (auto iter = attr->node.as<tirx::IterVar>()) defined.insert(iter.value()->var.get());
-        }
-      }
-      if (auto func = object.as<tirx::PrimFuncNode>()) {
-        for (const auto& var : func->params) defined.insert(var.get());
-      }
-      if (auto lambda = object.as<tirx::LambdaExprNode>()) {
-        for (const auto& var : lambda->vars) defined.insert(var.get());
-      }
-      if (auto let = object.as<prim::LetNode>()) defined.insert(let->var.get());
-      if (auto reducer = object.as<te::CommReducerNode>()) {
-        for (const auto& var : reducer->lhs) defined.insert(var.get());
-        for (const auto& var : reducer->rhs) defined.insert(var.get());
-      }
-      if (auto reduce = object.as<te::ReduceNode>()) {
-        for (const auto& axis : reduce->axis) defined.insert(axis->var.get());
-      }
-      if (auto func = object.as<relax::FunctionNode>()) {
-        for (const auto& var : func->params) defined.insert(var.get());
-      }
-      if (auto binding = object.as<relax::BindingNode>()) {
-        defined.insert(binding->var.get());
-      }
-      if (auto block = object.as<s_tir::SBlockNode>()) {
-        for (const auto& iter : block->iter_vars) defined.insert(iter->var.get());
-        for (const auto& buffer : block->alloc_buffers) defined.insert(buffer.get());
-        for (const auto& match : block->match_buffers) defined.insert(match->buffer.get());
-      }
-    }
-    // Classification remains translation-owned for genuinely external captures. A
-    // parameter type is a pattern region: its unresolved variables belong to
-    // the function's live implicit collection, not this external prelude.
-    std::unordered_set<const ffi::Object*> signature_vars;
-    std::unordered_map<const ffi::Object*, size_t> signature_owners;
-    auto collect_signature = [&](const ffi::Array<Var>& params) {
-      std::unordered_set<const ffi::Object*> in_signature;
-      for (const Var& param : params) {
-        ffi::StructuralWalk<ffi::WalkOrder::kPreOrder>(
-            param->ty, [&](const Var& var) -> ffi::Expected<ffi::WalkResult> {
-              in_signature.insert(var.get());
-              return ffi::WalkResult::Advance();
-            });
-      }
-      for (const auto* var : in_signature) ++signature_owners[var];
-    };
-    for (const auto& object : objects_) {
-      if (auto func = object.as<tirx::PrimFuncNode>()) collect_signature(func->params);
-      if (auto func = object.as<relax::FunctionNode>()) collect_signature(func->params);
-    }
-    // Module-level symbols can be shared across function signatures. Keep
-    // their identity in the root frame; only one-owner function patterns are
-    // left to function-local inference and eligible PEP headers.
-    if (!root_.as<IRModuleNode>()) {
-      for (const auto& [var, owners] : signature_owners)
-        if (owners == 1) signature_vars.insert(var);
-    }
-    std::vector<Var> free_vars;
-    std::unordered_set<const ffi::Object*> allocated;
-    for (const auto& object : objects_) {
-      if (auto var = object.as<VarNode>(); var && !defined.count(var)) {
-        if (signature_vars.count(var) || !allocated.insert(var).second) continue;
-        if (var->ty.as<tirx::BufferTypeNode>()) continue;
-        Var binding = ffi::GetRef<Var>(var);
-        VarGetOrAllocId(binding, true);
-        free_vars.push_back(binding);
-      }
-    }
-    // Preserve first-use order while declaring variables referenced by a
-    // free variable's type before that variable.  Grouping all scalar shape
-    // variables at the top changes the visible order of independent Relax
-    // variables and loses the parser's expected declaration grouping.
-    std::unordered_map<const ffi::Object*, Var> free_by_object;
-    for (const Var& var : free_vars) free_by_object.emplace(var.get(), var);
-    std::unordered_set<const ffi::Object*> ordered_objects;
-    std::unordered_set<const ffi::Object*> active;
-    std::vector<Var> ordered;
-    std::function<void(const Var&)> visit;
-    std::function<void(ffi::AnyView)> visit_type = [&](ffi::AnyView value) {
-      const ffi::Object* object = value.as<ffi::Object>();
-      if (!object) return;
-      if (auto var = value.as<VarNode>()) {
-        auto it = free_by_object.find(var);
-        if (it == free_by_object.end() && !defined.count(var)) {
-          Var dependency = ffi::GetRef<Var>(var);
-          VarGetOrAllocId(dependency, true);
-          it = free_by_object.emplace(var, dependency).first;
-        }
-        if (it != free_by_object.end()) visit(it->second);
-        return;
-      }
-      if (!active.insert(object).second) return;
-      if (auto array = value.as<ffi::Array<ffi::Any>>()) {
-        for (const ffi::Any& child : *array) visit_type(child);
-      } else if (auto map = value.as<ffi::Map<ffi::Any, ffi::Any>>()) {
-        for (const auto& [key, child] : *map) {
-          visit_type(key);
-          visit_type(child);
-        }
-      } else {
-        ffi::reflection::ForEachFieldInfo(TVMFFIGetTypeInfo(object->type_index()),
-                                          [&](const TVMFFIFieldInfo* field) {
-                                            visit_type(ffi::reflection::FieldGetter(field)(object));
-                                          });
-      }
-      active.erase(object);
-    };
-    visit = [&](const Var& var) {
-      if (!ordered_objects.insert(var.get()).second) return;
-      visit_type(var->ty);
-      ordered.push_back(var);
-    };
-    // The index may encounter shape variables through a cached type before
-    // it reaches the value that uses that type.  Start with non-scalar roots,
-    // then emit any independent scalar roots in their original order.
-    for (const Var& var : free_vars) {
-      if (!var->ty.as<PrimType>()) visit(var);
-    }
-    for (const Var& var : free_vars) {
-      if (var->ty.as<PrimType>()) visit(var);
-    }
-    for (const Var& var : ordered) {
-      IdDoc id = IdDoc(VarGetOrAllocId(var, true)->name);
-      RecordOrigin(id, var);
-      if (auto ty = var->ty.as<PrimType>()) {
-        ExprDoc creation = NamespaceDoc("ir")->Attr("dynamic")->Call(
-            {LiteralDoc::Str(var->name, std::nullopt)}, {"dtype"},
-            {LiteralDoc::DataType(ty.value()->dtype, std::nullopt)});
-        Emit(AssignDoc(id, creation, std::nullopt), var);
-      } else {
-        TVM_FFI_CHECK(!var->ty.IsMissing(), TypeError)
-            << "printer free non-scalar variable requires a type annotation";
-        ExprDoc annotation = Translate(var->ty).value();
-        ffi::Optional<ExprDoc> initializer = std::nullopt;
-        if (var->ty.as<PointerTypeNode>()) {
-          // An outer Python annotation does not bind the free pointer variable.
-          initializer = annotation.as<CallDoc>() ? annotation : annotation->Call({});
-        }
-        Emit(AssignDoc(id, initializer, annotation), var);
-      }
-    }
-  }
-
-  ffi::List<Doc> DeclarePendingVariables() {
-    return WithDocScope([&]() {
-      auto pending = GetImplicitDefs();
-      std::function<void(const Var&)> declare = [&](const Var& var) {
-        if (!pending.count(var)) return;
-        IdDoc id = IdDoc(VarGetOrAllocId(var, true)->name);
-        RecordOrigin(id, var);
-        ffi::Optional<ExprDoc> rhs = std::nullopt;
-        ffi::Optional<ExprDoc> annotation = std::nullopt;
-        if (auto primitive = var->ty.as<PrimType>()) {
-          rhs = NamespaceDoc("ir")->Attr("dynamic")->Call(
-              {LiteralDoc::Str(var->name, std::nullopt)}, {"dtype"},
-              {LiteralDoc::DataType(primitive.value()->dtype, std::nullopt)});
-        } else {
-          TVM_FFI_CHECK(!var->ty.IsMissing(), TypeError)
-              << "printer free non-scalar variable requires a type annotation";
-          annotation = Translate(var->ty).value();
-        }
-        ffi::StructuralWalk<ffi::WalkOrder::kPreOrder>(
-            var->ty, [&](const Var& dependency) -> ffi::Expected<ffi::WalkResult> {
-              declare(dependency);
-              return ffi::WalkResult::Advance();
-            });
-        Emit(AssignDoc(id, rhs, annotation), var);
-      };
-      ffi::Dict<Var, IdDoc> candidates;
-      for (const auto& [var, id] : pending) candidates.Set(var, id);
-      std::vector<std::pair<Var, IdDoc>> ordered(candidates.begin(), candidates.end());
-      std::sort(ordered.begin(), ordered.end(),
-                [](const auto& a, const auto& b) { return a.second->name < b.second->name; });
-      for (const auto& [var, id] : ordered) declare(var);
-    });
-  }
-
- private:
-  void CollectObjects(ffi::AnyView value, std::unordered_set<const ffi::Object*>* ancestors) {
-    const ffi::Object* object = value.as<ffi::Object>();
-    if (!object || !ancestors->insert(object).second) return;
-    ffi::ObjectRef ref = ffi::GetRef<ffi::ObjectRef>(object);
-    objects_.push_back(ref);
-    if (auto array = value.as<ffi::Array<ffi::Any>>()) {
-      for (size_t i = 0; i < array->size(); ++i) CollectObjects((*array)[i], ancestors);
-    } else if (auto map = value.as<ffi::Map<ffi::Any, ffi::Any>>()) {
-      std::vector<std::pair<ffi::Any, ffi::Any>> entries(map->begin(), map->end());
-      // Match the module parent's canonical member order when collecting free
-      // declarations. Hash iteration must not choose their allocated names.
-      if (std::all_of(entries.begin(), entries.end(),
-                      [](const auto& item) { return item.first.template as<GlobalVarNode>(); })) {
-        std::sort(entries.begin(), entries.end(), [](const auto& a, const auto& b) {
-          return a.first.template as<GlobalVarNode>()->name_hint <
-                 b.first.template as<GlobalVarNode>()->name_hint;
-        });
-      }
-      for (const auto& [key, child] : entries) CollectObjects(child, ancestors);
-    } else {
-      ffi::reflection::ForEachFieldInfo(
-          TVMFFIGetTypeInfo(object->type_index()), [&](const TVMFFIFieldInfo* field) {
-            CollectObjects(ffi::reflection::FieldGetter(field)(object), ancestors);
-          });
-    }
-    ancestors->erase(object);
-  }
-
-  /*! \brief Original input retained throughout translation. */
-  ffi::Any root_;
-  /*! \brief Whether root signatures may use PEP 695 parameters. */
-  bool use_pep695_{false};
-  /*! \brief Borrowed identities local to a root Relax conditional. */
-  std::unordered_set<const ffi::Object*> branch_local_;
-  /*! \brief Original objects in deterministic occurrence order. */
-  std::vector<ffi::ObjectRef> objects_;
-};
-
-details::TranslationResult TranslateComplete(ffi::AnyView obj, DocTranslationEngine* engine,
+details::TranslationResult TranslateComplete(ffi::AnyView obj, TranslationEngine* engine,
                                              ffi::Map<ffi::String, ffi::Any> extra_config) {
   auto binding_names = engine->GetExtraConfig<ffi::Array<ffi::String>>("script.binding_names", {});
-  extra_config.Set("script.root_module", obj.as<IRModuleNode>() != nullptr);
-  // Namespace names are reserved through the ordinary identifier allocator.
-  engine->AllocId(engine->GetExtraConfig<ffi::String>("ir.prefix", "I"));
-  engine->AllocId(engine->GetExtraConfig<ffi::String>("tirx.prefix", "T"));
-  engine->AllocId(engine->GetExtraConfig<ffi::String>("s_tir.prefix", "Ts"));
-  engine->AllocId(engine->GetExtraConfig<ffi::String>("relax.prefix", "R"));
-  if (obj.as<IRModuleNode>()) {
-    ffi::String module_name =
-        binding_names.empty() ? engine->GetExtraConfig<ffi::String>("script.module_name", "Module")
-                              : binding_names.back();
-    extra_config.Set("script.module_name", module_name);
-    engine->AllocId(module_name);
+  // Reserve the same registered or explicitly configured aliases used by rendering.
+  for (const auto& [key, fallback] : GetDialectPrefixes()) {
+    if (!extra_config.count(key)) extra_config.Set(key, fallback);
+  }
+  for (const auto& [key, value] : extra_config) {
+    std::string option = key;
+    if (option.size() >= 7 && option.compare(option.size() - 7, 7, ".prefix") == 0)
+      engine->AllocId(value.cast<ffi::String>());
   }
+  for (const ffi::String& name : binding_names) engine->AllocId(name);
   // Allocate generated names after all configured names. A dialect or module
   // named tvm/metadata must not shadow the loader or metadata registry.
   IdDoc metadata_id = engine->AllocId("metadata");
   IdDoc metadata_loader = engine->AllocId("tvm");
   extra_config.Set("script.metadata_name", metadata_id->name);
-  extra_config.Set("script.use_pep695", engine->UsePEP695());
-  extra_config.Set("script.syntax_sugar",
-                   engine->GetExtraConfig<bool>("script.syntax_sugar", true));
-  extra_config.Set("script.show_meta", engine->GetExtraConfig<bool>("script.show_meta", true));
-  extra_config.Set("script.buffer_dtype",
-                   ffi::DLDataTypeToString(ffi::StringToDLDataType(
-                       engine->GetExtraConfig<ffi::String>("script.buffer_dtype", "float32"))));
-  extra_config.Set("script.show_object_address",
-                   engine->GetExtraConfig<bool>("script.show_object_address", false));
   engine->InitializeConfig(std::move(extra_config));
   auto docs = engine->WithDocScope([&]() {
-    engine->DeclareFreeVariables();
-    ffi::Optional<ExprDoc> expression = std::nullopt;
-    if (auto type = obj.as<tirx::BufferType>()) {
-      expression = details::TypeValue(engine, type.value(), false);
-    } else {
-      expression = engine->Translate(obj);
-    }
+    ffi::Optional<ExprDoc> expression = engine->Translate(obj);
     if (expression.has_value()) {
       if (!engine->GetExtraConfig<bool>("script.verbose_expr", true))
         engine->CurrentScopeDocs().clear();
@@ -563,19 +174,24 @@ details::TranslationResult TranslateComplete(ffi::AnyView obj, DocTranslationEng
       Doc root = engine->CurrentScopeDocs().back();
       ffi::String name = binding_names.back();
       if (auto function = root.as<FunctionDoc>()) {
-        if (auto func = obj.as<tirx::PrimFunc>()) {
-          if (auto symbol = func.value()->GetAttr<ffi::String>(tvm::attr::kGlobalSymbol)) {
-            TVM_FFI_CHECK(symbol.value() == name, TypeError)
-                << "printer PrimFunc global_symbol must match its definition name";
-          }
-        }
         function.value()->name = IdDoc(name);
       } else if (auto module = root.as<ClassDoc>()) {
         module.value()->name = IdDoc(name);
       }
     }
   });
-  auto root_declarations = engine->DeclarePendingVariables();
+  auto root_declarations = engine->WithDocScope([&]() {
+    auto pending = engine->GetImplicitDefs();
+    std::vector<std::pair<Var, IdDoc>> remaining(pending.begin(), pending.end());
+    std::sort(remaining.begin(), remaining.end(),
+              [](const auto& a, const auto& b) { return a.second->name < b.second->name; });
+    for (const auto& [var, _] : remaining) {
+      if (!pending.count(var)) continue;
+      if (auto rhs = engine->Translate(var, var.get())) {
+        engine->Emit(AssignDoc(engine->VarGetOrAllocId(var, true), rhs.value(), std::nullopt), var);
+      }
+    }
+  });
   if (!root_declarations.empty()) {
     for (const Doc& doc : docs) root_declarations.push_back(doc);
     docs = root_declarations;
@@ -618,7 +234,7 @@ details::TranslationResult TranslateComplete(ffi::AnyView obj, DocTranslationEng
 namespace details {
 TranslationResult TranslateWithOptions(ffi::AnyView ir,
                                        ffi::Map<ffi::String, ffi::Any> extra_config) {
-  auto engine = ffi::make_object<DocTranslationEngine>(ir, extra_config);
+  auto engine = ffi::make_object<TranslationEngine>(extra_config);
   return TranslateComplete(ir, engine.get(), std::move(extra_config));
 }
 }  // namespace details
diff --git a/src/script/printer/ir/ir.cc b/src/script/printer/ir/ir.cc
index 19b1fac578..0e71b9cbf2 100644
--- a/src/script/printer/ir/ir.cc
+++ b/src/script/printer/ir/ir.cc
@@ -26,6 +26,7 @@
 #include <utility>
 #include <vector>
 
+#include "../dialect_prefix.h"
 #include "utils.h"
 
 namespace tvm {
@@ -64,12 +65,16 @@ class GlobalInfoScope {
   std::optional<ffi::Any> saved_;
 };
 
-ffi::Optional<ExprDoc> EmitModule(DocTranslatorObj* d, ffi::AnyView input,
-                                  const ffi::Object* destination) {
+ffi::Optional<ExprDoc> IRModuleDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object* destination) {
   const auto* mod =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const IRModuleNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
       << "printer statement-only node cannot fulfill a destination";
+  auto names = d->GetExtraConfig<ffi::Array<ffi::String>>("script.binding_names", {});
+  ffi::String module_name =
+      names.empty() ? d->GetExtraConfig<ffi::String>("script.module_name", "Module") : names.back();
+  d->AllocId(module_name);
   GlobalInfoScope global_infos(d, mod);
   std::vector<std::pair<GlobalVar, BaseFunc>> functions(mod->functions.begin(),
                                                         mod->functions.end());
@@ -148,19 +153,20 @@ ffi::Optional<ExprDoc> EmitModule(DocTranslatorObj* d, ffi::AnyView input,
     }
   });
   global_infos.Close();
-  d->Emit(ClassDoc(IdDoc(d->GetExtraConfig<ffi::String>("script.module_name", "Module")),
-                   {NamespaceDoc("ir")->Attr("ir_module")}, ToStmtDocArray(body)),
-          ffi::GetRef<ffi::ObjectRef>(mod));
+  d->Emit(
+      ClassDoc(IdDoc(module_name), {NamespaceDoc("ir")->Attr("ir_module")}, ToStmtDocArray(body)),
+      ffi::GetRef<ffi::ObjectRef>(mod));
   return std::nullopt;
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<IRModuleNode>().attr(kDocTranslate,
-                                                    FDocTranslate::FromNative<&EmitModule>());
+  RegisterDialectPrefix("ir.prefix", "I");
+  ffi::reflection::TypeAttrDef<IRModuleNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&IRModuleDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateDictAttrs(DocTranslatorObj* d, ffi::AnyView input,
-                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> DictAttrsDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* attrs =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const DictAttrsNode>(input);
   return AnyValue(d, attrs->dict);
@@ -168,11 +174,11 @@ ffi::Optional<ExprDoc> TranslateDictAttrs(DocTranslatorObj* d, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<DictAttrsNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateDictAttrs>());
+      kDocTranslate, FDocTranslate::FromNative<&DictAttrsDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateGlobalVar(DocTranslatorObj* d, ffi::AnyView input,
-                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> GlobalVarDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* var =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const GlobalVarNode>(input);
   return GlobalReference(d, var->name_hint);
@@ -180,11 +186,11 @@ ffi::Optional<ExprDoc> TranslateGlobalVar(DocTranslatorObj* d, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<GlobalVarNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateGlobalVar>());
+      kDocTranslate, FDocTranslate::FromNative<&GlobalVarDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateLegacyFuncType(DocTranslatorObj* d, ffi::AnyView input,
-                                               const ffi::Object*) {
+ffi::Optional<ExprDoc> FuncTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object*) {
   const auto* ty =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const FuncTypeNode>(input);
   return TypeValue(d, ffi::GetRef<FuncType>(ty), false);
@@ -192,10 +198,11 @@ ffi::Optional<ExprDoc> TranslateLegacyFuncType(DocTranslatorObj* d, ffi::AnyView
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<FuncTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateLegacyFuncType>());
+      kDocTranslate, FDocTranslate::FromNative<&FuncTypeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateRange(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> RangeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                         const ffi::Object*) {
   const auto* range =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const RangeNode>(input);
   ExprDoc min = d->Translate(range->min).value();
@@ -205,7 +212,7 @@ ffi::Optional<ExprDoc> TranslateRange(DocTranslatorObj* d, ffi::AnyView input, c
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<RangeNode>().attr(kDocTranslate,
-                                                 FDocTranslate::FromNative<&TranslateRange>());
+                                                 FDocTranslate::FromNative<&RangeDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/script/printer/ir/misc.cc b/src/script/printer/ir/misc.cc
index 7f9370d38d..4ea9c71ea3 100644
--- a/src/script/printer/ir/misc.cc
+++ b/src/script/printer/ir/misc.cc
@@ -22,7 +22,6 @@
 #include <tvm/relax/global_info.h>
 #include <tvm/runtime/tensor.h>
 #include <tvm/target/target.h>
-#include <tvm/tirx/type.h>
 
 #include <algorithm>
 #include <cmath>
@@ -41,8 +40,8 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateDataTypeImm(DocTranslatorObj*, ffi::AnyView input,
-                                            const ffi::Object*) {
+ffi::Optional<ExprDoc> DataTypeImmDocTranslate(DocTranslatorObj*, ffi::AnyView input,
+                                               const ffi::Object*) {
   const auto* imm =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const DataTypeImmNode>(input);
   return NamespaceDoc("tirx")->Attr("dtype")->Call(
@@ -51,11 +50,11 @@ ffi::Optional<ExprDoc> TranslateDataTypeImm(DocTranslatorObj*, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<DataTypeImmNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateDataTypeImm>());
+      kDocTranslate, FDocTranslate::FromNative<&DataTypeImmDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateGenericConst(DocTranslatorObj* d, ffi::AnyView input,
-                                             const ffi::Object*) {
+ffi::Optional<ExprDoc> GenericConstDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                const ffi::Object*) {
   const auto* constant =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const GenericConstNode>(input);
   if (auto dtype = constant->value.as<DLDataType>()) {
@@ -120,7 +119,7 @@ ffi::Optional<ExprDoc> TranslateGenericConst(DocTranslatorObj* d, ffi::AnyView i
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<GenericConstNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateGenericConst>());
+      kDocTranslate, FDocTranslate::FromNative<&GenericConstDocTranslate>());
 }
 
 }  // namespace
@@ -182,14 +181,13 @@ ExprDoc AnyValue(DocTranslatorObj* d, ffi::AnyView value) {
     d->RecordOrigin(doc, ffi::GetRef<StringImm>(string));
     return doc;
   }
-  if (auto type = value.as<tirx::BufferType>()) return TypeValue(d, type.value(), false);
   return d->Translate(value).value();
 }
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateShapeObject(DocTranslatorObj*, ffi::AnyView input,
-                                            const ffi::Object*) {
+ffi::Optional<ExprDoc> ShapeDocTranslate(DocTranslatorObj*, ffi::AnyView input,
+                                         const ffi::Object*) {
   const auto* shape =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const ffi::ShapeObj>(input);
   ffi::Array<ExprDoc> dimensions;
@@ -201,7 +199,7 @@ ffi::Optional<ExprDoc> TranslateShapeObject(DocTranslatorObj*, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<ffi::ShapeObj>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateShapeObject>());
+      kDocTranslate, FDocTranslate::FromNative<&ShapeDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/script/printer/ir/prim_expr.cc b/src/script/printer/ir/prim_expr.cc
index 759441992b..0846d018ed 100644
--- a/src/script/printer/ir/prim_expr.cc
+++ b/src/script/printer/ir/prim_expr.cc
@@ -31,8 +31,8 @@ namespace details {
 namespace {
 
 template <typename T, OperationDocNode::Kind kind, PrimExpr (*operation)(PrimExpr, PrimExpr, Span)>
-ffi::Optional<ExprDoc> TranslateBinary(DocTranslatorObj* d, ffi::AnyView input,
-                                       const ffi::Object*) {
+ffi::Optional<ExprDoc> BinaryOpDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object*) {
   const auto* node = ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const T>(input);
   ExprDoc a = d->Translate(node->a).value();
   ExprDoc b = d->Translate(node->b).value();
@@ -84,8 +84,8 @@ ExprDoc TranslateBinaryHelper(DocTranslatorObj* d, const T* node, const char* he
   return NamespaceDoc("tirx")->Attr(std::strrchr(T::_type_key, '.') + 1)->Call({a, b});
 }
 
-ffi::Optional<ExprDoc> TranslateBitwiseNot(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> BitwiseNotDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::BitwiseNotNode>(input);
   return TranslateUnary<prim::BitwiseNotNode, OperationDocNode::Kind::kInvert, tvm::bitwise_neg>(
@@ -94,10 +94,11 @@ ffi::Optional<ExprDoc> TranslateBitwiseNot(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::BitwiseNotNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateBitwiseNot>());
+      kDocTranslate, FDocTranslate::FromNative<&BitwiseNotDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateNot(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> NotDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::NotNode>(input);
   return TranslateUnary<prim::NotNode, OperationDocNode::Kind::kNot, tvm::logical_not>(d, node);
@@ -105,21 +106,23 @@ ffi::Optional<ExprDoc> TranslateNot(DocTranslatorObj* d, ffi::AnyView input, con
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::NotNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&TranslateNot>());
+                                                     FDocTranslate::FromNative<&NotDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateString(DocTranslatorObj*, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> StringImmDocTranslate(DocTranslatorObj*, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* imm =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const StringImmNode>(input);
   return LiteralDoc::Str(imm->value, std::nullopt);
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<StringImmNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&TranslateString>());
+  ffi::reflection::TypeAttrDef<StringImmNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&StringImmDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateCast(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> CastDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                        const ffi::Object*) {
   const auto* cast =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::CastNode>(input);
   return NamespaceDoc("tirx")->Attr("Cast")->Call(
@@ -128,12 +131,12 @@ ffi::Optional<ExprDoc> TranslateCast(DocTranslatorObj* d, ffi::AnyView input, co
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<prim::CastNode>().attr(kDocTranslate,
-                                                      FDocTranslate::FromNative<&TranslateCast>());
+  ffi::reflection::TypeAttrDef<prim::CastNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&CastDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateSelect(DocTranslatorObj* d, ffi::AnyView input,
-                                       const ffi::Object*) {
+ffi::Optional<ExprDoc> SelectDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                          const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::SelectNode>(input);
   return NamespaceDoc("tirx")->Attr("Select")->Call({d->Translate(node->condition).value(),
@@ -143,10 +146,11 @@ ffi::Optional<ExprDoc> TranslateSelect(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::SelectNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateSelect>());
+      kDocTranslate, FDocTranslate::FromNative<&SelectDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateRamp(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> RampDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                        const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::RampNode>(input);
   return NamespaceDoc("tirx")->Attr("Ramp")->Call({d->Translate(node->base).value(),
@@ -155,12 +159,12 @@ ffi::Optional<ExprDoc> TranslateRamp(DocTranslatorObj* d, ffi::AnyView input, co
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<prim::RampNode>().attr(kDocTranslate,
-                                                      FDocTranslate::FromNative<&TranslateRamp>());
+  ffi::reflection::TypeAttrDef<prim::RampNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&RampDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateBroadcast(DocTranslatorObj* d, ffi::AnyView input,
-                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> BroadcastDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::BroadcastNode>(input);
   return NamespaceDoc("tirx")
@@ -170,11 +174,11 @@ ffi::Optional<ExprDoc> TranslateBroadcast(DocTranslatorObj* d, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::BroadcastNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateBroadcast>());
+      kDocTranslate, FDocTranslate::FromNative<&BroadcastDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateShuffle(DocTranslatorObj* d, ffi::AnyView input,
-                                        const ffi::Object*) {
+ffi::Optional<ExprDoc> ShuffleDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                           const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::ShuffleNode>(input);
   ExprDoc vectors = AnyValue(d, node->vectors);
@@ -186,10 +190,11 @@ ffi::Optional<ExprDoc> TranslateShuffle(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::ShuffleNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateShuffle>());
+      kDocTranslate, FDocTranslate::FromNative<&ShuffleDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateLet(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> LetDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::LetNode>(input);
   ExprDoc value = d->Translate(node->value).value();
@@ -206,11 +211,11 @@ ffi::Optional<ExprDoc> TranslateLet(DocTranslatorObj* d, ffi::AnyView input, con
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::LetNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&TranslateLet>());
+                                                     FDocTranslate::FromNative<&LetDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateDiv(DocTranslatorObj* d, ffi::AnyView input,
-                                    const ffi::Object* destination) {
+ffi::Optional<ExprDoc> DivDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object* destination) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::DivNode>(input);
   PrimType a_type = node->a.ty();
@@ -220,85 +225,84 @@ ffi::Optional<ExprDoc> TranslateDiv(DocTranslatorObj* d, ffi::AnyView input,
     return NamespaceDoc("tirx")->Attr("Div")->Call(
         {d->Translate(node->a).value(), d->Translate(node->b).value()});
   }
-  return TranslateBinary<prim::DivNode, OperationDocNode::Kind::kDiv, tvm::div>(d, input,
-                                                                                destination);
+  return BinaryOpDocTranslate<prim::DivNode, OperationDocNode::Kind::kDiv, tvm::div>(d, input,
+                                                                                     destination);
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::DivNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&TranslateDiv>());
+                                                     FDocTranslate::FromNative<&DivDocTranslate>());
   ffi::reflection::TypeAttrDef<prim::AddNode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::AddNode, OperationDocNode::Kind::kAdd, tvm::add>>());
+          &BinaryOpDocTranslate<prim::AddNode, OperationDocNode::Kind::kAdd, tvm::add>>());
   ffi::reflection::TypeAttrDef<prim::SubNode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::SubNode, OperationDocNode::Kind::kSub, tvm::sub>>());
+          &BinaryOpDocTranslate<prim::SubNode, OperationDocNode::Kind::kSub, tvm::sub>>());
   ffi::reflection::TypeAttrDef<prim::MulNode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::MulNode, OperationDocNode::Kind::kMult, tvm::mul>>());
+          &BinaryOpDocTranslate<prim::MulNode, OperationDocNode::Kind::kMult, tvm::mul>>());
   ffi::reflection::TypeAttrDef<prim::FloorDivNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateBinary<
+      kDocTranslate, FDocTranslate::FromNative<&BinaryOpDocTranslate<
                          prim::FloorDivNode, OperationDocNode::Kind::kFloorDiv, tvm::floordiv>>());
   ffi::reflection::TypeAttrDef<prim::FloorModNode>().attr(
-      kDocTranslate,
-      FDocTranslate::FromNative<
-          &TranslateBinary<prim::FloorModNode, OperationDocNode::Kind::kMod, tvm::floormod>>());
+      kDocTranslate, FDocTranslate::FromNative<&BinaryOpDocTranslate<
+                         prim::FloorModNode, OperationDocNode::Kind::kMod, tvm::floormod>>());
   ffi::reflection::TypeAttrDef<prim::LShiftNode>().attr(
-      kDocTranslate,
-      FDocTranslate::FromNative<
-          &TranslateBinary<prim::LShiftNode, OperationDocNode::Kind::kLShift, tvm::left_shift>>());
+      kDocTranslate, FDocTranslate::FromNative<&BinaryOpDocTranslate<
+                         prim::LShiftNode, OperationDocNode::Kind::kLShift, tvm::left_shift>>());
   ffi::reflection::TypeAttrDef<prim::RShiftNode>().attr(
-      kDocTranslate,
-      FDocTranslate::FromNative<
-          &TranslateBinary<prim::RShiftNode, OperationDocNode::Kind::kRShift, tvm::right_shift>>());
+      kDocTranslate, FDocTranslate::FromNative<&BinaryOpDocTranslate<
+                         prim::RShiftNode, OperationDocNode::Kind::kRShift, tvm::right_shift>>());
   ffi::reflection::TypeAttrDef<prim::BitwiseAndNode>().attr(
       kDocTranslate,
-      FDocTranslate::FromNative<&TranslateBinary<
+      FDocTranslate::FromNative<&BinaryOpDocTranslate<
           prim::BitwiseAndNode, OperationDocNode::Kind::kBitAnd, tvm::bitwise_and>>());
   ffi::reflection::TypeAttrDef<prim::BitwiseOrNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateBinary<
+      kDocTranslate, FDocTranslate::FromNative<&BinaryOpDocTranslate<
                          prim::BitwiseOrNode, OperationDocNode::Kind::kBitOr, tvm::bitwise_or>>());
   ffi::reflection::TypeAttrDef<prim::BitwiseXorNode>().attr(
       kDocTranslate,
-      FDocTranslate::FromNative<&TranslateBinary<
+      FDocTranslate::FromNative<&BinaryOpDocTranslate<
           prim::BitwiseXorNode, OperationDocNode::Kind::kBitXor, tvm::bitwise_xor>>());
   ffi::reflection::TypeAttrDef<prim::LTNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<
-                         &TranslateBinary<prim::LTNode, OperationDocNode::Kind::kLt, tvm::less>>());
+      kDocTranslate,
+      FDocTranslate::FromNative<
+          &BinaryOpDocTranslate<prim::LTNode, OperationDocNode::Kind::kLt, tvm::less>>());
   ffi::reflection::TypeAttrDef<prim::LENode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::LENode, OperationDocNode::Kind::kLtE, tvm::less_equal>>());
+          &BinaryOpDocTranslate<prim::LENode, OperationDocNode::Kind::kLtE, tvm::less_equal>>());
   ffi::reflection::TypeAttrDef<prim::EQNode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::EQNode, OperationDocNode::Kind::kEq, tvm::equal>>());
+          &BinaryOpDocTranslate<prim::EQNode, OperationDocNode::Kind::kEq, tvm::equal>>());
   ffi::reflection::TypeAttrDef<prim::NENode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::NENode, OperationDocNode::Kind::kNotEq, tvm::not_equal>>());
+          &BinaryOpDocTranslate<prim::NENode, OperationDocNode::Kind::kNotEq, tvm::not_equal>>());
   ffi::reflection::TypeAttrDef<prim::GTNode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::GTNode, OperationDocNode::Kind::kGt, tvm::greater>>());
+          &BinaryOpDocTranslate<prim::GTNode, OperationDocNode::Kind::kGt, tvm::greater>>());
   ffi::reflection::TypeAttrDef<prim::GENode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::GENode, OperationDocNode::Kind::kGtE, tvm::greater_equal>>());
+          &BinaryOpDocTranslate<prim::GENode, OperationDocNode::Kind::kGtE, tvm::greater_equal>>());
   ffi::reflection::TypeAttrDef<prim::AndNode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::AndNode, OperationDocNode::Kind::kAnd, tvm::logical_and>>());
+          &BinaryOpDocTranslate<prim::AndNode, OperationDocNode::Kind::kAnd, tvm::logical_and>>());
   ffi::reflection::TypeAttrDef<prim::OrNode>().attr(
       kDocTranslate,
       FDocTranslate::FromNative<
-          &TranslateBinary<prim::OrNode, OperationDocNode::Kind::kOr, tvm::logical_or>>());
+          &BinaryOpDocTranslate<prim::OrNode, OperationDocNode::Kind::kOr, tvm::logical_or>>());
 }
 
-ffi::Optional<ExprDoc> TranslateMod(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> ModDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::ModNode>(input);
   return TranslateBinaryHelper<prim::ModNode, tvm::truncmod>(d, node, "truncmod");
@@ -306,10 +310,11 @@ ffi::Optional<ExprDoc> TranslateMod(DocTranslatorObj* d, ffi::AnyView input, con
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::ModNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&TranslateMod>());
+                                                     FDocTranslate::FromNative<&ModDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateMin(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> MinDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::MinNode>(input);
   return TranslateBinaryHelper<prim::MinNode, tvm::min>(d, node, "min");
@@ -317,10 +322,11 @@ ffi::Optional<ExprDoc> TranslateMin(DocTranslatorObj* d, ffi::AnyView input, con
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::MinNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&TranslateMin>());
+                                                     FDocTranslate::FromNative<&MinDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateMax(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> MaxDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const prim::MaxNode>(input);
   return TranslateBinaryHelper<prim::MaxNode, tvm::max>(d, node, "max");
@@ -328,7 +334,7 @@ ffi::Optional<ExprDoc> TranslateMax(DocTranslatorObj* d, ffi::AnyView input, con
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<prim::MaxNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&TranslateMax>());
+                                                     FDocTranslate::FromNative<&MaxDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/script/printer/ir/prim_type.cc b/src/script/printer/ir/prim_type.cc
index 92dd72a37b..e1f7176416 100644
--- a/src/script/printer/ir/prim_type.cc
+++ b/src/script/printer/ir/prim_type.cc
@@ -31,23 +31,25 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateInt(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> IntImmDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                          const ffi::Object*) {
   const auto* imm =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const IntImmNode>(input);
   DLDataType dtype = imm->ty.as_or_throw<PrimType>()->dtype;
   ExprDoc value = LiteralDoc::Int(ffi::GetRef<IntImm>(imm), std::nullopt);
   DLDataType default_dtype =
-      ffi::StringToDLDataType(d->GetExtraConfig<ffi::String>("script.int_dtype", "int32"));
+      ffi::StringToDLDataType(d->GetExtraConfig<ffi::String>("ir.int_dtype", "int32"));
   if (dtype == default_dtype) return value;
   return NamespaceDoc("tirx")->Attr(ffi::DLDataTypeToString(dtype))->Call({value});
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<IntImmNode>().attr(kDocTranslate,
-                                                  FDocTranslate::FromNative<&TranslateInt>());
+                                                  FDocTranslate::FromNative<&IntImmDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateFloat(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> FloatImmDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object*) {
   const auto* imm =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const FloatImmNode>(input);
   DLDataType dtype = imm->ty.as_or_throw<PrimType>()->dtype;
@@ -59,37 +61,30 @@ ffi::Optional<ExprDoc> TranslateFloat(DocTranslatorObj* d, ffi::AnyView input, c
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<FloatImmNode>().attr(kDocTranslate,
-                                                    FDocTranslate::FromNative<&TranslateFloat>());
+  ffi::reflection::TypeAttrDef<FloatImmNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&FloatImmDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateType(DocTranslatorObj*, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> PrimTypeDocTranslate(DocTranslatorObj*, ffi::AnyView input,
+                                            const ffi::Object*) {
   const auto* ty =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const PrimTypeNode>(input);
   if (ty->dtype.lanes != 1) {
-    // Match the fixed-vector constructors exported by tirx/script/ir_builder/ir.py.
-    // Other lane counts, scalable vectors, and unexported element types still
-    // need the shared type constructor.
+    // TIRx exports vectors with 2/4/8/16/32/64 lanes for 8/16/32/64-bit integers,
+    // 16/32/64-bit floats, and the float8, float6, and float4 formats below.
+    // Other fixed or scalable vectors use the generic type constructor.
     if (ty->dtype.lanes == 2 || ty->dtype.lanes == 4 || ty->dtype.lanes == 8 ||
         ty->dtype.lanes == 16 || ty->dtype.lanes == 32 || ty->dtype.lanes == 64) {
-      static constexpr const char* element_names[] = {"int8",           "int16",
-                                                      "int32",          "int64",
-                                                      "uint8",          "uint16",
-                                                      "uint32",         "uint64",
-                                                      "float16",        "float32",
-                                                      "float64",        "float8_e3m4",
-                                                      "float8_e4m3",    "float8_e4m3b11fnuz",
-                                                      "float8_e4m3fn",  "float8_e4m3fnuz",
-                                                      "float8_e5m2",    "float8_e5m2fnuz",
-                                                      "float8_e8m0fnu", "float6_e2m3fn",
-                                                      "float6_e3m2fn",  "float4_e2m1fn"};
-      DLDataType element = ty->dtype;
-      element.lanes = 1;
-      ffi::String element_name = ffi::DLDataTypeToString(element);
-      for (const char* name : element_names) {
-        if (element_name == name)
-          return NamespaceDoc("tirx")->Attr(ffi::DLDataTypeToString(ty->dtype));
-      }
+      PrimType type = ffi::GetRef<PrimType>(ty);
+      bool supported_element =
+          (type.MatchesCode(kDLInt, kDLUInt) &&
+           (type.bits() == 8 || type.bits() == 16 || type.bits() == 32 || type.bits() == 64)) ||
+          (type.MatchesCode(kDLFloat) &&
+           (type.bits() == 16 || type.bits() == 32 || type.bits() == 64)) ||
+          type.MatchesCode(kDLFloat8_e3m4, kDLFloat8_e4m3, kDLFloat8_e4m3b11fnuz, kDLFloat8_e4m3fn,
+                           kDLFloat8_e4m3fnuz, kDLFloat8_e5m2, kDLFloat8_e5m2fnuz,
+                           kDLFloat8_e8m0fnu, kDLFloat6_e2m3fn, kDLFloat6_e3m2fn, kDLFloat4_e2m1fn);
+      if (supported_element) return NamespaceDoc("tirx")->Attr(ffi::DLDataTypeToString(ty->dtype));
     }
     return NamespaceDoc("ir")
         ->Attr("PrimType")
@@ -99,28 +94,26 @@ ffi::Optional<ExprDoc> TranslateType(DocTranslatorObj*, ffi::AnyView input, cons
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<PrimTypeNode>().attr(kDocTranslate,
-                                                    FDocTranslate::FromNative<&TranslateType>());
+  ffi::reflection::TypeAttrDef<PrimTypeNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&PrimTypeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateStringType(DocTranslatorObj*, ffi::AnyView, const ffi::Object*) {
+ffi::Optional<ExprDoc> StringTypeDocTranslate(DocTranslatorObj*, ffi::AnyView, const ffi::Object*) {
   return NamespaceDoc("ir")->Attr("StringType")->Call({});
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<StringTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateStringType>());
+      kDocTranslate, FDocTranslate::FromNative<&StringTypeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateTupleType(DocTranslatorObj* d, ffi::AnyView input,
-                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> TupleTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* ty =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const TupleTypeNode>(input);
   if (ty->fields.empty()) return NamespaceDoc("relax")->Attr("Tuple");
   ffi::Array<ExprDoc> fields;
-  for (const Type& field : ty->fields)
-    fields.push_back((field.as<tirx::BufferTypeNode>() ? TypeValue(d, field, false)
-                                                       : d->Translate(field).value()));
+  for (const Type& field : ty->fields) fields.push_back(d->Translate(field).value());
   std::function<bool(const Type&)> is_primitive = [&](const Type& field) {
     if (field.as<PrimType>() || field.as<PointerType>()) return true;
     if (const auto* tuple = field.as<TupleTypeNode>()) {
@@ -135,7 +128,7 @@ ffi::Optional<ExprDoc> TranslateTupleType(DocTranslatorObj* d, ffi::AnyView inpu
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<TupleTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateTupleType>());
+      kDocTranslate, FDocTranslate::FromNative<&TupleTypeDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/script/printer/ir/utils.cc b/src/script/printer/ir/utils.cc
index 0bccc58b04..e6da6c0512 100644
--- a/src/script/printer/ir/utils.cc
+++ b/src/script/printer/ir/utils.cc
@@ -17,15 +17,13 @@
  */
 #include "utils.h"
 
-#include <tvm/ffi/extra/structural_visit.h>
 #include <tvm/ffi/reflection/accessor.h>
+#include <tvm/ir/global_info.h>
 #include <tvm/ir/op.h>
 #include <tvm/relax/expr.h>
 #include <tvm/relax/type.h>
-#include <tvm/tirx/type.h>
 
 #include <algorithm>
-#include <functional>
 #include <optional>
 #include <utility>
 #include <vector>
@@ -91,7 +89,10 @@ bool HasAnnotatedDescendant(DocTranslatorObj* d, const ffi::ObjectRef& object) {
 }
 
 ExprDoc GlobalReference(DocTranslatorObj* d, const ffi::String& name) {
-  return IdDoc(d->GetExtraConfig<ffi::String>("script.module_name", "Module"))->Attr(name);
+  auto names = d->GetExtraConfig<ffi::Array<ffi::String>>("script.binding_names", {});
+  return IdDoc(names.empty() ? d->GetExtraConfig<ffi::String>("script.module_name", "Module")
+                             : names.back())
+      ->Attr(name);
 }
 
 namespace {
@@ -104,23 +105,8 @@ ExprDoc TypeValueImpl(DocTranslatorObj* d, const Type& type, bool dtype_literal)
     return NamespaceDoc("relax")->Attr("Tuple")->Call({});
   }
   if (auto function = type.as<relax::FuncTypeNode>(); function && !function->params.has_value()) {
-    ffi::Array<ffi::String> keys;
-    ffi::Array<ExprDoc> values;
-    if (!function->ret.as<AnyTypeNode>()) {
-      keys.push_back("ret");
-      values.push_back((function->ret.as<tirx::BufferTypeNode>()
-                            ? TypeValue(d, function->ret, false)
-                            : d->Translate(function->ret).value()));
-    }
-    if (function->purity) {
-      keys.push_back("purity");
-      values.push_back(LiteralDoc::Boolean(true, std::nullopt));
-    }
-    if (function->derive_func.has_value()) {
-      keys.push_back("derive_func");
-      values.push_back(LiteralDoc::Str(function->derive_func.value()->name, std::nullopt));
-    }
-    return NamespaceDoc("relax")->Attr("Callable")->Call({}, keys, values);
+    ExprDoc doc = d->Translate(type).value();
+    return doc.as<AttrAccessDocNode>() ? doc->Call({}) : doc;
   }
   if (auto primitive = type.as<PrimType>()) {
     ExprDoc dtype = LiteralDoc::DataType(primitive.value()->dtype, std::nullopt);
@@ -144,12 +130,6 @@ ExprDoc TypeValueImpl(DocTranslatorObj* d, const Type& type, bool dtype_literal)
     return d->Translate(type).value()->Attr("ty");
   }
   ExprDoc doc = d->Translate(type).value();
-  if (type.as<tirx::BufferTypeNode>()) {
-    if (auto call = doc.as<CallDoc>();
-        call && call.value()->callee.as_or_throw<AttrAccessDoc>()->name == "Buffer") {
-      return doc->Attr("ty");
-    }
-  }
   if (type.as<relax::TensorTypeNode>() && doc.as<AttrAccessDocNode>()) return doc->Call({});
   return doc;
 }
@@ -251,7 +231,11 @@ ffi::Dict<Var, IdDoc> CopyImplicitDefs(DocTranslatorObj* d) {
 
 void FinalizeFunctionDefinitions(DocTranslatorObj* d, const ffi::Dict<Var, IdDoc>& signature,
                                  const FunctionDoc& function) {
-  bool use_pep695 = d->GetExtraConfig<bool>("script.use_pep695", false);
+  // A module's existing scoped registry also identifies shared external captures.
+  auto module =
+      d->GetOrCreateExtraState<ffi::Optional<ffi::Dict<ffi::String, ffi::List<GlobalInfo>>>>(
+          "ir.global_info_map");
+  bool use_pep695 = !module.has_value() && d->GetExtraConfig<bool>("script.use_pep695", false);
   auto pending = d->GetImplicitDefs();
   std::vector<Var> parameters;
   if (use_pep695) {
@@ -270,34 +254,6 @@ void FinalizeFunctionDefinitions(DocTranslatorObj* d, const ffi::Dict<Var, IdDoc
       }
     }
   }
-  // Definitions discovered while translating dependent types must precede their
-  // users. Promote before recursion to terminate malformed recursive types.
-  std::function<void(const Var&)> declare = [&](const Var& var) {
-    if (!pending.count(var)) return;
-    IdDoc id = VarDoc(d, var);
-    ffi::Optional<ExprDoc> rhs = std::nullopt;
-    ffi::Optional<ExprDoc> annotation = std::nullopt;
-    if (auto primitive = var->ty.as<PrimType>()) {
-      rhs = NamespaceDoc("ir")->Attr("dynamic")->Call(
-          {LiteralDoc::Str(var->name, std::nullopt)}, {"dtype"},
-          {LiteralDoc::DataType(primitive.value()->dtype, std::nullopt)});
-    } else {
-      TVM_FFI_CHECK(!var->ty.IsMissing(), TypeError)
-          << "printer free non-scalar variable requires a type annotation";
-      annotation = d->Translate(var->ty).value();
-    }
-    ffi::StructuralWalk<ffi::WalkOrder::kPreOrder>(
-        var->ty, [&](const Var& dependency) -> ffi::Expected<ffi::WalkResult> {
-          declare(dependency);
-          return ffi::WalkResult::Advance();
-        });
-    d->Emit(AssignDoc(id, rhs, annotation), var);
-  };
-  auto remaining = CopyImplicitDefs(d);
-  std::vector<std::pair<Var, IdDoc>> ordered(remaining.begin(), remaining.end());
-  std::sort(ordered.begin(), ordered.end(),
-            [](const auto& a, const auto& b) { return a.second->name < b.second->name; });
-  for (const auto& [var, id] : ordered) declare(var);
 }
 
 }  // namespace details
diff --git a/src/script/printer/entry.cc b/src/script/printer/printer.cc
similarity index 84%
rename from src/script/printer/entry.cc
rename to src/script/printer/printer.cc
index 3b2657c53b..2cd09fb520 100644
--- a/src/script/printer/entry.cc
+++ b/src/script/printer/printer.cc
@@ -22,6 +22,7 @@
 #include <tvm/relax/expr.h>
 #include <tvm/script/printer/doc.h>
 #include <tvm/script/printer/doc_translator.h>
+#include <tvm/script/printer/printer.h>
 #include <tvm/tirx/function.h>
 
 #include <algorithm>
@@ -93,12 +94,6 @@ void RecoverDocPaths(
                            [&](const AccessPath& existing) { return SamePath(existing, path); })) {
             doc->source_paths.push_back(path);
           }
-          if (origin->second.as<prim::CastNode>()) {
-            if (auto call = value.as<CallDocNode>(); call && call->args.size() == 2) {
-              call->args[0]->source_paths.push_back(path->Attr("dtype"));
-              call->args[1]->source_paths.push_back(path->Attr("value"));
-            }
-          }
         }
       }
     }
@@ -112,31 +107,12 @@ void RecoverDocPaths(
       RecoverDocPaths(entry.second, context, origins, ir_paths, active);
     }
   } else {
-    ffi::reflection::ForEachFieldInfo(
-        TVMFFIGetTypeInfo(object->type_index()), [&](const TVMFFIFieldInfo* field) {
-          if (ffi::String(field->name) == "source_paths") return;
-          // Function parameter order is preserved by both function
-          // hooks. Restrict each binder and its annotation to that
-          // parameter before recovering shared variable occurrences.
-          if (auto function = value.as<FunctionDoc>();
-              function && ffi::String(field->name) == "args") {
-            auto original = origins.find(object);
-            if (original != origins.end() && (original->second.as<tirx::PrimFuncNode>() ||
-                                              original->second.as<relax::FunctionNode>())) {
-              for (size_t i = 0; i < function.value()->args.size(); ++i) {
-                std::vector<AccessPath> parameter_paths;
-                for (const auto& path : context) {
-                  parameter_paths.push_back(path->Attr("params")->ArrayItem(i));
-                }
-                RecoverDocPaths(function.value()->args[i], parameter_paths, origins, ir_paths,
-                                active);
-              }
-              return;
-            }
-          }
-          RecoverDocPaths(ffi::reflection::FieldGetter(field)(object), context, origins, ir_paths,
-                          active);
-        });
+    ffi::reflection::ForEachFieldInfo(TVMFFIGetTypeInfo(object->type_index()),
+                                      [&](const TVMFFIFieldInfo* field) {
+                                        if (ffi::String(field->name) == "source_paths") return;
+                                        RecoverDocPaths(ffi::reflection::FieldGetter(field)(object),
+                                                        context, origins, ir_paths, active);
+                                      });
   }
   active->erase(object);
 }
@@ -246,16 +222,7 @@ class MapDocPaths {
     if (auto array = value.as<ffi::Array<ffi::Any>>()) {
       for (size_t i = 0; i < array->size(); ++i) Index((*array)[i], path->ArrayItem(i), ancestors);
     } else if (auto map = value.as<ffi::Map<ffi::Any, ffi::Any>>()) {
-      std::vector<std::pair<ffi::Any, ffi::Any>> entries(map->begin(), map->end());
-      // Match translation's deterministic module member order.
-      if (std::all_of(entries.begin(), entries.end(),
-                      [](const auto& item) { return item.first.template as<GlobalVarNode>(); })) {
-        std::sort(entries.begin(), entries.end(), [](const auto& a, const auto& b) {
-          return a.first.template as<GlobalVarNode>()->name_hint <
-                 b.first.template as<GlobalVarNode>()->name_hint;
-        });
-      }
-      for (const auto& [key, child] : entries) Index(child, path->MapItem(key), ancestors);
+      for (const auto& [key, child] : map.value()) Index(child, path->MapItem(key), ancestors);
     } else {
       ffi::reflection::ForEachFieldInfo(TVMFFIGetTypeInfo(object->type_index()),
                                         [&](const TVMFFIFieldInfo* field) {
@@ -282,8 +249,6 @@ ffi::String Script(const ffi::ObjectRef& obj, const PrinterConfig& config) {
   extra_config.Set("script.verbose_expr", config->verbose_expr);
   extra_config.Set("script.syntax_sugar", config->syntax_sugar);
   extra_config.Set("ir.prefix", config->ir_prefix);
-  extra_config.Set("script.show_object_address", config->show_object_address);
-  extra_config.Set("script.buffer_dtype", ffi::DLDataTypeToString(config->buffer_dtype));
   auto annotated_objects = paths.AnnotatedObjects();
   extra_config.Set("script.annotated_objects", annotated_objects);
   extra_config.Set("script.annotation_ancestors", paths.AnnotationAncestors(annotated_objects));
diff --git a/src/script/printer/script_printer.cc b/src/script/printer/script_printer.cc
index 98688699d8..547381a0fb 100644
--- a/src/script/printer/script_printer.cc
+++ b/src/script/printer/script_printer.cc
@@ -30,6 +30,7 @@
 #include <tvm/runtime/logging.h>
 #include <tvm/s_tir/stmt.h>
 #include <tvm/script/printer/doc_translator.h>
+#include <tvm/script/printer/printer.h>
 #include <tvm/te/operation.h>
 #include <tvm/tirx/exec_scope.h>
 #include <tvm/tirx/function.h>
@@ -107,8 +108,6 @@ TVM_FFI_STATIC_INIT_BLOCK() {
            [](const ffi::ObjectRef& obj, const PrinterConfig& config) {
              return script::printer::Script(obj, config);
            });
-  script::printer::RegisterDialectPrefix("tirx.prefix", "T");
-  script::printer::RegisterDialectPrefix("relax.prefix", "R");
 
   RegisterScriptRepr<DataTypeImmNode>();
   RegisterScriptRepr<GenericConstNode>();
diff --git a/src/tirx/op/builtin.cc b/src/tirx/op/builtin.cc
index 848069736e..974651a4a2 100644
--- a/src/tirx/op/builtin.cc
+++ b/src/tirx/op/builtin.cc
@@ -33,27 +33,11 @@ namespace tvm {
 namespace tirx {
 namespace builtin {
 
-Type InferTypeVoid(const CallNode*) { return PrimType::Void(); }
-
 Type InferTypeWarpShuffle(const CallNode* call) {
   TVM_FFI_CHECK_GE(call->args.size(), 2U, ValueError) << "Result requires a value operand";
   return call->args[1]->ty;
 }
 
-void ValidateWarpShuffle(const CallNode* call) {
-  TVM_FFI_CHECK_EQ(call->args.size(), 5U, ValueError) << "Warp shuffle expects five arguments";
-  PrimType value = call->args[1]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(!value.IsVoid() && !value.MatchesCode(DLDataTypeCode::kDLOpaqueHandle), ValueError)
-      << "Warp shuffle expects a primitive value";
-  for (size_t i : {0U, 2U, 3U, 4U}) {
-    PrimType control = call->args[i]->ty.as_or_throw<PrimType>();
-    TVM_FFI_CHECK(
-        control.IsScalar() && control.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt),
-        ValueError)
-        << "Warp shuffle expects scalar integer control operands";
-  }
-}
-
 Type InferTypeAddressOf(const CallNode* call) {
   TVM_FFI_CHECK_GE(call->args.size(), 1U, ValueError) << "Address type requires an object";
   if (const auto* load = call->args[0].as<TensorLoadNode>()) {
@@ -79,50 +63,6 @@ Type InferTypeMaskedLoad(const CallNode* call) {
   return BufferLoad(buffer, indices).ty();
 }
 
-template <bool is_store>
-void ValidateMaskedAccess(const CallNode* call) {
-  constexpr size_t index_begin = is_store ? 2 : 1;
-  TVM_FFI_CHECK_GE(call->args.size(), index_begin + 1, ValueError)
-      << "Masked buffer access expects a buffer, indices, and a lane mask";
-  BufferVar buffer = call->args[0].as_or_throw<BufferVar>();
-  TVM_FFI_CHECK_EQ(call->args.size(), buffer->shape.size() + index_begin + 1, ValueError)
-      << "Masked buffer access indices must match the buffer rank";
-  ffi::Array<PrimExpr> indices;
-  for (size_t i = index_begin; i + 1 < call->args.size(); ++i) {
-    PrimExpr index = call->args[i].as_or_throw<PrimExpr>();
-    TVM_FFI_CHECK(index.ty().MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt),
-                  ValueError)
-        << "Masked buffer access expects integer indices";
-    indices.push_back(index);
-  }
-  // Reuse ordinary buffer-load typing, including vector elements and scalable indices.
-  PrimType value = BufferLoad(buffer, indices).ty();
-  PrimType mask = call->args.back()->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(mask.MatchesCode(DLDataTypeCode::kDLBool) ||
-                    (mask.MatchesCode(DLDataTypeCode::kDLUInt) && mask.bits() == 1),
-                ValueError)
-      << "Masked buffer access expects a boolean lane mask";
-  TVM_FFI_CHECK_EQ(mask->dtype.lanes, value->dtype.lanes, ValueError)
-      << "Masked buffer access mask must match the value lanes and scalability";
-  if constexpr (is_store) {
-    TVM_FFI_CHECK(call->args[1]->ty.as_or_throw<PrimType>() == value, ValueError)
-        << "Masked store value must match the indexed buffer type";
-  }
-}
-
-void ValidateStorageSync(const CallNode* call) {
-  TVM_FFI_CHECK_GE(call->args.size(), 1U, ValueError)
-      << "tirx.tvm_storage_sync expects a storage scope argument";
-  TVM_FFI_CHECK(call->args[0].as<StringImmNode>(), ValueError)
-      << "tirx.tvm_storage_sync expects a StringImm storage scope";
-}
-
-void ValidateIsNaN(const CallNode* call) {
-  TVM_FFI_CHECK(call->args[0]->ty.as_or_throw<PrimType>().MatchesCode(DLDataTypeCode::kDLFloat),
-                ValueError)
-      << "tirx.isnan expects a floating-point operand";
-}
-
 Type InferTypeIsNaN(const CallNode* call) {
   TVM_FFI_CHECK_GE(call->args.size(), 1U, ValueError) << "tirx.isnan expects one argument";
   PrimType input = call->args[0]->ty.as_or_throw<PrimType>();
@@ -138,21 +78,6 @@ Type InferTypeSelector(const CallNode* call) {
   return call->args[0]->ty;
 }
 
-void ValidateSelector(const CallNode* call) {
-  TVM_FFI_CHECK_EQ(call->args.size(), 2U, ValueError) << "tirx.selector expects two arguments";
-  PrimType variable = call->args[0]->ty.as_or_throw<PrimType>();
-  PrimType predicate = call->args[1]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(
-      variable.IsScalar() && variable.MatchesCode(DLDataTypeCode::kDLInt, DLDataTypeCode::kDLUInt),
-      ValueError)
-      << "tirx.selector expects a scalar integer thread-axis variable";
-  TVM_FFI_CHECK(
-      predicate.IsScalar() && predicate.MatchesCode(DLDataTypeCode::kDLBool, DLDataTypeCode::kDLInt,
-                                                    DLDataTypeCode::kDLUInt),
-      ValueError)
-      << "tirx.selector expects a scalar boolean or integer predicate";
-}
-
 ffi::Expected<Type> InferTypeBufferData(const CallNode* call) noexcept try {
   TVM_FFI_CHECK_EQ(call->args.size(), 1U, ValueError)
       << "tirx.buffer_data expects one BufferVar argument";
@@ -208,17 +133,6 @@ ffi::Expected<void> ValidateDeclBuffer(const CallNode* call) noexcept try {
   return ffi::Unexpected(ffi::Error("InternalError", error.what(), ""));
 }
 
-void AddBuiltinValidator(const char* name, void (*validate)(const CallNode*)) {
-  OpDef def(name);
-  auto signature =
-      def.op()->validator.cast<ffi::reflection::NativeFunction<void(const CallNode*)>>();
-  ffi::TypedFunction<void(const CallNode*)> validator([signature, validate](const CallNode* call) {
-    signature(call);
-    validate(call);
-  });
-  def.set_validator(validator, true);
-}
-
 TVM_FFI_STATIC_INIT_BLOCK() {
   TensorMapEncodeTiledAttr::RegisterReflection();
   ffi::reflection::GlobalDef().def(
@@ -604,14 +518,13 @@ TVM_FFI_STATIC_INIT_BLOCK() {
 
   OpDef("tirx.tvm_storage_sync")
       .signature(sig::arg("storage_scope", "The storage scope."), sig::var_args("args"))
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeVoid>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Void())
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("tvm_storage_sync"))
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("builtin"))
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kOpaque));
 
   OpDef("tirx.tvm_kernel_replace_point")
-      .signature()
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeVoid>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Void())
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("tvm_kernel_replace_point"))
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("builtin"))
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kOpaque));
@@ -812,7 +725,7 @@ TVM_FFI_STATIC_INIT_BLOCK() {
   OpDef("tirx.masked_store")
       .signature(sig::arg("buffer", "The buffer."), sig::arg("value", "The value to use."),
                  sig::arg("index", "The index."), sig::var_args("args"))
-      .set_attr<FInferType>("FInferType", FInferType::FromNative<&InferTypeVoid>())
+      .set_attr<TFixedReturnType>("TFixedReturnType", PrimType::Void())
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("masked_store"))
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("builtin"))
       .set_attr<TCallEffectKind>("TCallEffectKind",
@@ -864,15 +777,6 @@ TVM_FFI_STATIC_INIT_BLOCK() {
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("print_buffer"))
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("builtin"))
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kOpaque));
-  AddBuiltinValidator("tirx.selector", ValidateSelector);
-  AddBuiltinValidator("tirx.isnan", ValidateIsNaN);
-  AddBuiltinValidator("tirx.tvm_storage_sync", ValidateStorageSync);
-  AddBuiltinValidator("tirx.masked_load", ValidateMaskedAccess<false>);
-  AddBuiltinValidator("tirx.masked_store", ValidateMaskedAccess<true>);
-  AddBuiltinValidator("tirx.tvm_warp_shuffle", ValidateWarpShuffle);
-  AddBuiltinValidator("tirx.tvm_warp_shuffle_up", ValidateWarpShuffle);
-  AddBuiltinValidator("tirx.tvm_warp_shuffle_down", ValidateWarpShuffle);
-  AddBuiltinValidator("tirx.tvm_warp_shuffle_xor", ValidateWarpShuffle);
 }
 
 }  // namespace builtin
diff --git a/src/tirx/op/op.cc b/src/tirx/op/op.cc
index d28938926d..f427c0de2b 100644
--- a/src/tirx/op/op.cc
+++ b/src/tirx/op/op.cc
@@ -56,15 +56,6 @@ static Type InferTypeAtan(const CallNode* call) {
   return call->args[0]->ty;
 }
 
-static void ValidateAtan(const CallNode* call) {
-  TVM_FFI_CHECK_EQ(call->args.size(), 1U, ValueError) << "atan expects one argument";
-  PrimType input = call->args[0]->ty.as_or_throw<PrimType>();
-  TVM_FFI_CHECK(input.MatchesCode(DLDataTypeCode::kDLFloat) &&
-                    (input.bits() == 16 || input.bits() == 32 || input.bits() == 64),
-                ValueError)
-      << "atan expects a floating-point argument";
-}
-
 // macro to register an unary op
 
 // macro to register an binary op
@@ -647,17 +638,6 @@ TVM_FFI_STATIC_INIT_BLOCK() {
       .set_attr<TIRxOpCategory>("TIRxOpCategory", ffi::String("builtin"))
       .set_attr<TCallEffectKind>("TCallEffectKind", static_cast<int64_t>(CallEffectKind::kPure));
 
-  {
-    OpDef def("tirx.atan");
-    auto signature =
-        def.op()->validator.cast<ffi::reflection::NativeFunction<void(const CallNode*)>>();
-    ffi::TypedFunction<void(const CallNode*)> validator([signature](const CallNode* call) {
-      signature(call);
-      ValidateAtan(call);
-    });
-    def.set_validator(validator, true);
-  }
-
   OpDef("tirx.acosh")
       .signature(sig::arg("x", "The input value."))
       .set_attr<TScriptPrinterName>("TScriptPrinterName", ffi::String("acosh"))
diff --git a/src/tirx/script/ir_builder/ir.cc b/src/tirx/script/ir_builder/ir.cc
index 16e47af0a5..a1220b76e2 100644
--- a/src/tirx/script/ir_builder/ir.cc
+++ b/src/tirx/script/ir_builder/ir.cc
@@ -50,11 +50,14 @@ TVM_FFI_STATIC_INIT_BLOCK() {
 using tvm::tirx::IterVar;
 using tvm::tirx::Layout;
 
-BufferVar BufferDecl(ffi::Array<PrimExpr> shape, PrimType dtype, ffi::String buffer_name,
-                     ffi::Optional<Expr> data, ffi::Optional<ffi::Array<PrimExpr>> strides,
-                     ffi::Optional<PrimExpr> elem_offset, ffi::String storage_scope, int align,
-                     int offset_factor, ffi::Optional<Layout> layout,
-                     ffi::Array<PrimExpr> allocated_addr) {
+namespace {
+
+tvm::tirx::BufferType BufferTypeDecl(ffi::Array<PrimExpr> shape, PrimType dtype,
+                                     ffi::Optional<Expr> data,
+                                     ffi::Optional<ffi::Array<PrimExpr>> strides,
+                                     ffi::Optional<PrimExpr> elem_offset, ffi::String storage_scope,
+                                     int align, int offset_factor, ffi::Optional<Layout> layout,
+                                     ffi::Array<PrimExpr> allocated_addr) {
   if (!allocated_addr.empty()) {
     TVM_FFI_ICHECK(!data.has_value() && !elem_offset.has_value() && !offset_factor)
         << "ValueError: `allocated_addr` can only be used with `data`, `elem_offset`, and "
@@ -67,10 +70,21 @@ BufferVar BufferDecl(ffi::Array<PrimExpr> shape, PrimType dtype, ffi::String buf
     PrimType shape_dtype = shape.empty() ? PrimType::Int(32) : shape[0].ty();
     elem_offset = tvm::PrimVar("elem_offset", shape_dtype);
   }
-  return BufferVar(buffer_name, tvm::tirx::BufferType(storage_scope, dtype, shape,
-                                                      strides.value_or(ffi::Array<PrimExpr>()),
-                                                      elem_offset.value_or(PrimExpr()), align,
-                                                      offset_factor, layout, allocated_addr));
+  return tvm::tirx::BufferType(
+      storage_scope, dtype, shape, strides.value_or(ffi::Array<PrimExpr>()),
+      elem_offset.value_or(PrimExpr()), align, offset_factor, layout, allocated_addr);
+}
+
+}  // namespace
+
+BufferVar BufferDecl(ffi::Array<PrimExpr> shape, PrimType dtype, ffi::String buffer_name,
+                     ffi::Optional<Expr> data, ffi::Optional<ffi::Array<PrimExpr>> strides,
+                     ffi::Optional<PrimExpr> elem_offset, ffi::String storage_scope, int align,
+                     int offset_factor, ffi::Optional<Layout> layout,
+                     ffi::Array<PrimExpr> allocated_addr) {
+  return BufferVar(buffer_name,
+                   BufferTypeDecl(shape, dtype, data, strides, elem_offset, storage_scope, align,
+                                  offset_factor, layout, allocated_addr));
 }
 
 PrimFuncFrame PrimFunc(bool is_private, bool persistent) {
@@ -702,6 +716,7 @@ TVM_FFI_STATIC_INIT_BLOCK() {
                                      ffi::Optional<Expr>, ffi::Optional<ffi::Array<PrimExpr>>,
                                      ffi::Optional<PrimExpr>, ffi::String, int, int,
                                      ffi::Optional<Layout>, ffi::Array<PrimExpr>)>(BufferDecl))
+      .def("script.ir_builder.tirx.BufferType", BufferTypeDecl)
       .def("script.ir_builder.tirx.PrimFunc", PrimFunc)
       .def("script.ir_builder.tirx.DeclFunction", DeclFunction)
       .def("script.ir_builder.tirx.Arg",
diff --git a/src/tirx/script/printer/block.cc b/src/tirx/script/printer/block.cc
index 804a54c367..bbdc13a346 100644
--- a/src/tirx/script/printer/block.cc
+++ b/src/tirx/script/printer/block.cc
@@ -132,8 +132,8 @@ ffi::Array<StmtDoc> SBlockBody(DocTranslatorObj* d, const s_tir::SBlockNode* blo
   return ToStmtDocArray(docs);
 }
 
-ffi::Optional<ExprDoc> EmitSBlockRealize(DocTranslatorObj* d, ffi::AnyView input,
-                                         const ffi::Object* destination) {
+ffi::Optional<ExprDoc> SBlockRealizeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                 const ffi::Object* destination) {
   const auto* realize =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const s_tir::SBlockRealizeNode>(
           input);
@@ -150,11 +150,11 @@ ffi::Optional<ExprDoc> EmitSBlockRealize(DocTranslatorObj* d, ffi::AnyView input
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<s_tir::SBlockRealizeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitSBlockRealize>());
+      kDocTranslate, FDocTranslate::FromNative<&SBlockRealizeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitSBlock(DocTranslatorObj* d, ffi::AnyView input,
-                                  const ffi::Object* destination) {
+ffi::Optional<ExprDoc> SBlockDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                          const ffi::Object* destination) {
   const auto* block =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const s_tir::SBlockNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -169,8 +169,8 @@ ffi::Optional<ExprDoc> EmitSBlock(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<s_tir::SBlockNode>().attr(kDocTranslate,
-                                                         FDocTranslate::FromNative<&EmitSBlock>());
+  ffi::reflection::TypeAttrDef<s_tir::SBlockNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&SBlockDocTranslate>());
 }
 
 ffi::String ScopeIdApi(tirx::ScopeBinding scope) {
@@ -194,8 +194,8 @@ ExprDoc ScopeExtents(DocTranslatorObj* d, const ffi::Array<PrimExpr>& values) {
   return ListDoc(items);
 }
 
-ffi::Optional<ExprDoc> EmitScopeIdDef(DocTranslatorObj* d, ffi::AnyView input,
-                                      const ffi::Object* destination) {
+ffi::Optional<ExprDoc> ScopeIdDefStmtDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                  const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::ScopeIdDefStmtNode>(
           input);
@@ -233,11 +233,11 @@ ffi::Optional<ExprDoc> EmitScopeIdDef(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::ScopeIdDefStmtNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitScopeIdDef>());
+      kDocTranslate, FDocTranslate::FromNative<&ScopeIdDefStmtDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateExecScope(DocTranslatorObj*, ffi::AnyView input,
-                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> ExecScopeDocTranslate(DocTranslatorObj*, ffi::AnyView input,
+                                             const ffi::Object*) {
   const auto* scope =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::ExecScopeNode>(input);
   return NamespaceDoc("tirx")
@@ -247,11 +247,11 @@ ffi::Optional<ExprDoc> TranslateExecScope(DocTranslatorObj*, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::ExecScopeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateExecScope>());
+      kDocTranslate, FDocTranslate::FromNative<&ExecScopeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateScopeIdDef(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> ScopeIdDefDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* def =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::ScopeIdDefNode>(input);
   auto [parent, current] = tirx::ScopeBindingToStringPair(def->scope);
@@ -270,7 +270,7 @@ ffi::Optional<ExprDoc> TranslateScopeIdDef(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::ScopeIdDefNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateScopeIdDef>());
+      kDocTranslate, FDocTranslate::FromNative<&ScopeIdDefDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/tirx/script/printer/buffer.cc b/src/tirx/script/printer/buffer.cc
index d4b154dd1d..89ade2d977 100644
--- a/src/tirx/script/printer/buffer.cc
+++ b/src/tirx/script/printer/buffer.cc
@@ -47,8 +47,8 @@ bool IsScalarBuffer(DocTranslatorObj* d, const Expr& source) {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateBufferOperation(DocTranslatorObj* d, ffi::AnyView input,
-                                                const ffi::Object* destination) {
+ffi::Optional<ExprDoc> BufferOperationDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                   const ffi::Object* destination) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   // Surface buffer constructors emit a binding, so they cannot replace an
@@ -146,17 +146,17 @@ ffi::Optional<ExprDoc> TranslateBufferOperation(DocTranslatorObj* d, ffi::AnyVie
 TVM_FFI_STATIC_INIT_BLOCK() {
   for (const char* name : {"tirx.alloc_buffer", "tirx.decl_buffer"}) {
     OpDef(name).set_attr<FDocTranslate>(kOpCallTranslate,
-                                        FDocTranslate::FromNative<&TranslateBufferOperation>());
+                                        FDocTranslate::FromNative<&BufferOperationDocTranslate>());
   }
 }
 
-ffi::Optional<ExprDoc> TranslateBufferType(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> BufferTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* buffer =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::BufferTypeNode>(input);
   bool default_offset =
       ffi::StructuralEqual()(buffer->elem_offset, IntImm(PrimType(buffer->DefaultIndexType()), 0));
-  // Buffer constructors normalize these fields and constrain allocated addresses.
+  // The buffer type constructor normalizes these fields and constrains allocated addresses.
   // Keep the explicit type constructor when that normalization would change the IR.
   if (buffer->storage_scope.empty() || buffer->data_alignment <= 0 || buffer->offset_factor == 0 ||
       (!buffer->allocated_addr.empty() && (!default_offset || buffer->offset_factor != 1))) {
@@ -224,7 +224,7 @@ ffi::Optional<ExprDoc> TranslateBufferType(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::BufferTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateBufferType>());
+      kDocTranslate, FDocTranslate::FromNative<&BufferTypeDocTranslate>());
 }
 
 }  // namespace
@@ -282,8 +282,8 @@ ExprDoc TensorRegionValue(DocTranslatorObj* d, const TensorRegionNode* region,
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateTensorRegion(DocTranslatorObj* d, ffi::AnyView input,
-                                             const ffi::Object*) {
+ffi::Optional<ExprDoc> TensorRegionDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                const ffi::Object*) {
   const auto* region =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const TensorRegionNode>(input);
   return TensorRegionValue(d, region, false);
@@ -291,11 +291,11 @@ ffi::Optional<ExprDoc> TranslateTensorRegion(DocTranslatorObj* d, ffi::AnyView i
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<TensorRegionNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateTensorRegion>());
+      kDocTranslate, FDocTranslate::FromNative<&TensorRegionDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitBufferStore(DocTranslatorObj* d, ffi::AnyView input,
-                                       const ffi::Object* destination) {
+ffi::Optional<ExprDoc> BufferStoreDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                               const ffi::Object* destination) {
   const auto* store =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::BufferStoreNode>(
           input);
@@ -312,11 +312,11 @@ ffi::Optional<ExprDoc> EmitBufferStore(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::BufferStoreNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitBufferStore>());
+      kDocTranslate, FDocTranslate::FromNative<&BufferStoreDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateBufferLoad(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> BufferLoadDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* load =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const TensorLoadNode>(input);
   ExprDoc source = d->Translate(load->source).value();
@@ -326,11 +326,11 @@ ffi::Optional<ExprDoc> TranslateBufferLoad(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::BufferTypeNode>().attr(
-      kTensorLoadDocTranslate, FDocTranslate::FromNative<&TranslateBufferLoad>());
+      kTensorLoadDocTranslate, FDocTranslate::FromNative<&BufferLoadDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateTensorLoad(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object* destination) {
+ffi::Optional<ExprDoc> TensorLoadDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object* destination) {
   const auto* load =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const TensorLoadNode>(input);
   static ffi::reflection::TypeAttrColumn column(kTensorLoadDocTranslate);
@@ -355,10 +355,11 @@ ffi::Optional<ExprDoc> TranslateTensorLoad(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<TensorLoadNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateTensorLoad>());
+      kDocTranslate, FDocTranslate::FromNative<&TensorLoadDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateIter(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> IterDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                        const ffi::Object*) {
   const auto* iter =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::IterNode>(input);
   ExprDoc axis = LiteralDoc::Str(iter->axis.name(), std::nullopt);
@@ -368,12 +369,12 @@ ffi::Optional<ExprDoc> TranslateIter(DocTranslatorObj* d, ffi::AnyView input, co
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::IterNode>().attr(kDocTranslate,
-                                                      FDocTranslate::FromNative<&TranslateIter>());
+  ffi::reflection::TypeAttrDef<tirx::IterNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&IterDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateTileLayout(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> TileLayoutDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* layout =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::TileLayoutNode>(input);
   auto iters = [&](const ffi::Array<tirx::Iter>& source) {
@@ -404,11 +405,11 @@ ffi::Optional<ExprDoc> TranslateTileLayout(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::TileLayoutNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateTileLayout>());
+      kDocTranslate, FDocTranslate::FromNative<&TileLayoutDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateComposeLayout(DocTranslatorObj* d, ffi::AnyView input,
-                                              const ffi::Object*) {
+ffi::Optional<ExprDoc> ComposeLayoutDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                 const ffi::Object*) {
   const auto* layout =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::ComposeLayoutNode>(
           input);
@@ -429,11 +430,11 @@ ffi::Optional<ExprDoc> TranslateComposeLayout(DocTranslatorObj* d, ffi::AnyView
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::ComposeLayoutNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateComposeLayout>());
+      kDocTranslate, FDocTranslate::FromNative<&ComposeLayoutDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitMatchBufferRegion(DocTranslatorObj* d, ffi::AnyView input,
-                                             const ffi::Object* destination) {
+ffi::Optional<ExprDoc> MatchBufferRegionDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                     const ffi::Object* destination) {
   const auto* match = ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<
       const s_tir::MatchBufferRegionNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -451,7 +452,7 @@ ffi::Optional<ExprDoc> EmitMatchBufferRegion(DocTranslatorObj* d, ffi::AnyView i
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<s_tir::MatchBufferRegionNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitMatchBufferRegion>());
+      kDocTranslate, FDocTranslate::FromNative<&MatchBufferRegionDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/tirx/script/printer/expr.cc b/src/tirx/script/printer/expr.cc
index 7ae0c58874..e4a75ad5d5 100644
--- a/src/tirx/script/printer/expr.cc
+++ b/src/tirx/script/printer/expr.cc
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 #include <tvm/ffi/extra/structural_equal.h>
+#include <tvm/ffi/extra/structural_visit.h>
 #include <tvm/ir/op.h>
 #include <tvm/ir/prim/op.h>
 #include <tvm/te/operation.h>
@@ -38,29 +39,56 @@ namespace script {
 namespace printer {
 namespace details {
 
-ffi::Optional<ExprDoc> TranslateVar(DocTranslatorObj* d, ffi::AnyView input, const ffi::Object*) {
+ffi::Optional<ExprDoc> VarDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object* destination) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const VarNode>(input);
   Var var = ffi::GetRef<Var>(node);
   IdDoc id = d->VarGetOrAllocId(var, false);
-  if (var->ty.as<tirx::BufferTypeNode>() && d->GetImplicitDefs().count(var)) {
-    CallDoc type = d->Translate(var->ty).value().as_or_throw<CallDoc>();
-    TVM_FFI_CHECK(type->callee.as_or_throw<AttrAccessDoc>()->name == "Buffer", TypeError)
-        << "T.Buffer cannot declare this nonrepresentable free BufferType";
-    d->Emit(AssignDoc(VarDoc(d, var), type, std::nullopt), var);
+  if (destination == node && d->GetImplicitDefs().count(var)) {
+    // Promote before translating the type, which may refer back to this Var.
+    VarDoc(d, var);
+    ffi::Optional<ExprDoc> rhs = std::nullopt;
+    ffi::Optional<ExprDoc> annotation = std::nullopt;
+    if (auto primitive = var->ty.as<PrimType>()) {
+      rhs = NamespaceDoc("ir")->Attr("dynamic")->Call(
+          {LiteralDoc::Str(var->name, std::nullopt)}, {"dtype"},
+          {LiteralDoc::DataType(primitive.value()->dtype, std::nullopt)});
+    } else if (var->ty.as<tirx::BufferTypeNode>()) {
+      rhs = NamespaceDoc("tirx")->Attr("Var")->Call(
+          {LiteralDoc::Str(var->name, std::nullopt), d->Translate(var->ty).value()});
+    } else {
+      annotation = d->Translate(var->ty).value();
+      if (var->ty.as<PointerTypeNode>()) {
+        // A module-level annotation alone does not bind a Python variable.
+        rhs = annotation.value().as<CallDoc>() ? annotation : annotation.value()->Call({});
+      }
+    }
+    // Only this type's referenced Vars must precede its declaration.
+    ffi::StructuralWalk<ffi::WalkOrder::kPreOrder>(
+        var->ty, [&](const Var& dependency) -> ffi::Expected<ffi::WalkResult> {
+          if (d->GetImplicitDefs().count(dependency)) {
+            if (auto rhs = d->Translate(dependency, dependency.get())) {
+              d->Emit(AssignDoc(VarDoc(d, dependency), rhs.value(), std::nullopt), dependency);
+            }
+          }
+          return ffi::WalkResult::Skip();
+        });
+    d->Emit(AssignDoc(IdDoc(id->name), rhs, annotation), var);
+    return std::nullopt;
   }
   return IdDoc(id->name);
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<VarNode>().attr(kDocTranslate,
-                                               FDocTranslate::FromNative<&TranslateVar>());
+                                               FDocTranslate::FromNative<&VarDocTranslate>());
 }
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateIterVar(DocTranslatorObj* d, ffi::AnyView input,
-                                        const ffi::Object*) {
+ffi::Optional<ExprDoc> IterVarDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                           const ffi::Object*) {
   const auto* iter =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::IterVarNode>(input);
   CallDoc domain = d->Translate(iter->dom).value().as_or_throw<CallDoc>();
@@ -74,11 +102,11 @@ ffi::Optional<ExprDoc> TranslateIterVar(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::IterVarNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateIterVar>());
+      kDocTranslate, FDocTranslate::FromNative<&IterVarDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateCommReducer(DocTranslatorObj* d, ffi::AnyView input,
-                                            const ffi::Object*) {
+ffi::Optional<ExprDoc> CommReducerDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                               const ffi::Object*) {
   const auto* reducer =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const te::CommReducerNode>(input);
   TVM_FFI_CHECK(reducer->lhs.size() == reducer->rhs.size(), TypeError)
@@ -101,11 +129,11 @@ ffi::Optional<ExprDoc> TranslateCommReducer(DocTranslatorObj* d, ffi::AnyView in
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<te::CommReducerNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateCommReducer>());
+      kDocTranslate, FDocTranslate::FromNative<&CommReducerDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateIndexMap(DocTranslatorObj* d, ffi::AnyView input,
-                                         const ffi::Object*) {
+ffi::Optional<ExprDoc> IndexMapDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object*) {
   const auto* map =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::IndexMapNode>(input);
   auto translate_lambda = [&](const tirx::IndexMapNode* node) -> ExprDoc {
@@ -128,11 +156,11 @@ ffi::Optional<ExprDoc> TranslateIndexMap(DocTranslatorObj* d, ffi::AnyView input
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::IndexMapNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateIndexMap>());
+      kDocTranslate, FDocTranslate::FromNative<&IndexMapDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateLambda(DocTranslatorObj* d, ffi::AnyView input,
-                                       const ffi::Object*) {
+ffi::Optional<ExprDoc> LambdaExprDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* lambda =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::LambdaExprNode>(input);
   ffi::Array<IdDoc> args;
@@ -142,7 +170,7 @@ ffi::Optional<ExprDoc> TranslateLambda(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::LambdaExprNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateLambda>());
+      kDocTranslate, FDocTranslate::FromNative<&LambdaExprDocTranslate>());
 }
 
 bool CanTranslateExplicitResultCall(const CallNode* call) {
@@ -160,8 +188,8 @@ ExprDoc ExplicitCallResultType(DocTranslatorObj* d, const Type& type) {
   return TypeValue(d, type, dtype_literal);
 }
 
-ffi::Optional<ExprDoc> TranslateCallExtern(DocTranslatorObj* d, ffi::AnyView input,
-                                           const ffi::Object*) {
+ffi::Optional<ExprDoc> CallExternDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object*) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   if (!call->op.same_as(tirx::builtin::call_extern()) || !CanTranslateExplicitResultCall(call) ||
@@ -181,11 +209,12 @@ ffi::Optional<ExprDoc> TranslateCallExtern(DocTranslatorObj* d, ffi::AnyView inp
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   OpDef("tirx.call_extern")
-      .set_attr<FDocTranslate>(kOpCallTranslate, FDocTranslate::FromNative<&TranslateCallExtern>());
+      .set_attr<FDocTranslate>(kOpCallTranslate,
+                               FDocTranslate::FromNative<&CallExternDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateCUDAFuncCall(DocTranslatorObj* d, ffi::AnyView input,
-                                             const ffi::Object*) {
+ffi::Optional<ExprDoc> CUDAFuncCallDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                const ffi::Object*) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   static const Op cuda_func_call = Op::Get("tirx.cuda.func_call");
@@ -216,12 +245,13 @@ ffi::Optional<ExprDoc> TranslateCUDAFuncCall(DocTranslatorObj* d, ffi::AnyView i
 TVM_FFI_STATIC_INIT_BLOCK() {
   OpDef("tirx.cuda.func_call")
       .set_attr<FDocTranslate>(kOpCallTranslate,
-                               FDocTranslate::FromNative<&TranslateCUDAFuncCall>());
+                               FDocTranslate::FromNative<&CUDAFuncCallDocTranslate>());
 }
 
 template <bool block_scaled>
-ffi::Optional<ExprDoc> TranslateCUDAInstructionDescriptor(DocTranslatorObj* d, ffi::AnyView input,
-                                                          const ffi::Object*) {
+ffi::Optional<ExprDoc> CUDAInstructionDescriptorDocTranslate(DocTranslatorObj* d,
+                                                             ffi::AnyView input,
+                                                             const ffi::Object*) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   if (!CanTranslateExplicitResultCall(call) || call->args.size() != (block_scaled ? 17 : 14) ||
@@ -268,14 +298,15 @@ TVM_FFI_STATIC_INIT_BLOCK() {
   OpDef("tirx.cuda.tcgen05_encode_instr_descriptor")
       .set_attr<FDocTranslate>(
           kOpCallTranslate,
-          FDocTranslate::FromNative<&TranslateCUDAInstructionDescriptor<false>>());
+          FDocTranslate::FromNative<&CUDAInstructionDescriptorDocTranslate<false>>());
   OpDef("tirx.cuda.tcgen05_encode_instr_descriptor_block_scaled")
       .set_attr<FDocTranslate>(
-          kOpCallTranslate, FDocTranslate::FromNative<&TranslateCUDAInstructionDescriptor<true>>());
+          kOpCallTranslate,
+          FDocTranslate::FromNative<&CUDAInstructionDescriptorDocTranslate<true>>());
 }
 
-ffi::Optional<ExprDoc> TranslateLLVMIntrinsic(DocTranslatorObj* d, ffi::AnyView input,
-                                              const ffi::Object*) {
+ffi::Optional<ExprDoc> LLVMIntrinsicDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                 const ffi::Object*) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   if (call->attrs.defined() || !call->ty_args.empty() || call->args.empty() ||
@@ -313,12 +344,12 @@ ffi::Optional<ExprDoc> TranslateLLVMIntrinsic(DocTranslatorObj* d, ffi::AnyView
 TVM_FFI_STATIC_INIT_BLOCK() {
   for (const char* name : {"tirx.call_llvm_intrin", "tirx.call_llvm_pure_intrin"}) {
     OpDef(name).set_attr<FDocTranslate>(kOpCallTranslate,
-                                        FDocTranslate::FromNative<&TranslateLLVMIntrinsic>());
+                                        FDocTranslate::FromNative<&LLVMIntrinsicDocTranslate>());
   }
 }
 
-ffi::Optional<ExprDoc> TranslateActiveLaneMask(DocTranslatorObj* d, ffi::AnyView input,
-                                               const ffi::Object*) {
+ffi::Optional<ExprDoc> GetActiveLaneMaskDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                     const ffi::Object*) {
   const auto* call =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const CallNode>(input);
   if (!call->op.same_as(tirx::builtin::get_active_lane_mask()) || call->attrs.defined() ||
@@ -347,7 +378,7 @@ ffi::Optional<ExprDoc> TranslateActiveLaneMask(DocTranslatorObj* d, ffi::AnyView
 TVM_FFI_STATIC_INIT_BLOCK() {
   OpDef("tirx.get_active_lane_mask")
       .set_attr<FDocTranslate>(kOpCallTranslate,
-                               FDocTranslate::FromNative<&TranslateActiveLaneMask>());
+                               FDocTranslate::FromNative<&GetActiveLaneMaskDocTranslate>());
 }
 
 bool IsPTXAddressCall(const CallNode* call) {
@@ -558,8 +589,8 @@ ffi::Optional<ExprDoc> TranslateTIRCall(DocTranslatorObj* d, const CallNode* cal
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslateReduce(DocTranslatorObj* d, ffi::AnyView input,
-                                       const ffi::Object*) {
+ffi::Optional<ExprDoc> ReduceDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                          const ffi::Object*) {
   const auto* node =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const te::ReduceNode>(input);
   // Reduction axes bind the source and predicate. Their declarations must use
@@ -589,7 +620,7 @@ ffi::Optional<ExprDoc> TranslateReduce(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<te::ReduceNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslateReduce>());
+      kDocTranslate, FDocTranslate::FromNative<&ReduceDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/tirx/script/printer/for_loop.cc b/src/tirx/script/printer/for_loop.cc
index 89eb80824e..ef92920dd5 100644
--- a/src/tirx/script/printer/for_loop.cc
+++ b/src/tirx/script/printer/for_loop.cc
@@ -33,8 +33,8 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> EmitFor(DocTranslatorObj* d, ffi::AnyView input,
-                               const ffi::Object* destination) {
+ffi::Optional<ExprDoc> ForDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object* destination) {
   const auto* loop =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::ForNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -144,7 +144,7 @@ ffi::Optional<ExprDoc> EmitFor(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::ForNode>().attr(kDocTranslate,
-                                                     FDocTranslate::FromNative<&EmitFor>());
+                                                     FDocTranslate::FromNative<&ForDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/tirx/script/printer/function.cc b/src/tirx/script/printer/function.cc
index 1193454a33..0a35ce3ce3 100644
--- a/src/tirx/script/printer/function.cc
+++ b/src/tirx/script/printer/function.cc
@@ -17,6 +17,7 @@
  */
 #include <tvm/ffi/extra/structural_visit.h>
 #include <tvm/ir/function.h>
+#include <tvm/ir/global_info.h>
 #include <tvm/ir/prim/op.h>
 #include <tvm/s_tir/stmt.h>
 #include <tvm/tirx/analysis.h>
@@ -29,6 +30,7 @@
 #include <utility>
 #include <vector>
 
+#include "../../../script/printer/dialect_prefix.h"
 #include "../../../script/printer/ir/utils.h"
 #include "utils.h"
 
@@ -39,12 +41,22 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> EmitFunction(DocTranslatorObj* d, ffi::AnyView input,
-                                    const ffi::Object* destination) {
+ffi::Optional<ExprDoc> PrimFuncDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object* destination) {
   const auto* func =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::PrimFuncNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
       << "printer statement-only node cannot fulfill a destination";
+  auto module =
+      d->GetOrCreateExtraState<ffi::Optional<ffi::Dict<ffi::String, ffi::List<GlobalInfo>>>>(
+          "ir.global_info_map");
+  auto names = d->GetExtraConfig<ffi::Array<ffi::String>>("script.binding_names", {});
+  if (!module.has_value() && !names.empty()) {
+    if (auto symbol = func->GetAttr<ffi::String>(tvm::attr::kGlobalSymbol)) {
+      TVM_FFI_CHECK(symbol.value() == names.back(), TypeError)
+          << "printer PrimFunc global_symbol must match its definition name";
+    }
+  }
   VarScope vars(d);
 
   bool legacy_s_tir = func->attrs->dict.count(tvm::attr::kSTir);
@@ -60,7 +72,9 @@ ffi::Optional<ExprDoc> EmitFunction(DocTranslatorObj* d, ffi::AnyView input,
       IdDoc lhs = param_ids[param_index++];
       ExprDoc annotation = d->Translate(var->ty).value();
       d->RecordOrigin(annotation, var->ty);
-      args.push_back(AssignDoc(lhs, std::nullopt, annotation));
+      AssignDoc argument(lhs, std::nullopt, annotation);
+      d->RecordOrigin(argument, var);
+      args.push_back(argument);
     }
 
     auto signature_candidates = CopyImplicitDefs(d);
@@ -201,8 +215,9 @@ ffi::Optional<ExprDoc> EmitFunction(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
+  RegisterDialectPrefix("tirx.prefix", "T");
   ffi::reflection::TypeAttrDef<tirx::PrimFuncNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitFunction>());
+      kDocTranslate, FDocTranslate::FromNative<&PrimFuncDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/tirx/script/printer/ir.cc b/src/tirx/script/printer/ir.cc
index 602004d822..1b62c8b517 100644
--- a/src/tirx/script/printer/ir.cc
+++ b/src/tirx/script/printer/ir.cc
@@ -30,8 +30,8 @@ namespace details {
 
 namespace {
 
-ffi::Optional<ExprDoc> TranslatePointerType(DocTranslatorObj* d, ffi::AnyView input,
-                                            const ffi::Object*) {
+ffi::Optional<ExprDoc> PointerTypeDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                               const ffi::Object*) {
   const auto* ty =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const PointerTypeNode>(input);
   if (auto primitive = ty->element_type.as<PrimType>()) {
@@ -53,11 +53,11 @@ ffi::Optional<ExprDoc> TranslatePointerType(DocTranslatorObj* d, ffi::AnyView in
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<PointerTypeNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&TranslatePointerType>());
+      kDocTranslate, FDocTranslate::FromNative<&PointerTypeDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> TranslateTarget(DocTranslatorObj* d, ffi::AnyView input,
-                                       const ffi::Object*) {
+ffi::Optional<ExprDoc> TargetDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                          const ffi::Object*) {
   const auto* target =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const TargetNode>(input);
   return NamespaceDoc("tirx")->Attr("target")->Call({AnyValue(d, target->ToConfig())});
@@ -65,7 +65,7 @@ ffi::Optional<ExprDoc> TranslateTarget(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<TargetNode>().attr(kDocTranslate,
-                                                  FDocTranslate::FromNative<&TranslateTarget>());
+                                                  FDocTranslate::FromNative<&TargetDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/tirx/script/printer/stmt.cc b/src/tirx/script/printer/stmt.cc
index f1af599e38..7a6894508f 100644
--- a/src/tirx/script/printer/stmt.cc
+++ b/src/tirx/script/printer/stmt.cc
@@ -43,8 +43,8 @@ ffi::Array<StmtDoc> Body(const tirx::Stmt& stmt, DocTranslatorObj* d) {
 
 namespace {
 
-ffi::Optional<ExprDoc> EmitTilePrimitiveCall(DocTranslatorObj* d, ffi::AnyView input,
-                                             const ffi::Object* destination) {
+ffi::Optional<ExprDoc> TilePrimitiveCallDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                                     const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::TilePrimitiveCallNode>(
           input);
@@ -140,11 +140,11 @@ ffi::Optional<ExprDoc> EmitTilePrimitiveCall(DocTranslatorObj* d, ffi::AnyView i
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::TilePrimitiveCallNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitTilePrimitiveCall>());
+      kDocTranslate, FDocTranslate::FromNative<&TilePrimitiveCallDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitEvaluate(DocTranslatorObj* d, ffi::AnyView input,
-                                    const ffi::Object* destination) {
+ffi::Optional<ExprDoc> EvaluateDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::EvaluateNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -162,11 +162,11 @@ ffi::Optional<ExprDoc> EmitEvaluate(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::EvaluateNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitEvaluate>());
+      kDocTranslate, FDocTranslate::FromNative<&EvaluateDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitReturn(DocTranslatorObj* d, ffi::AnyView input,
-                                  const ffi::Object* destination) {
+ffi::Optional<ExprDoc> ReturnDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                          const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::ReturnNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -176,12 +176,12 @@ ffi::Optional<ExprDoc> EmitReturn(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::ReturnNode>().attr(kDocTranslate,
-                                                        FDocTranslate::FromNative<&EmitReturn>());
+  ffi::reflection::TypeAttrDef<tirx::ReturnNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&ReturnDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitBind(DocTranslatorObj* d, ffi::AnyView input,
-                                const ffi::Object* destination) {
+ffi::Optional<ExprDoc> BindDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                        const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::BindNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -201,12 +201,12 @@ ffi::Optional<ExprDoc> EmitBind(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::BindNode>().attr(kDocTranslate,
-                                                      FDocTranslate::FromNative<&EmitBind>());
+  ffi::reflection::TypeAttrDef<tirx::BindNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&BindDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitAssert(DocTranslatorObj* d, ffi::AnyView input,
-                                  const ffi::Object* destination) {
+ffi::Optional<ExprDoc> AssertStmtDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::AssertStmtNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -224,11 +224,11 @@ ffi::Optional<ExprDoc> EmitAssert(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::AssertStmtNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitAssert>());
+      kDocTranslate, FDocTranslate::FromNative<&AssertStmtDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitWhile(DocTranslatorObj* d, ffi::AnyView input,
-                                 const ffi::Object* destination) {
+ffi::Optional<ExprDoc> WhileDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                         const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::WhileNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -239,12 +239,12 @@ ffi::Optional<ExprDoc> EmitWhile(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::WhileNode>().attr(kDocTranslate,
-                                                       FDocTranslate::FromNative<&EmitWhile>());
+  ffi::reflection::TypeAttrDef<tirx::WhileNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&WhileDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitBreak(DocTranslatorObj* d, ffi::AnyView input,
-                                 const ffi::Object* destination) {
+ffi::Optional<ExprDoc> BreakDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                         const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::BreakNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -254,12 +254,12 @@ ffi::Optional<ExprDoc> EmitBreak(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::BreakNode>().attr(kDocTranslate,
-                                                       FDocTranslate::FromNative<&EmitBreak>());
+  ffi::reflection::TypeAttrDef<tirx::BreakNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&BreakDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitContinue(DocTranslatorObj* d, ffi::AnyView input,
-                                    const ffi::Object* destination) {
+ffi::Optional<ExprDoc> ContinueDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::ContinueNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -270,11 +270,11 @@ ffi::Optional<ExprDoc> EmitContinue(DocTranslatorObj* d, ffi::AnyView input,
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   ffi::reflection::TypeAttrDef<tirx::ContinueNode>().attr(
-      kDocTranslate, FDocTranslate::FromNative<&EmitContinue>());
+      kDocTranslate, FDocTranslate::FromNative<&ContinueDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitIf(DocTranslatorObj* d, ffi::AnyView input,
-                              const ffi::Object* destination) {
+ffi::Optional<ExprDoc> IfThenElseDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                              const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::IfThenElseNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -288,12 +288,12 @@ ffi::Optional<ExprDoc> EmitIf(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::IfThenElseNode>().attr(kDocTranslate,
-                                                            FDocTranslate::FromNative<&EmitIf>());
+  ffi::reflection::TypeAttrDef<tirx::IfThenElseNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&IfThenElseDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitSeq(DocTranslatorObj* d, ffi::AnyView input,
-                               const ffi::Object* destination) {
+ffi::Optional<ExprDoc> SeqStmtDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                           const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::SeqStmtNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -338,12 +338,12 @@ ffi::Optional<ExprDoc> EmitSeq(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::SeqStmtNode>().attr(kDocTranslate,
-                                                         FDocTranslate::FromNative<&EmitSeq>());
+  ffi::reflection::TypeAttrDef<tirx::SeqStmtNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&SeqStmtDocTranslate>());
 }
 
-ffi::Optional<ExprDoc> EmitAttr(DocTranslatorObj* d, ffi::AnyView input,
-                                const ffi::Object* destination) {
+ffi::Optional<ExprDoc> AttrStmtDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                            const ffi::Object* destination) {
   const auto* stmt =
       ffi::details::AnyUnsafe::RawObjectPtrFromAnyViewAfterCheck<const tirx::AttrStmtNode>(input);
   TVM_FFI_CHECK(destination == nullptr, TypeError)
@@ -417,8 +417,8 @@ ffi::Optional<ExprDoc> EmitAttr(DocTranslatorObj* d, ffi::AnyView input,
 }
 
 TVM_FFI_STATIC_INIT_BLOCK() {
-  ffi::reflection::TypeAttrDef<tirx::AttrStmtNode>().attr(kDocTranslate,
-                                                          FDocTranslate::FromNative<&EmitAttr>());
+  ffi::reflection::TypeAttrDef<tirx::AttrStmtNode>().attr(
+      kDocTranslate, FDocTranslate::FromNative<&AttrStmtDocTranslate>());
 }
 
 }  // namespace
diff --git a/src/tirx/script/printer/utils.h b/src/tirx/script/printer/utils.h
index 17a4020587..6f185ec859 100644
--- a/src/tirx/script/printer/utils.h
+++ b/src/tirx/script/printer/utils.h
@@ -38,8 +38,8 @@ ffi::Optional<ExprDoc> TranslateFFIKernel(DocTranslatorObj* d, const CallNode* c
 ffi::Optional<ExprDoc> TranslateTIRCall(DocTranslatorObj* d, const CallNode* call,
                                         const Type& result_type, const ffi::Array<ExprDoc>& args);
 ExprDoc TensorRegionValue(DocTranslatorObj* d, const TensorRegionNode* region, bool require_region);
-ffi::Optional<ExprDoc> TranslateVar(DocTranslatorObj* d, ffi::AnyView input,
-                                    const ffi::Object* destination);
+ffi::Optional<ExprDoc> VarDocTranslate(DocTranslatorObj* d, ffi::AnyView input,
+                                       const ffi::Object* destination);
 
 }  // namespace details
 }  // namespace printer
diff --git a/tests/python/s_tir/script/test_s_tir_script_printer.py b/tests/python/s_tir/script/test_s_tir_script_printer.py
index 70c2a04a3d..67827a68a1 100644
--- a/tests/python/s_tir/script/test_s_tir_script_printer.py
+++ b/tests/python/s_tir/script/test_s_tir_script_printer.py
@@ -17,9 +17,7 @@
 # ruff: noqa: E501, F841
 """S-TIR script printer."""
 
-import io
 import re
-import tokenize
 
 import pytest
 from tvm_ffi.access_path import AccessPath
@@ -423,55 +421,6 @@ def func(A: T.Buffer((128, 128), "float32", layout=None), B: T.Buffer((256, 256)
     _assert_print(main, expected_output)
 
 
-def test_variable_with_cpp_address():
-    """The show_object_address option displays the C++ addressess
-
-    Because the C++ address may vary with each execution, the output
-    produced with this option cannot be compared to a fixed string.
-    Instead, this test uses the normal script output to generate a
-    regular expression against with the test output must match.  The
-    regular expression validates that all names have been appended
-    with "_0x" followed by a hexadecimal number, and that the address
-    is the same for each variable.
-    """
-    from tvm.script import tirx as TB
-
-    # The test function has all named objects suffixed with "_name",
-    # to avoid spurious replacement when generating the expected
-    # regex.
-    N_name = I.dynamic("N_name")
-
-    @Ts.prim_func
-    def func(A_name: TB.Buffer(N_name, "float32")):
-        for i_name in range(N_name):
-            A_name[i_name] = A_name[i_name] + 1.0
-
-    without_address = func.script(show_object_address=False)
-    script = func.script(show_object_address=True)
-
-    # Address suffixes belong to identifiers, not display-name string literals
-    # passed to constructors such as I.dynamic("N_name").
-    names = {"a_name", "A_name", "N_name", "i_name"}
-    line_offsets = [0]
-    for line in without_address.splitlines(keepends=True):
-        line_offsets.append(line_offsets[-1] + len(line))
-    parts = []
-    seen = set()
-    cursor = 0
-    for token in tokenize.generate_tokens(io.StringIO(without_address).readline):
-        name = token.string
-        if token.type != tokenize.NAME or name not in names:
-            continue
-        start = line_offsets[token.start[0] - 1] + token.start[1]
-        end = line_offsets[token.end[0] - 1] + token.end[1]
-        parts.append(re.escape(without_address[cursor:start]))
-        parts.append(rf"(?P={name})" if name in seen else rf"(?P<{name}>{name}_0x[A-Fa-f0-9]+)")
-        seen.add(name)
-        cursor = end
-    parts.append(re.escape(without_address[cursor:]))
-    assert re.fullmatch("".join(parts), script)
-
-
 def test_return_statement():
     from tvm.script import tirx as TB