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

sync: Categorize error messages #8936

Merged

Conversation

artem-lunarg
Copy link
Contributor

@artem-lunarg artem-lunarg commented Nov 27, 2024

That's all syncval error messages that have different structure. More work is needed to classify this further.

The idea that this should simplify further work when it's in a single place (already this helped to detect some inconsistencies and opportunities to organize this better).

Additional progress on this might allow to filter error messages (as ANGLE does) in more reliable way. Currently ANGLE specifies multiple parts of the error message to identify specific use case. A potential improvement is to filter in a more structured way and to specify more stable values than just arbitrary text snippets.

Initial motivation behind the change is to minimize breaking changes for the clients that filter error messages based on current structure. Having this in a centralized place it should be easier to provide some backward compatibility option if necessary while this is in active development.

TESTING: For testing purposes on the local machine I forced dispatchable handles to have the same value. This allowed to ensure that outputs of all negative syncval tests before and after this change are binary identical (the only potential bug if two dispatchable handles are swapped somehow).

That's all syncval error messages that has different structure.
Made some deduplication work here (single message is shared by
different places), but the main goal was to move to a single place.
More work is needed to classify this further.
@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 311690.

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 18149 running.

#include <cstdarg>
#include <sstream>

// TODO: update algorith in logging.cpp to be similar to this version.
Copy link
Contributor Author

@artem-lunarg artem-lunarg Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per comment, after some testing period this formatting code can be used to update existing code, there are some C++ spec problems with logging.cpp code (but works in practice!), but also it leads to some hacky manipulations that are not needed here.

// in the char indexed as str[std::string::size()] and it should not be
// accesses in this way by client code, only by std::string itself.

static std::string Format(const char* format, ...) {
Copy link
Contributor Author

@artem-lunarg artem-lunarg Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two reasons why Format() is used, say as opposite to streams:

  • Allowed to copy directly existing formatting snippets here
  • In the future this will be easy to replace with std::format() with less changes comparing to using streams.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense... good to add as a comment here

@ci-tester-lunarg
Copy link
Collaborator

CI Vulkan-ValidationLayers build # 18149 passed.

@artem-lunarg artem-lunarg marked this pull request as ready for review November 27, 2024 21:48
@artem-lunarg artem-lunarg requested a review from a team as a code owner November 27, 2024 21:48
@@ -302,11 +294,9 @@ bool RenderPassAccessContext::ValidateStoreOperation(const CommandBufferAccessCo
const char *const op_type_string = checked_stencil ? "stencilStoreOp" : "storeOp";
const char *const store_op_string = string_VkAttachmentStoreOp(checked_stencil ? ci.stencilStoreOp : ci.storeOp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(can be done in a followup PR) but we could pass these in as vvl::Field::stencilStoreOp and then use the String method to print it later

Copy link
Contributor

@spencer-lunarg spencer-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the number of various errors we have in sync val, the idea of categorizing them is a good idea!

Not sure if this will end up being the best way or not to do it, but it seems like a good, logical next step

@artem-lunarg artem-lunarg merged commit e299677 into KhronosGroup:main Nov 27, 2024
21 checks passed
@artem-lunarg artem-lunarg deleted the artem-sync-error-messages branch November 27, 2024 23:44
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

Successfully merging this pull request may close these issues.

3 participants