Skip to content

more testing #20

@kellen-sun

Description

@kellen-sun
  1. some C++ tests, have cmake generate debug vs release builds
    the debug ones will also compile some gtests, and use asan, try to check for memory use issues

  2. also larger tests, pytest is fine probably. 10k loops larger items. like one graph, reused or stuff like that. have activity monitor open check if memory gets freed back or leaked.

  3. Might be important to test the nanobind structure. specifically since there's a 0 copy use. passing a python obj pointer to C++ for it to own, but then it goes out of scope in python side, will leave C++ with a dangling pointer. Very hard to test this though. Because python boots without Asan, C++ compiled with Asan, will not run. And we cannot strip the Python binary requirement (code signature that forces it to have asan to call an asan binary) to check that (without recompiling the entire python interpreter with asan). a possibility is to use a linux docker to test this part.

  • Specifically consider the potential bug where we do B = Array(A._handle) as a user. Then, if A goes out of scope, its memory is freed. B is still pointing at a freed buffer (internally through its _handle's metal_buffer). It's therefore dangling. As described earlier, hard to catch with Asan, hard to verify (non deterministic gc type stuff could theoretically trigger the issue. ive never seen it though).
  • Need to try to confirm the existence of the bug and fix it

Metadata

Metadata

Assignees

No one assigned

    Labels

    test requestNew or additional tests requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions