Conversation
…nner validation tests to include virtual stage
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 68 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // increment position by tiny amount to get off the element if | ||
| // tracing to the same element |
There was a problem hiding this comment.
Fixed typo: 'increment' should start with capital 'I' to match comment style, and the comment should end with a period.
| // increment position by tiny amount to get off the element if | |
| // tracing to the same element | |
| // Increment position by tiny amount to get off the element if | |
| // tracing to the same element. |
| float (&min_coord_global)[3], | ||
| float (&max_coord_global)[3]); | ||
|
|
||
| } // namespace embree_helper |
There was a problem hiding this comment.
Namespace comment is incorrect. Should be '// namespace SolTrace::EmbreeRunner' to match the actual namespace declaration at line 8.
| } // namespace embree_helper | |
| } // namespace SolTrace::EmbreeRunner |
| @@ -0,0 +1,90 @@ | |||
| #include "find_element_hit.hpp" | |||
There was a problem hiding this comment.
Incorrect include file name. Should be 'find_element_hit_embree.hpp' instead of 'find_element_hit.hpp'.
| #include "find_element_hit.hpp" | |
| #include "find_element_hit_embree.hpp" |
| TEST(Aperture, BoundingBox) | ||
| { | ||
| } |
There was a problem hiding this comment.
Empty test case should either be implemented or removed. The test name suggests it should test aperture bounding box functionality but has no implementation.
| assert(is_approx(x_minmax[0], -r, 1e-6)); | ||
| assert(is_approx(x_minmax[1], r, 1e-6)); |
There was a problem hiding this comment.
Using assert for input validation in production code. Consider using a proper error handling mechanism or documenting that these are debug-only checks. Asserts are typically disabled in release builds.
| assert(is_approx(x_minmax[0], -r, 1e-6)); | |
| assert(is_approx(x_minmax[1], r, 1e-6)); | |
| if (!is_approx(x_minmax[0], -r, 1e-6)) | |
| throw std::invalid_argument("Cylinder::bounding_box: x_minmax[0] must be approximately -radius"); | |
| if (!is_approx(x_minmax[1], r, 1e-6)) | |
| throw std::invalid_argument("Cylinder::bounding_box: x_minmax[1] must be approximately +radius"); |
| EXPECT_NE(rr->get_event(iidx), RayEvent::ABSORB); | ||
| EXPECT_NE(rr->get_event(iidx), RayEvent::EXIT); | ||
|
|
||
| if(rr->get_event(iidx) == RayEvent::ABSORB) |
There was a problem hiding this comment.
Missing space after 'if' keyword. Should be 'if (rr->get_event(iidx) == RayEvent::ABSORB)'.
| this->number_of_elements += el->get_number_of_elements(); | ||
| el->set_reference_element(this); | ||
| // Mark any added elements as virtual if needed | ||
| if(this->is_virtual()) |
There was a problem hiding this comment.
Missing space after 'if' keyword. Should be 'if (this->is_virtual())'.
| if(this->is_virtual()) | |
| if (this->is_virtual()) |
| // TODO: Fix ? This is really only the top half of the cylinder | ||
| // Clyinder breaks the model since it is a mulit-valued fuction: each | ||
| // x values produces two z values Returning only the positive root |
There was a problem hiding this comment.
Multiple spelling errors: 'Clyinder' should be 'Cylinder', 'mulit-valued fuction' should be 'multi-valued function', and missing period after 'root'.
| // TODO: Fix ? This is really only the top half of the cylinder | |
| // Clyinder breaks the model since it is a mulit-valued fuction: each | |
| // x values produces two z values Returning only the positive root | |
| // TODO: Fix ? This is really only the top half of the cylinder. | |
| // Cylinder breaks the model since it is a multi-valued function: each | |
| // x value produces two z values. Returning only the positive root. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 68 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…cy code build by default
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 70 out of 71 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Steps for Building SolTrace (work in progress) | ||
|
|
||
| SolTrace has been updated to use multiple ray tracing engines in addition to the prior implementation. Currently, there is no graphical user interface (it is underdevelopment). |
There was a problem hiding this comment.
The phrase "it is underdevelopment" should be "it is under development" (missing space).
| SolTrace has been updated to use multiple ray tracing engines in addition to the prior implementation. Currently, there is no graphical user interface (it is underdevelopment). | |
| SolTrace has been updated to use multiple ray tracing engines in addition to the prior implementation. Currently, there is no graphical user interface (it is under development). |
| // Increment position by tiny amount to get off the element if | ||
| // tracing to the same element. | ||
| PosRayElement[0] = PosRayElement[0] + 1.0e-4 * CosRayElement[0]; | ||
| PosRayElement[1] = PosRayElement[1] + 1.0e-4 * CosRayElement[1]; | ||
| PosRayElement[2] = PosRayElement[2] + 1.0e-4 * CosRayElement[2]; |
There was a problem hiding this comment.
In the comment on line 126, "Increment position by tiny amount to get off the element" - this hardcoded offset of 1.0e-4 could cause issues with very small or very large geometries. Consider making this epsilon value scale-dependent or configurable based on the element's characteristic dimensions.
| // TODO: Fix ? This is really only the top half of the cylinder. | ||
| // Cylinder breaks the model since it is a multi-valued function: each |
There was a problem hiding this comment.
The typo "Clyinder" should be "Cylinder" in the comment.
| - name: Install embree (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| shell: pwsh | ||
| run: | | ||
| $embreeVersion = "4.4.0" | ||
| $embreeUrl = "https://github.com/embree/embree/releases/download/v$embreeVersion/embree-$embreeVersion.x64.windows.zip" | ||
| $embreeZip = "$env:TEMP\embree.zip" | ||
| $embreeDir = "C:\embree" | ||
|
|
||
| Write-Host "Downloading Embree $embreeVersion..." | ||
| Invoke-WebRequest -Uri $embreeUrl -OutFile $embreeZip | ||
|
|
||
| Write-Host "Extracting Embree..." | ||
| Expand-Archive -Path $embreeZip -DestinationPath $embreeDir -Force | ||
|
|
||
| # $embreeRoot = Get-ChildItem -Path $embreeDir -Directory -Filter "embree*" | Select-Object -First 1 | ||
| $embreeCMake = Join-Path $embreeDir "lib\cmake\embree-$embreeVersion" | ||
| $embreeLib = Join-Path $embreeDir "bin" | ||
|
|
||
| # Write-Host "Embree root: $($embreeRoot.FullName)" | ||
| Write-Host "Embree CMake: $embreeCMake" | ||
| Write-Host "Embree Lib: $embreeLib" | ||
|
|
||
| echo "embree_DIR=$embreeCMake" >> $env:GITHUB_ENV | ||
| echo "$embreeLib" >> $env:GITHUB_PATH |
There was a problem hiding this comment.
The Windows Embree installation script extracts to a directory path that includes the version number in the zip, but the code assumes a specific directory structure. The commented-out lines suggest there was an attempt to find the embree directory dynamically. This could break if Embree's directory structure changes between versions. Consider making the path detection more robust.
| // Expand bounding boxes slightly to account for float precision | ||
| const float expand = 1e-3f; | ||
| x_minmax[0] -= expand; | ||
| x_minmax[1] += expand; | ||
| y_minmax[0] -= expand; | ||
| y_minmax[1] += expand; | ||
| z_minmax[0] -= expand; | ||
| z_minmax[1] += expand; |
There was a problem hiding this comment.
The bounding box expansion with a hardcoded value of 1e-3f could be problematic for different scales. For very small geometries this could be too large, and for very large geometries it might not be sufficient. Consider making this relative to the bounding box dimensions or element scale.
…explicitly mention adding embree dll path to system path in install instructions
qualand
left a comment
There was a problem hiding this comment.
Thanks for putting this together. Everything is working on my system. I did notice large sections of commented legacy code. Do we want to remove these in the future?
Do you remember where? I thought I removed most of the commented out code that didn't need to stick around. I can take a look and clean it up here. |
I think the main ones that sticked out to me are: |
So the stuff in determine_interaction_type.cpp and bbox_calculator.cpp are code that may be needed/useful in the future when implementing other features. (E.g., the commented out sections of determine_interaction_type.cpp are for user defined transmissivity and reflectivity tables). The code in embree_runner.hpp can be removed. You should see the commit for that in a moment or two. |
taylorbrown75
left a comment
There was a problem hiding this comment.
The embree runner works on my legacy GUI branch. It would be interesting to compare speed performance between embree and native and see how it compares with the legacy code. The embree code is about 33% faster than native with power tower optimizations on for the power-tower-surround_singlefacet test, which is slower than I expected, but that may be because the native runner is faster now thanks to the refactorization.
Do we have a power tower surround multi-facet test? We should see a greater speed up with more elements in the problem geometry. |
Bothe the NativeRunner and EmbreeRunner ValidationTest2 runs the input file Power-tower-surround_singlefacet.stinput which has 6283 elements and traces 50k rays (this is the same test that Taylor is talking about). On my Mac I get the following times for a release build
So the EmbreeRunner is still ~120 times faster than NativeRunner with Power Tower OFF and ~3.5 times faster than NativeRunner with Power Tower ON. So at least on Mac with a release build, there is still a significant speedup for Embree. |
Implementation of EmbreeRunner to utilize Intel's Embree ray tracing library (sold separately...).