conduit icon indicating copy to clipboard operation
conduit copied to clipboard

The topology_transform_dtypes test under t_blueprint_mesh_transform.cpp is broken

Open siramok opened this issue 4 months ago • 3 comments

As part of the work in investigating #1646 it came to our attention that the topology_transform_dtypes test (located here) within t_blueprint_mesh_transform.cpp appears to have been broken all along. The problem lies here:

                    Node imesh = ibase;
                    Node &itopology = imesh["topologies"].child(0);
                    Node &icoordset = imesh["coordsets"].child(0);

                    // FIXME(JRC): I think these should be references! i.e. Node &jtopology
                    // Changing them in this way causes this test to fail.
                    Node jmesh;
                    Node jtopology = jmesh["topologies"][itopology.name()];
                    Node jcoordset = jmesh["coordsets"][icoordset.name()];

                    set_node_data(imesh, bputils::INT_DTYPES[ii]);
                    set_node_data(imesh, bputils::FLOAT_DTYPES[fi]);

                    to_new_topology(itopology, jtopology, jcoordset);

                    EXPECT_TRUE(verify_node_data(jmesh, bputils::INT_DTYPES[ii]));
                    EXPECT_TRUE(verify_node_data(jmesh, bputils::FLOAT_DTYPES[fi]));

Since jtopology and jcoordset are not Node references, jmesh is empty by the time that verify_node_data gets called. Since it's purpose is to verify that the dtypes of the childeren an input Node match the expected dtypes, passing in an empty Node finds nothing wrong and this test therefore passes.

Someone should investigate whether this test exercises a capability that matters/makes sense, and if the answer is yes, explore what it would take to fix this test.

siramok avatar Jul 22 '26 17:07 siramok

corrected permalink: https://github.com/llnl/conduit/blob/529e7d7aaa8f45fe881e649b051d366f2c7c2a14/src/tests/blueprint/t_blueprint_mesh_transform.cpp#L384

JustinPrivitera avatar Jul 22 '26 23:07 JustinPrivitera

Thank you, I linked to the beginning of the test but not to the specific chunk of code I shared.

siramok avatar Jul 23 '26 00:07 siramok

Another piece of related info that may assist in solving this issue, an old comment from JRC:

    // TODO(JRC): In this case, should we reach back into the coordset
    // and use its types to inform those of the topology?
    DataType int_dtype = bputils::find_widest_dtype(topo, bputils::DEFAULT_INT_DTYPES);

siramok avatar Jul 23 '26 00:07 siramok