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

Misleading warning relating to parameter type-check #536

Open
paulmelis opened this issue Jul 25, 2022 · 3 comments
Open

Misleading warning relating to parameter type-check #536

paulmelis opened this issue Jul 25, 2022 · 3 comments

Comments

@paulmelis
Copy link

Updating ospTutorial.cpp to render a single quad instead of 2 triangles:

std::vector<vec4ui> index = {vec4ui(0, 1, 2, 3)};

main()
{
    ospray::cpp::Geometry mesh("mesh");
    // ....
    mesh.setParam("index", ospray::cpp::CopiedData(index));
    mesh.commit();
}

With 2.10 and running with --osp:debug this gives an incorrect warning, as the index array isn't ignored, judging by the second line:

ospray::Mesh ignoring 'index' 1D array with element type vec4ui (while looking for 1D array of vec3ui)
ospray::Mesh created: #primitives=1, #vertices=4
@johguenther
Copy link
Contributor

Similar to #396, where we agreed that a rewording to "while looking for 1D array of vec3ui" softens the edge of the warning. Apparently not enough?

@paulmelis
Copy link
Author

paulmelis commented Jul 25, 2022

Hmm, yes, I remember that one now. It indeed still throws me off, even with the rewording. I guess the main issue (probably not easy to solve) is that this type of warning is generated as part of a sequence of checks to set the parameter value, based on the supported types. But having a warning when one of those type option checks fails isn't that useful, because what is the user supposed to do with that information? As long as there's later a successful type match no warning is actually needed for the non-matching types.

In short: it would be better to only emit a warning if all types checked were incompatible, as the current form highlights a partial fail without explicitly mentioning the final success (i.e. nothing to worry about). And even though I originally reported the issue at the beginning of 2020, more than 2 years later it still puts me on the wrong foot, especially after picking up working with OSPRay again after a long time 😁

@johguenther
Copy link
Contributor

I agree that the warning is not ideal. Improving that will need a rather large overhaul of the parameter checking mechanisms (which may come with more ANARI conformance and infrastructure).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants