Skip to content

Fix heatmap not updating on rapid layout parameter changes#46

Draft
Copilot wants to merge 14 commits intomainfrom
copilot/update-build-md-file
Draft

Fix heatmap not updating on rapid layout parameter changes#46
Copilot wants to merge 14 commits intomainfrom
copilot/update-build-md-file

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Heatmap failed to update when users changed layout parameters rapidly. The 3D worker's results were incorrectly discarded because cachedCalculationParams3D was invalidated by layoutGenerated events before the worker completed.

Root Cause

Race condition in result validation:

  1. User changes layout → layoutGenerated fires → cachedCalculationParams3D = null
  2. Worker completes calculation for the (now current) layout
  3. Validation checks cachedCalculationParams3D?.layoutHashundefined
  4. Result discarded despite being valid for current layout

Changes

  • Worker returns layoutHash: beam_worker_3d.js now includes the layoutHash it calculated for in the result message
  • Validate against current layout: Handler compares worker's layoutHash against live getLayoutHash(getAllAntennas()) instead of potentially-invalidated cache params
  • Fallback for compatibility: If worker doesn't return hash, falls back to cachedCalculationParams3D validation
// Before: checked against invalidated cache
if (cachedCalculationParams3D?.layoutHash === currentLayoutHash) { ... }

// After: validate worker result directly against current state
const workerLayoutHash = e.data.layoutHash;
if (workerLayoutHash && workerLayoutHash === currentLayoutHash) {
    cachedCalculationResult3D = e.data.data;
    cachedCalculationParams3D = { layoutHash: currentLayoutHash };
    refreshVisualization();
}

Debug logging added throughout the visualization pipeline to trace future issues.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 30, 2026 18:50
…enable local data loading

Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
…, filename sanitization and accessibility

Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Copilot AI changed the title [WIP] Update BUILD.md for clarity and user guidance Improve BUILD.md, add custom image filename, enable offline data loading Jan 30, 2026
Copilot AI requested a review from Geovannisz January 30, 2026 18:57
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Copilot AI changed the title Improve BUILD.md, add custom image filename, enable offline data loading Remove parameter upper limits, add intensity to heatmap tooltip Jan 30, 2026
… with supersampling

Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Copilot AI changed the title Remove parameter upper limits, add intensity to heatmap tooltip Fix slider limits, enforce periodic param constraints, add supersampling to heatmap tooltip Jan 30, 2026
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Copilot AI changed the title Fix slider limits, enforce periodic param constraints, add supersampling to heatmap tooltip Fix heatmap cache invalidation and add tile grouping feature Jan 30, 2026
…ker synchronization

Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Copilot AI changed the title Fix heatmap cache invalidation and add tile grouping feature Fix heatmap not updating during rapid layout parameter changes Jan 31, 2026
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Copilot AI changed the title Fix heatmap not updating during rapid layout parameter changes Fix heatmap stale cache on rapid layout parameter changes Feb 1, 2026
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Co-authored-by: Geovannisz <82838501+Geovannisz@users.noreply.github.com>
Copilot AI changed the title Fix heatmap stale cache on rapid layout parameter changes Fix heatmap not updating on rapid layout parameter changes Feb 1, 2026
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.

2 participants