Skip to content

Deepen GaugeGap into an eight-experiment science library#89

Merged
slavazeph-coder merged 7 commits into
mainfrom
feature/gaugegap-deep-library
Jul 10, 2026
Merged

Deepen GaugeGap into an eight-experiment science library#89
slavazeph-coder merged 7 commits into
mainfrom
feature/gaugegap-deep-library

Conversation

@slavazeph-coder

Copy link
Copy Markdown
Owner

What this adds

Expands the GaugeGap science arcade from four to eight genuinely different interactive systems.

New live experiments

  1. Gravity Forge — launch planets into a Newtonian n-body sandbox, load solar/binary/slingshot presets, and score orbital stability.
  2. Flock Mind — tune alignment/cohesion/separation and influence a Reynolds-boids flock as either predator or beacon.
  3. Outbreak Zero — choose patient zero, spend a limited vaccine budget, and contain an SIR-style process on a contact graph.
  4. Chaos Twins — race two near-identical double pendulums and measure when deterministic trajectories visibly diverge.

Product depth

  • Eight distinct interaction verbs: tune, synchronize, explore, create, construct, influence, intervene and predict
  • One mission and live score per new experiment
  • Shareable URLs preserving experiment settings
  • Model-underneath cards explaining the scientific mechanism
  • New experiment cards and updated homepage positioning
  • Responsive controls and canvas layouts
  • Existing BrainSNN scanner, research workspace and first four labs remain intact

Validation requested

  • TypeScript/noEmit
  • deterministic tests
  • production Vite/Express build
  • MCP smoke test
  • manual interaction pass for pointer/touch and responsive layouts

@slavazeph-coder slavazeph-coder merged commit 7fd0991 into main Jul 10, 2026
1 check passed

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

Code Review

This pull request expands the GaugeGap science arcade from four to eight live experiments by adding four new interactive simulation labs: Gravity Forge (orbital mechanics), Flock Mind (collective intelligence), Outbreak Zero (network epidemiology), and Chaos Twins (deterministic chaos). It also introduces shared chrome components and utilities for these labs, along with corresponding styles. The review feedback highlights a critical coordinate-scaling issue present in the Flock Mind, Outbreak Zero, and Gravity Forge simulations. On smaller screens where the canvas is scaled down, raw pointer and click coordinates do not align with the internal simulation space, causing misaligned interactions. Actionable code suggestions are provided to scale these coordinates relative to the bounding rect dimensions.

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.

Comment on lines +86 to +89
function pointer(event) {
const rect = canvas.getBoundingClientRect();
pointerRef.current = { x: event.clientX - rect.left, y: event.clientY - rect.top, active: true };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

On screens where the canvas bounding rect is smaller than the minimum dimensions (320x360), the canvas is scaled down by the browser. However, the pointer coordinates are calculated using raw client coordinates relative to the bounding rect, which do not match the internal simulation coordinate space. This causes the pointer interaction to be misaligned with the visual elements on smaller screens.

To fix this, scale the pointer coordinates by the ratio of the simulation dimensions to the actual bounding rect dimensions.

    function pointer(event) {
      const rect = canvas.getBoundingClientRect();
      const x = (event.clientX - rect.left) * (width / (rect.width || 1));
      const y = (event.clientY - rect.top) * (height / (rect.height || 1));
      pointerRef.current = { x, y, active: true };
    }

Comment on lines +360 to +363
function onClick(event) {
const rect = canvas.getBoundingClientRect();
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Similar to the flocking simulation, the click coordinates in the outbreak simulation are not scaled to the simulation coordinate space when the canvas bounding rect is smaller than the minimum dimensions (320x360). This makes it difficult or impossible to click nodes near the right or bottom edges on smaller screens.

Scale the click coordinates by the ratio of the simulation dimensions to the actual bounding rect dimensions to ensure accurate node selection.

Suggested change
function onClick(event) {
const rect = canvas.getBoundingClientRect();
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;
function onClick(event) {
const rect = canvas.getBoundingClientRect();
const x = (event.clientX - rect.left) * (width / (rect.width || 1));
const y = (event.clientY - rect.top) * (height / (rect.height || 1));

Comment on lines +128 to +131
function pointerPosition(event) {
const rect = canvas.getBoundingClientRect();
return { x: event.clientX - rect.left, y: event.clientY - rect.top };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

In the gravity simulation, the pointer coordinates used for launching planets are not scaled to the simulation coordinate space when the canvas bounding rect is smaller than the minimum dimensions (320x360). This causes planet launches to be misaligned and have incorrect velocities on smaller screens.

Scale the pointer coordinates by the ratio of the simulation dimensions to the actual bounding rect dimensions to ensure consistent launch behavior across all screen sizes.

    function pointerPosition(event) {
      const rect = canvas.getBoundingClientRect();
      return {
        x: (event.clientX - rect.left) * (width / (rect.width || 1)),
        y: (event.clientY - rect.top) * (height / (rect.height || 1)),
      };
    }

@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: 4dfd2e41be

ℹ️ 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 on lines +47 to +49
const [alignment, setAlignment] = useState(shared?.alignment || 0.72);
const [cohesion, setCohesion] = useState(shared?.cohesion || 0.54);
const [separation, setSeparation] = useState(shared?.separation || 0.86);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve zero-valued flock controls from shared links

When a shared Flock Mind URL contains a valid zero for any slider that allows it, such as ?lab=flock&state=120,0,0,0,predator, these || fallbacks replace the shared values with the defaults. That means links copied from the minimum alignment/cohesion/separation settings do not reload the experiment state the sender actually shared; use nullish fallback so 0 survives parsing.

Useful? React with 👍 / 👎.

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