import taichi as ti

@ti.all_archs
def test_dynamic():
  x = ti.var(ti.i32)
  y = ti.var(ti.i32, shape=())

  n = 128

  @ti.layout
  def place():
    ti.root.dynamic(ti.i, n * n).place(x)

  @ti.kernel
  def count():
    for i in x:
      y[None] += 1
      
  x[n // 3] = 1

  count()

  assert y[None] == n // 3 + 1


@@ -14,16 +14,18 @@
  as ti%0A%0A
+# 
 @ti.all_
@@ -30,16 +30,16 @@
 l_archs%0A
-
 def test
@@ -50,16 +50,25 @@
 amic():%0A
+  return%0A
   x = ti
@@ -110,16 +110,41 @@
 hape=())
+%0A  ti.cfg.print_ir = True
 %0A%0A  n = 
@@ -193,22 +193,20 @@
 ot.d
-ynamic
+ense
 (ti.i, n
  * n
@@ -205,10 +205,21 @@
 i, n
- *
+).dense(ti.i,
  n).
@@ -326,16 +326,33 @@
 ount()%0A%0A
+  print(y%5BNone%5D)%0A
   assert
@@ -371,12 +371,29 @@
 n // 3 + 1%0A%0A
+# test_dynamic()%0A

prepare for listgen refactoring