-
Notifications
You must be signed in to change notification settings - Fork 399
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
--Add State Value flags for ConfigValues #2382
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
the
CLA Signed
Do not delete this pull request or issue due to inactivity.
label
May 1, 2024
jturner65
force-pushed
the
ConfigVals_addFlags
branch
3 times, most recently
from
May 2, 2024 14:12
73c8bf9
to
2ec5aa4
Compare
jturner65
force-pushed
the
ConfigVals_addFlags
branch
5 times, most recently
from
May 3, 2024 13:36
caff304
to
a0d2ae2
Compare
jturner65
changed the title
--[WIP]Add State Value flags for ConfigValues
--Add State Value flags for ConfigValues
May 6, 2024
jturner65
force-pushed
the
ConfigVals_addFlags
branch
5 times, most recently
from
May 13, 2024 10:58
1a3ea4e
to
87b2fc9
Compare
11 tasks
If ConfigVal values are set programmatically to defaults, the process should use "init" instead of "set". This will make sure the isDefaultVal flag is set to true, and consequently not writing those values to file when requested to. Values set by the existing "set" methods will always be written to file.
Nearly all the values set in the constructors of the various attributes are defaults that are expected to be overwritten only if necessary. Writing these to file is redundant and can, in certain circumstances, cause written JSONs to be in an inappropriate state.
A hidden value would be a pertinent configuration value that is set programmatically and only used internally. These values should not be written to file or exposed to the user except perhaps for debugging.
Not sure if this could even happen (a situation could arise where two different instances could have their _data arrays both be pointers to the same memory location, but just in case.
Hidden fields are set and used internally and will generally not be written to file or exposed to the user except in a debugging capacity. Their labels in Configurations should be camel-case with 2 leading underscores, to help differentiate them from non-hidden fields.
binding value should not have lost "orient_" prefix
'Force_flat_shading should be considered a hidden value, only used internally.
This means a config value is translated by consuming code to some other representation, (i.e. an enum) before it is consumed. These values are stored internally and in files as strings, but require the implementation of custom read functionality to make sure the value read is within the acceptable bounds supported by the program.
jturner65
force-pushed
the
ConfigVals_addFlags
branch
from
May 13, 2024 18:35
87b2fc9
to
c72bd12
Compare
These fields will hold the fully qualified file paths that we wish to consume internally but do not wish to write to disk.
jturner65
force-pushed
the
ConfigVals_addFlags
branch
from
May 14, 2024 13:13
42c3e0a
to
f77221e
Compare
Remove the path and have only relative filepath in primary handle attribute; put fully qualified version in hidden handle attribute. Still fails in some edge cases
This will obviate the need for registering a template before it can be used. Mainly going to be consumed by tests, which often bypass internal control-flow branches that would otherwise automatically register these modified templates.
jturner65
force-pushed
the
ConfigVals_addFlags
branch
from
May 16, 2024 19:20
aad7c60
to
99292e8
Compare
This PR is being broken into 2 PRs. The first of which is here #2396 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR is intended to expand the capabilities of the Configurations without incurring much cost by providing status flags for each ConfigValue that reside within the 4 byte gap the current
_type
field causes due to 8 byte alignment.Modifies the ConfigValType (int)
_type
field to be u_int64_t_typeAndFlags
, where the lower 32 bits correspond to the previous_type
value and the higher 32 bits are used to record state of the ConfigValue, along with necessary plumbing to consume the type value in the same way as before.Adds ConfigValStatus enum (u_int64_t) to hold bit flags representing state of the ConfigValue. Currently 2 flags are supported, ConfigValStatus::isDefault and ConfigVaalStatus::isHidden.
Adds "init" setters that set the ConfigValStatus::isDefault bit of the ConfigValue's _typeAndFlags variable to 1, while the legacy "set" setters set it to 0.
All existing Attributes constructors have their default value setting changed from using variants of "set" to using the new "init"
A check on the "isDefault" flag is added when before writing to JSON.
Not only will these features prevent the unnecessary writing to disk of default fields, but they can also be used to prevent configurations being written in a potentially damaging or indeterminant state due to modifications done internally as part of the program's flow.
How Has This Been Tested
Local c++ and python tests pass
Types of changes
Checklist