Skip to content

ci(test): build and run external example#376

Open
plexoos wants to merge 4 commits into
mainfrom
build-example
Open

ci(test): build and run external example#376
plexoos wants to merge 4 commits into
mainfrom
build-example

Conversation

@plexoos

@plexoos plexoos commented Jun 22, 2026

Copy link
Copy Markdown
Member

This PR adds CI coverage for the standalone simphox external-consumer example and expands the example so it can smoke-test both CPU and CUDA photon generation.

Changes include:

  • Move simphox into examples/simphox/ as a standalone CMake project.
  • Add a CUDA backend for torch photon generation via simphox --gpu; CPU remains the default.
  • Build, install, and run simphox --cpu and simphox --gpu in PR CI against the installed Simphony package.
  • Add missing exported package dependencies/headers needed by downstream consumers:
    • glm in simphonyConfig.cmake
    • srng_traits.h install entry
    • squad.h include from storch.h
  • Update examples/README.md to document simphox as Example 1 and renumber the existing examples.

Testing

  • PR CI builds the develop image, then configures examples/simphox out-of-tree with find_package(simphony REQUIRED).
  • CI installs the example and verifies both:
    • simphox --cpu
    • simphox --gpu
  • Both modes are checked by asserting out/photons.npy is produced.

Copilot AI review requested due to automatic review settings June 22, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a CI validation step to ensure the built Docker image can compile and execute the repository’s example project (intended to validate “external consumer” usage via find_package(simphony)).

Changes:

  • Introduce a new workflow step that builds the CMake project under examples/ inside the PR’s Docker image.
  • Run the built example and assert it produces an expected output file (out/photons.npy).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build-pull-request.yaml Outdated
Comment thread .github/workflows/build-pull-request.yaml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e94ccaef0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/build-pull-request.yaml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread examples/CMakeLists.txt Outdated
Comment thread .github/workflows/build-pull-request.yaml
@plexoos plexoos self-assigned this Jun 23, 2026
@plexoos plexoos added the ci label Jun 23, 2026
@plexoos plexoos force-pushed the build-example branch 3 times, most recently from a619dde to c9c0c8b Compare June 25, 2026 22:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread examples/README.md
Comment on lines +21 to +24
cmake -S . -B build
cmake --build build
./simphox
./simphox --gpu
Comment on lines +33 to +36
else if (arg == "--num-photons" && i + 1 < argc)
{
num_photons = static_cast<unsigned int>(stoul(argv[++i]));
}
Comment on lines +46 to +56
sphoton* d_photons = nullptr;
CUDA_CHECK(cudaMalloc(reinterpret_cast<void**>(&d_photons), photons.size() * sizeof(sphoton)));

constexpr unsigned int threads_per_block = 256;
unsigned int blocks = (num_photons + threads_per_block - 1) / threads_per_block;

generate_photons_kernel<<<blocks, threads_per_block>>>(torch, d_photons, num_photons, seed);
CUDA_SYNC_CHECK();

CUDA_CHECK(cudaMemcpy(photons.data(), d_photons, photons.size() * sizeof(sphoton), cudaMemcpyDeviceToHost));
CUDA_CHECK(cudaFree(d_photons));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants