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

Look parameters don't contribute to Config cache ID #1817

Closed
michdolan opened this issue Jul 28, 2023 · 1 comment · Fixed by #1873
Closed

Look parameters don't contribute to Config cache ID #1817

michdolan opened this issue Jul 28, 2023 · 1 comment · Fixed by #1873

Comments

@michdolan
Copy link
Collaborator

I found this issue while working on ocioview. It appears that parameters beyond a Look's name don't contribute to the Config cache ID. Changing a look's process space and transforms produce the same cache result. For example:

>>> config = ocio.Config()
>>> config.getCacheID()
'429777eef17eb0f7c67e6d14e48d9a04:6001c324468d497f99aa06d3014798d8'
>>> config.addLook(ocio.Look("test"))
>>> config.getCacheID()
'63cee16e9b88f86dc9cdb903eae2c1e:6001c324468d497f99aa06d3014798d8'
>>> config.addLook(ocio.Look("test", transform=ocio.ExponentTransform()))
>>> config.getCacheID()
'63cee16e9b88f86dc9cdb903eae2c1e:6001c324468d497f99aa06d3014798d8'
>>> config.addLook(ocio.Look("test", processSpace="ACEScg", transform=ocio.ExponentTransform()))
>>> config.getCacheID()
'63cee16e9b88f86dc9cdb903eae2c1e:6001c324468d497f99aa06d3014798d8'
@doug-walker
Copy link
Collaborator

doug-walker commented Aug 27, 2023

Thanks for the report Michael. It looks like there is a bug in:
void Config::addLook(const ConstLookRcPtr & look)

If there is already a look with the same name, the code replaces it but neglects to call:
AutoMutex lock(getImpl()->m_cacheidMutex);
getImpl()->resetCacheIDs();

So getCacheID() is not regenerating the ID, it's pulling the stale one from the cacheID cache.

This would be an easy bug for someone, adding the "good first issue" label.

@doug-walker doug-walker added the good first issue Standard label for new developers to locate good issues to tackle to learn about OCIO development. label Aug 27, 2023
@doug-walker doug-walker removed the good first issue Standard label for new developers to locate good issues to tackle to learn about OCIO development. label Sep 27, 2023
@remia remia linked a pull request Oct 10, 2023 that will close this issue
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 a pull request may close this issue.

2 participants