-
Notifications
You must be signed in to change notification settings - Fork 203
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
Added staticSingleSample flag, and optimize mesh attributes by default #989
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of converting into default time values makes sense to me. Keeping this as an option is a good call as well. Thank you.
@dgovil I looked at the failures, it may be something on our end. I saw the same test (testUsdExportAsClip) failed yesterday for another PF. Let's ignore it for now while we investigate. |
Actually, I just recalled that we have this test ( |
Hmm. I know that there was fix made in core USD that addressed this for us, and I haven't seen it crop up again when running tests. That change should be in core USD 20.11: |
We have adopted 20.11 some time ago. Something to monitor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgovil I tested this change much more and it looks like it actually causes testUsdExportAsClip
to fail all the time. Without your change, this test never failed in my local env. Now it's failing all the time. Please investigate.
@kxl-adsk I'll take a look...do you have any failure details outside of what the build logs provide that might help me debug? It's odd that windows and mac are unaffected. I'll see if i can spin up a linux VM to test it out on. What is the linux distro used here? For reference (so people don't need to go log spelunking), this is the traceback from the logs
|
I was actually testing it on Windows...with different Maya and USD version. Failed for all of them. Don't have the log at hand now...will post ASAP. |
Thanks. That might be something to be concerned about for the CI as well then since the CI logs say windows passed. |
This particular test we have filtered out on CI for windows and macOS. It was failing randomly when we switched to run tests in parallel so we kept it off in there. Linux runs tests in serial, and this is why we never turned it off. With comments from Matt (#989 (comment)), looks like we could try to re-enable this test now. |
Verbose output of the test doesn't add any more data than what you already posted above, but just for sake of completeness here is what I get on Windows:
|
Thanks. I can reproduce here now as well, when running the test individually. I'll update this PR later this week with the changes. |
d90f4fd
to
e0c5140
Compare
Hi @mattyjams , I'm just wondering if you can shed some light on what's going on here. The specific error it's giving is for
If I look at the Both files should have identical values on that frame for
However if you look at the As far as I can tell, the |
Okay received some clarifying information:
So what I think I'll do is remove the automatic optimization of mesh attributes from this PR and gate it behind the flag like everything else. That way, people who want it on can turn it on, but things like Clips do not break, since they expect the time sampled behaviour. I'll update the PR in a bit. |
e0c5140
to
ceca05e
Compare
Okay, updated the code and tests accordingly. Both the new test and the existing clips test pass locally (along with the other tests that weren't affected). 🤞🏽that the CI passes too. |
ceca05e
to
c7e78e9
Compare
@kxl-adsk sorry, i just saw the CI clang format issue on the comment line. I pushed a change to fix that now. |
Adjust testUsdExportAsClip to handle single timesamples being converted to static values
c7e78e9
to
cd75434
Compare
@@ -0,0 +1,64 @@ | |||
#!/pxrpythonsubst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @dgovil, one more thing for you. :)
I think this newly added test got left out of the CMakeLists.txt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right, and thanks for catching that. I'd missed cherry picking that out of our internal repo.
Fixed in: #1012
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like us to have more visibility on code coverage. This way we could automatically detect if PR is lowering the coverage.
Of course, this should have been caught easily by checking logs, but I would like to eliminate possibility for errors and have some metrics to indicate how well pull request changes are tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a good idea. It would have to be two fold though, because in this case the test existed so coverage tools might erroneously consider it covered?
Perhaps a test to see if new test files are covered in the CMakeList, since it's an easy mistake to make would help? I assume the project prefers not to just Glob all the tests in the dir right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look for example at lcov (and gcov) to get a better sense of what type of information you can acquire from your test suit. And maybe it wasn’t explicit, but test actually have to run in order to report coverage for new code blocks/methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I misunderstood what you were saying. Yes that makes sense.
This is a PR that adds an export optimization to convert attributes with single time samples to static values.
This is run by default for common mesh attributes as they have the benefit of reducing the complexity of the USD, especially for USD readers. For example, this will benefit round tripping USD files into maya since point cached meshes will be able to import their UVs if they're static.
For all other prim attributes, this is gated behind a new flag called staticSingleSamples. This is off by default to prevent any unwanted surprises if someone was expecting a single keyframe to persist through.
We find, with even the files generated by the included test, that a single attribute results in a 32 byte savings for usda file , and a 67 byte savings for a usdc file due to empty padding in usdc. This scales somewhat linearly with the complexity of the file, so could result in reasonable size reductions overall. As we generate lots of usdz files for distribution over the web, this flag is beneficial to us, and we think it would be beneficial for third parties as well.