Skip to content

Add Large diffusion example (250k atoms, KOKKOS)#379

Merged
andeplane merged 4 commits into
mainfrom
feat/large-diffusion
Jul 8, 2026
Merged

Add Large diffusion example (250k atoms, KOKKOS)#379
andeplane merged 4 commits into
mainfrom
feat/large-diffusion

Conversation

@andeplane

Copy link
Copy Markdown
Owner

Adds Large diffusion next to the Diffusion example: identical physics with variable L equal 50.0~250,000 LJ atoms, running multithreaded via the suffix kk marker.

  • Browser-verified: 250,000 atoms at ~59 timesteps/second with pair lj/cut/kk, no errors, app healthy afterwards.
  • Camera directives scaled with the box (×3.33), preserving the original Diffusion framing.
  • large_diffusion.png is a placeholder (copy of the Diffusion image) — to be replaced with a real capture before/after merge.

🤖 Generated with Claude Code

Same physics as the Diffusion example but with `variable L equal 50.0` —
~250,000 LJ atoms (50x50x25 fcc cells) — placed right after Diffusion in the
library. Runs multithreaded via the `suffix kk` marker; browser-verified at
~59 timesteps/second with pair lj/cut/kk, and the app stays healthy after.
Camera directives scaled with the box (same framing as the original).

The screenshot is a placeholder (copy of the Diffusion image) to be replaced
with a real capture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request expands the project's simulation examples by adding a high-atom-count diffusion scenario. The new example is designed to leverage KOKKOS for improved multithreaded execution, providing a performance-oriented benchmark for users. The changes include the necessary input script and registration within the application's example manifest.

Highlights

  • New Example Added: Introduced a 'Large diffusion' example featuring approximately 250,000 atoms, utilizing KOKKOS for multithreaded performance.
  • Configuration Updates: Updated the examples registry to include the new large-scale diffusion simulation and performed minor indentation cleanup in the configuration file.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new "Large diffusion" simulation example, including its LAMMPS input script and its metadata configuration in examples.json. It also cleans up the indentation of some existing entries in the JSON file. The review feedback highlights three main improvement opportunities: simplifying redundant immediate evaluation syntax in the LAMMPS script, using the correct dynamic variable reference syntax (v_name) instead of immediate text substitution, and correcting an inverted markdown link syntax in the simulation's description.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

#/atom 2 1.5 #ff0000

variable L equal 50.0
variable Lhalf equal $(0.5*v_L)

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.

medium

In LAMMPS, using immediate evaluation $(...) inside an equal style variable definition is redundant and can be simplified. Defining Lhalf as a standard formula 0.5*v_L is cleaner and more idiomatic.

variable Lhalf equal 0.5*v_L

Comment on lines +23 to +24
variable left equal 0.5*$L-0.5*${thickness}
variable right equal 0.5*$L+0.5*${thickness}

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.

medium

In LAMMPS, equal-style variables should reference other variables using the v_name syntax (e.g., v_L and v_thickness) rather than immediate text substitution ($L and ${thickness}). Using v_name ensures that the formulas are evaluated dynamically and follow standard LAMMPS scripting best practices.

variable left equal 0.5*v_L-0.5*v_thickness
variable right equal 0.5*v_L+0.5*v_thickness

"id": "large_diffusion",
"title": "Large diffusion",
"description": "A large version of the diffusion example (~250,000 atoms) that runs multithreaded with KOKKOS. The white atoms have mass 1 while the red atoms have mass 4.",
"analysisDescription": "# About this simulation\nWe simulate two Lennard Jones particle types with masses 1.0 and 4.0. The diffusion coefficient [https://en.wikipedia.org/wiki/Mass_diffusivity](scales like) D$\\propto 1/\\sqrt{m}$, so we should see a factor 2 higher diffusion coefficient for the small molecules.",

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.

medium

The markdown link syntax in analysisDescription is inverted. In markdown, the format is [link text](URL). It should be [scales like](https://en.wikipedia.org/wiki/Mass_diffusivity) instead of [https://en.wikipedia.org/wiki/Mass_diffusivity](scales like).

Suggested change
"analysisDescription": "# About this simulation\nWe simulate two Lennard Jones particle types with masses 1.0 and 4.0. The diffusion coefficient [https://en.wikipedia.org/wiki/Mass_diffusivity](scales like) D$\\propto 1/\\sqrt{m}$, so we should see a factor 2 higher diffusion coefficient for the small molecules.",
"analysisDescription": "# About this simulation\nWe simulate two Lennard Jones particle types with masses 1.0 and 4.0. The diffusion coefficient [scales like](https://en.wikipedia.org/wiki/Mass_diffusivity) D$\\propto 1/\\sqrt{m}$, so we should see a factor 2 higher diffusion coefficient for the small molecules.",

andeplane and others added 3 commits July 8, 2026 21:28
The hardcoded /atomify/ prefix got base-prepended again by Vite's dev HTML
transform (-> /atomify/atomify/... 404). A relative src resolves against the
page URL in both dev and the production build. Harmless in dev beyond the
noise (vite serves COOP/COEP headers directly and the shim no-ops when
already isolated), but now it loads cleanly everywhere.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Vite's dev transform rewrote the ~43 MB emscripten module and appended an
inline sourcemap, inflating the worker's fetch to ~460 MB — slow at best,
and enough to crash the tab ("Aw, Snap! error code 5"). The module is only
ever loaded via `?url` + fetch-as-blob, never bundled, so a small dev-only
middleware now streams the file as-is before Vite's transform runs
(`?url`/`?import` shim requests still go through Vite untouched).

Verified: dev download is 41.4 MB with a correct Content-Length, the module
loads in ~2 s, simulations run; production build unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the placeholder (copy of the Diffusion image) with a capture of the
actual 250k-atom simulation, resampled to 1000px wide to match the other
example images.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andeplane
andeplane enabled auto-merge July 8, 2026 19:47
@andeplane
andeplane merged commit d9f8bc3 into main Jul 8, 2026
2 checks passed
@andeplane
andeplane deleted the feat/large-diffusion branch July 8, 2026 19:49
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 this pull request may close these issues.

1 participant