Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG in Sparse Spatial Data Structures #6230

Open
Linus-Civil opened this issue Oct 5, 2022 · 1 comment
Open

BUG in Sparse Spatial Data Structures #6230

Linus-Civil opened this issue Oct 5, 2022 · 1 comment
Assignees
Labels
bug We've confirmed that this is an BUG

Comments

@Linus-Civil
Copy link

Describe the bug
The interface function of sparse data structure does not return the result as expected.

To Reproduce

import taichi as ti
ti.init(arch=ti.gpu)

x=ti.field(ti.f32)
block1 = ti.root.pointer(ti.i,3)
block2 = block1.bitmasked(ti.j,3)
block2.place(x)

x[1,1] = 1.2  # this should activate block1 [1] and block2 [4]

@ti.kernel
def check():
    print(ti.is_active(block1,[1])) # output: 1, this result is right
    print(ti.is_active(block2,[4])) # output: 0, not the expected result. Moreover, block2 cannot be indexed with 2 indices here.
    print(ti.rescale_index(block2,block1,[4])) #output: [4], not the expected result. it should print "[1]" here, according to the tutorial.
    for i,j in x:
        print(i,j) #output: 1 1, this result is right

check()
ti.deactivate_all_snodes() #RuntimeError: [D:/a/taichi/taichi/taichi/transforms/type_check.cpp:visit@152] [$28] S1 has 1 indices. Indexed with 2.

Additional comments
I explained all the existing problems in the comments.

@Linus-Civil Linus-Civil added the potential bug Something that looks like a bug but not yet confirmed label Oct 5, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Oct 5, 2022
@yuanming-hu yuanming-hu added bug We've confirmed that this is an BUG and removed potential bug Something that looks like a bug but not yet confirmed labels Oct 14, 2022
@yuanming-hu
Copy link
Member

yuanming-hu commented Oct 14, 2022

Thank you for pointing this out! I confirm there's a bug here. Will take a close look later. My response to this will not be quick (since I need to look deep inside), but this issue provides valuable information, thanks!

@yuanming-hu yuanming-hu self-assigned this Oct 14, 2022
@FantasyVR FantasyVR moved this from Untriaged to Todo in Taichi Lang Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We've confirmed that this is an BUG
Projects
Status: Todo
Development

No branches or pull requests

2 participants