Skip to content

Generator ASSERT should be failing for wasm but is ignored #307

@dbanks12

Description

@dbanks12

Assertions should be failing for wasm relating to generator indices, but ASSERT does nothing in wasm.

When you build for --preset wasm with -DCMAKE_BUILD_TYPE=Debug (set during cmake configure or in wasm preset), it makes ASSERT work. Turns out the following assertion is failing for wasm, but it only materializes when in debug mode:

    ASSERT(index.sub_index < num_generators_per_hash_index);

Assertion is here in get_generator_data.

In a non-debug build (when assertions are ignored), get_generator_data is called with index.sub_index = 34 while num_generators_per_hash_index is a constant 16 for wasm.

To replicate:

# checkout master
cd circuits/cpp
cmake --preset wasm -DCMAKE_BUILD_TYPE=Debug && cmake --build --preset wasm --target aztec3_circuits_abis_tests
wasmtime --dir .. ./build-wasm/bin/aztec3_circuits_abis_tests --env GTEST_FILTER=*.hash_vk*

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bugType: Bug. Something is broken.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions