All MicroEvals
Coding evloution simulator test
Create MicroEval

Coding evloution simulator test

Coding evloution simulator test

Prompt

Shortened Prompt: Single-File 3D Universe & Climate Sandbox Core Objective Develop a single-file, production-quality, browser-based 3D universe simulator and interactive physics sandbox. The application must blend a stable N-body gravity engine, procedural planet generation, an energy-balance climate model, a particle-based impact/destruction framework, and habitability analytics. Prioritize physical consistency, scannable scientific data visualization, and aggressive performance scalability over cartoon visuals. 1. Technical Stack & Architecture • Technologies: Single self-contained HTML5 file utilizing CSS3, modern JavaScript (ES2020+), WebGL2, GLSL shaders, Typed Arrays, Web Workers, and requestAnimationFrame. Zero external API dependencies; minimize and explicitly document any core external libraries. • Precision & Scale: Implement a floating-origin / origin-rebasing coordinate system to support astronomical distances without precision loss. Use double-precision math where critical, local hierarchies, and camera-relative rendering. • Adaptive Performance Framework: Implement a central Simulation Quality / Performance Controller with user-selectable resolutions (\(16^{2}\) to \(1024^{2}\)) and distinct climate grids (Low \(32\times16\) to Extreme \(512\times256\)). Build an automatic performance governor tracking FPS, frame/physics/render times, and GPU load. Dynamically scale particle counts, ray-marching quality, shadow/texture resolutions, and terrain tessellation across modes (Maximum Quality, Balanced, Performance, Potato, Custom) without silently degrading core physics precision. Provide explicit warnings if timesteps become unstable. 2. Core Physics & Simulation Engines N-Body Gravity & Time Control • Integration: Multi-body Newtonian gravity (\(F = G \frac{m_1 m_2}{r^2}\)) using a symplectic integrator (e.g., Leapfrog or Velocity Verlet) for long-term orbital stability, tracking slingshots, tidal locking, decay, and hyperbolic trajectories. • Time Step & Scale: Adjustable physics timesteps (\(0.01\text{s}\) to \(1\text{ year}\)) and time acceleration scales (\(0.001\times\) to \(1,000,000\times\)). • Long-Term Strategy: Use hierarchical levels (Micro particle, Meso regional climate, Macro planet climate, Orbital integration) to approximate millions of years without performance failure. Protect against NaN, Infinity, and division-by-zero errors. Show conservation of mass, energy, and momentum drift in a debug mode. Planet & Star Generation • Stellar Classes: Red/Orange/Yellow/White/Blue-White Dwarfs, Giants, Supergiants (customizable mass, radius, luminosity, temperature, age, metallicity). • Procedural Planets: Terrestrial, Super-Earth, Ocean, Desert, Ice, Gas/Ice Giants, Lava, Carbon, and Rogue planets. Generate multi-scale terrain features (continents down to micro-roughness) using layered noise (Perlin, Simplex, fBm, domain warping). • Dynamic Materials: Generate procedural shader-based maps (albedo, normal, roughness, specular, height, emissive, dynamic cloud layers, population-based night lights). Terrain must dynamically deform via erosion, tectonic uplift, sea-level shifts, glaciation, and impacts. Climate & Atmosphere Engine • Atmosphere Editor: Adjustable gas composition (\(\text{N}_2, \text{O}_2, \text{CO}_2, \text{H}_2\text{O}, \text{CH}_4, \text{H}_2, \text{He}, \text{Ar}, \text{SO}_2, \text{NH}_3, \text{Ne}\)). Automatically normalize composition and compute total surface pressure, mean molecular mass, and scale height across 5 layered zones (Surface to Thermosphere). • Energy-Balance Model (EBM): Cell-based latitude/longitude grid calculating stellar flux, positive ice-albedo feedback, greenhouse warming, outgoing longwave radiation, and day/night/seasonal curves. • Circulation & Oceans: Model basic heat transport, wind fields, Hadley-like cells, Coriolis influence, and ocean thermal regulation (salinity, depth, currents). Handle extreme cases like tidally locked worlds or starless rogue planets (geothermal insulation). Impact, Explosion & Destruction Framework • Collision Mechanics: Selectable options (Merge, Fragment, Bounce, Custom) adhering to momentum conservation. High-energy collisions must procedurally carve craters and compute kinetic energy, ejecta volume, shockwaves, and seismic output. • GPU Particle System: Support millions of physical particles tracking position, velocity, mass, temperature, density, lifetime, and material type. • Planetary Breakup: When energy exceeds gravitational binding limits, fragment objects into smaller orbitally tracked bodies, ring systems, or dissipating debris fields. 3. Visualization, Graphics & UI Lighting & Rendering Shaders • Atmospheric Scattering: Shader-based Rayleigh and Mie approximations rendering realistic twilight gradients, limb glow, and horizon profiles (scalable/toggleable). • Lighting Mechanics: Directional star illumination, planetary eclipse shadowing, ring shadows, cloud shadows, dynamic auroras (tied to solar wind and magnetic field metrics), and volcanic glow. • LOD Pipeline: Aggressive level-of-detail transitions (High-res terrain \(\rightarrow \) Texture maps \(\rightarrow \) Simplified spheres \(\rightarrow \) Point star markers) scaling fluidly from planetary surfaces up to galactic map views. Includes a procedural starfield/nebula backdrop. Scientific UI & UX Layout • Interface Style: Dark, sleek scientific dashboard with collapsible control drawers. Supports full desktop keyboard hotkeys and native touch controls (pinch-zoom, 1-finger orbit, 2-finger pan). • Data Overlays & Legends: Toggleable global heatmaps for temperature, pressure, wind, elevation, ice fraction, and albedo with strict numeric color legends. • Planet Inspector & Data Plots: Displays raw metrics (mass, gravity, escape velocity, orbital elements) alongside a live dual-planet comparison engine. Render synchronized real-time data graphs for \(T(t)\), \(P(t)\), \(\text{CO}_{2}\), ice fraction, and energy conservation. 4. Analytics & Analytics Models • Earth Similarity Index (ESI): Transparent, un-faked percentage breakdown evaluating radius, mass, gravity, pressure, temperature, water/land allocation, orbital path, and rotation. • Life Potential / Habitability Index: Multi-weighted environmental heuristic evaluating microbial vs. complex life potential. Factors include liquid water, chemical disequilibrium, carbon availability, radiation shields, UV exposure, and climate stability. Clear label required: "Simulation-Based Habitability Index — Not a Scientific Probability of Actual Life." • Automated History Log: Generates chronological timelines based on simulation phase changes (e.g., "4.20 BYA – Oceans Form"). 5. Startup, Experiments & Error Fallbacks • Default Scene: Spawns a stable, illuminated, moving example system: Star, Earth-like planet with a Moon, Mars-like planet, and an Asteroid. • Experiment Presets: Ready-made initial configurations: Double Earth Mass, Remove Atmosphere, Double \(\text{CO}_{2}\), Runaway Greenhouse, Snowball Earth, Rogue Earth, Tidally Locked Earth, and Asteroid Impact. • Error Boundaries: Graceful degradation logic. Fallback to CPU particles if GPU compute fails; fallback to standard Canvas if OffscreenCanvas is missing; load an explicit compatibility layout if WebGL2 is entirely unavailable. Prevent single-system memory crashes from halting the thread. Includes a JSON import/export framework for state serialization.

A system prompt was added to support web rendering

Response not available

Drag to resize
Drag to resize