-
Notifications
You must be signed in to change notification settings - Fork 157
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
feat: Identifier can be customized for sensitive surfaces #1452
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.
I like it 👍
So, if we had lets say 20 surfaces front size and 20 surfaces backside, would you do 0-20 and a side bit, but 0-40 and a side bit ? |
Codecov Report
@@ Coverage Diff @@
## main #1452 +/- ##
==========================================
+ Coverage 48.59% 48.60% +0.01%
==========================================
Files 380 380
Lines 20589 20595 +6
Branches 9431 9433 +2
==========================================
+ Hits 10005 10010 +5
Misses 4097 4097
- Partials 6487 6488 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Good thing.
I addressed @andiwand's comments. Can one of you approve again? |
Hmm. I didn't see hash failures locally... |
The fast-test right after FATRAS only already fails. I'll have to investigate. I'm taking this WIP again. |
Co-authored-by: Alexander J. Pfleger <70842573+AJPfleger@users.noreply.github.com>
Ok I think the hash changes come from the fact that we write the actual geometry id 64bit integer value to the outputs, which clearly changes if we reduce the bit width of the sensitive id. Can you reapprove @andiwand? |
This PR reduces the width of the sensitive part of the geometry identifier from 28bits to 20bits, to make room for an 8bit *extra* identifier part. The idea is that this can be used by experiments to label sensitive elements. The bit masks after the change look like: ```cpp static constexpr Value kVolumeMask = 0xff00000000000000; // (2^8)-1 = 255 volumes static constexpr Value kBoundaryMask = 0x00ff000000000000; // (2^8)-1 = 255 boundaries static constexpr Value kLayerMask = 0x0000fff000000000; // (2^12)-1 = 4096 layers static constexpr Value kApproachMask = 0x0000000ff0000000; // (2^8)-1 = 255 approach surfaces static constexpr Value kSensitiveMask = 0x000000000fffff00; // (2^20)-1 sensitive surfaces static constexpr Value kExtraMask = 0x00000000000000ff; // (2^8)-1 extra values ``` In addition, it adds a hook function to the geometry closure of signature ```cpp GeometryIdentifier(GeometryIdentifier orig, const Surface& surface); ``` to customize the geometry identifier. Technically, this hook can be used to also reset the volume and layer ids, but is primarily intended to set the *extra* components. (cherry picked from commit a5df559)
…1452 to develop/v19.x] (#1479) Backport a5df559 from #1452. --- This PR reduces the width of the sensitive part of the geometry identifier from 28bits to 20bits, to make room for an 8bit *extra* identifier part. The idea is that this can be used by experiments to label sensitive elements. The bit masks after the change look like: ```cpp static constexpr Value kVolumeMask = 0xff00000000000000; // (2^8)-1 = 255 volumes static constexpr Value kBoundaryMask = 0x00ff000000000000; // (2^8)-1 = 255 boundaries static constexpr Value kLayerMask = 0x0000fff000000000; // (2^12)-1 = 4096 layers static constexpr Value kApproachMask = 0x0000000ff0000000; // (2^8)-1 = 255 approach surfaces static constexpr Value kSensitiveMask = 0x000000000fffff00; // (2^20)-1 sensitive surfaces static constexpr Value kExtraMask = 0x00000000000000ff; // (2^8)-1 extra values ``` In addition, it adds a hook function to the geometry closure of signature ```cpp GeometryIdentifier(GeometryIdentifier orig, const Surface& surface); ``` to customize the geometry identifier. Technically, this hook can be used to also reset the volume and layer ids, but is primarily intended to set the *extra* components.
This PR reduces the width of the sensitive part of the geometry identifier from 28bits to 20bits, to make room for an 8bit extra identifier part. The idea is that this can be used by experiments to label sensitive elements. The bit masks after the change look like:
In addition, it adds a hook function to the geometry closure of signature
to customize the geometry identifier. Technically, this hook can be used to also reset the volume and layer ids, but is primarily intended to set the extra components.