KEDDEH SYSTEMS · WAVE · inspected repository revision 98c6509dbebdbd17aa5d7a4fdfde092ac2eef9db
Volumetric wave reference: field, frame and retained source
Source-inspected technical reading edition · 18 October 2026
What the reference computes
The retained implementation samples an illustrative scalar wave inside a three-dimensional cylindrical envelope. It allocates 957 stable sample identities. Each record retains a local position, a transformed position, amplitude, envelope and phase. This is a declared mathematical reference field. The accompanying worked-application record supplies its bounded numerical checks.
For normalized transverse coordinates y and z, the amplitude is A = exp(−2(y²+z²)) cos(2π(x/λ − ft)). Wavelength λ and the longitudinal coordinate x share a reference length unit; frequency f is inverse reference time. Amplitude is dimensionless. The reference propagation speed is λf. Physical calibration and constitutive laws would belong to a separate domain mapping.
Coordinate and observer roles
The model transforms each local position by an explicitly constructed rotation basis and a conventional comparison-origin coordinate. The singular-origin helper retains .1 as a literal nonnumeric referent. Its displayed [1,1,1] comparison tuple is not three origin identities or a native address. The graphical observer planes, camera projection and amplitude-dependent drawing displacement are separately defined. Reading one rendered height as the full physical state would lose those distinctions.
Admission and numerical interpretation
Wavelength, diameter and frequency must be positive finite numbers; time and angles must be finite. Derived numeric fields are recursively checked for finiteness. Failure retains a diagnostic and the last valid model separately within the browser session. That is a bounded in-memory behavior, not a durable-history guarantee.
The legacy zero_amplitude flag tests absolute amplitude below 10⁻¹². It denotes numerical proximity, not exact zero, absence or an unavailable observation. A quarter-period cosine sample can therefore have a tiny nonzero floating-point amplitude while satisfying this flag. The updated record also distinguishes exact-zero counts.
Complete retained implementation
The two code listings below are retained verbatim, in their original file order. The source register pins their bytes and the inspected repository revision. Reading these files does not claim a new live renderer execution or a recovered native BOX-to-shell operation.
volume.js
(function(root){'use strict';
const O=typeof module!=='undefined'&&module.exports?require('./singular-origin.js'):root.KeddehSingularOrigin;if(!O)throw Error('Singular origin contract unavailable');const COMPARISON_ORIGIN=O.projection([1,1,1]);
function drawAnnotation(ctx,text,x,y,strong=false){ctx.save();ctx.font=(strong?'700 16px':'600 14px')+' system-ui';const width=ctx.measureText(text).width;ctx.fillStyle='#ffffff';ctx.strokeStyle='#647c78';ctx.lineWidth=1;ctx.fillRect(x-5,y-18,width+10,25);ctx.strokeRect(x-5,y-18,width+10,25);ctx.fillStyle='#173c38';ctx.textAlign='left';ctx.fillText(text,x,y);ctx.restore();}
function computeModel(p){for(const k of ['wavelength','diameter','frequency'])if(!Number.isFinite(p[k])||p[k]<=0)throw Error(k+' must be positive.');for(const k of ['time','yaw','pitch'])if(!Number.isFinite(p[k]))throw Error(k+' must be finite.');const cy=Math.cos(p.yaw),sy=Math.sin(p.yaw),cp=Math.cos(p.pitch),sp=Math.sin(p.pitch),basis=[[cy*cp,-sy,cy*sp],[sy*cp,cy,sy*sp],[-sp,0,cp]],origin=COMPARISON_ORIGIN.coordinates,nodes=[];for(let ix=0;ix<=32;ix++)for(let iy=-3;iy<=3;iy++)for(let iz=-3;iz<=3;iz++){const y=iy/3,z=iz/3;if(y*y+z*z>1+1e-12)continue;const local=[(ix/32-.5)*4*p.wavelength,y*p.diameter/2,z*p.diameter/2],position=basis.map((row,j)=>origin[j]+row.reduce((sum,a,k)=>sum+a*local[k],0)),envelope=Math.exp(-2*(y*y+z*z)),phase=2*Math.PI*(local[0]/p.wavelength-p.frequency*p.time),amplitude=envelope*Math.cos(phase);nodes.push({id:'WAVE-'+ix+'-'+(iy+3)+'-'+(iz+3),position,local,amplitude,envelope,phase_radians:phase,zero_amplitude:Math.abs(amplitude)<1e-12})}return{schema:'KEDDEH_VOLUMETRIC_WAVE_REFERENCE_V1',scope:'Declared illustrative scalar field sampled in a three-dimensional cylindrical envelope; not native quantum hardware or measured physical data',identity:'WAVE-ENVELOPE-REFERENCE',frame:{origin_identity:O.assertIdentity('.1'),origin_ref:O.ORIGIN,comparison_projection:COMPARISON_ORIGIN,origin_coordinate_role:'One singular referent .1 with three conventional rendering coordinates; the tuple is not three identities or a native address',origin,basis,unit:'reference length unit',coordinate_role:'spatial position; distinct from field amplitude'},parameters:{...p},propagation_speed:p.wavelength*p.frequency,node_count:nodes.length,zero_nodes:nodes.filter(n=>n.zero_amplitude).length,nodes};}
let lastValidResult=null,lastFailureRecord=null;
function diagnosticCopy(value,seen=new Set()){if(typeof value==='number'&&!Number.isFinite(value))return {kind:'non-finite-number',representation:String(value)};if(value===undefined)return {kind:'undefined'};if(['bigint','symbol','function'].includes(typeof value))return {kind:'unsupported-'+typeof value,representation:typeof value==='function'?(value.name||'(anonymous)'):String(value)};if(value&&typeof value==='object'){if(seen.has(value))return {kind:'cyclic-reference'};seen.add(value);const out=Array.isArray(value)?value.map(v=>diagnosticCopy(v,seen)):Object.fromEntries(Object.entries(value).map(([k,v])=>[k,diagnosticCopy(v,seen)]));seen.delete(value);return out;}return value;}
function verifyDerivedFinite(value,path='$',ancestors=new Set()){if(typeof value==='number'&&!Number.isFinite(value)){const e=Error('Non-finite derived field: '+path);e.code='NON_FINITE_DERIVED_RESULT';e.field=path;throw e;}if(value&&typeof value==='object'){if(ancestors.has(value))throw Error('Cyclic model record: '+path);ancestors.add(value);for(const [k,v] of Object.entries(value))verifyDerivedFinite(v,path+'.'+k,ancestors);ancestors.delete(value);}}
function model(p){try{const result=computeModel(p);verifyDerivedFinite(result);result.numerical_classification={legacy_flag:'zero_amplitude',legacy_count:'zero_nodes',field:"amplitude",threshold:1e-12,comparison:'Math.abs(value) < threshold',meaning:'Within numerical tolerance; distinct from exact zero and from an unavailable observation',exact_zero_count:result.nodes.filter(n=>n.amplitude===0).length};lastValidResult=diagnosticCopy(result);return result;}catch(e){lastFailureRecord={schema:'KEDDEH_REFERENCE_MODEL_FAILURE_V1',code:e.code||'INVALID_MODEL_INPUT',field:e.field||null,message:e.message,parameters:diagnosticCopy(p),retention:'Latest failure and last valid model retained in this browser session; no durable-history claim'};e.failure=diagnosticCopy(lastFailureRecord);throw e;}}
function lastFailure(){return diagnosticCopy(lastFailureRecord)}
function lastValid(){return diagnosticCopy(lastValidResult)}
function displayScalar(value){return value!==0&&Number(value.toFixed(6))===0?value.toExponential(6)+' (nonzero)':value.toFixed(6);}
root.KeddehWaveVolume={model,lastFailure,lastValid};if(typeof module!=='undefined'&&module.exports)module.exports={model,lastFailure,lastValid};if(typeof document==='undefined')return;
const $=id=>document.getElementById(id);if(!$('wave-canvas'))return;
let events=[],lastAction=null,executionIndex=0;let latest=null,running=false,last=null,time=0,raf=null,viewYaw=.6,viewPitch=.35,drag=null,modelTime=0;const reduced=window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches;
root.KeddehWaveVolume.current=()=>latest;
const get=()=>({wavelength:Number($('wave-length').value),diameter:Number($('wave-diameter').value),frequency:Number($('wave-frequency').value),time,yaw:Number($('wave-yaw').value)*Math.PI/180,pitch:Number($('wave-pitch').value)*Math.PI/180,observer_plane:Number($('wave-plane')?.value||0)});
function project(point,scale,w,h){const x=point[0]-COMPARISON_ORIGIN.coordinates[0],y=point[1]-COMPARISON_ORIGIN.coordinates[1],z=point[2]-COMPARISON_ORIGIN.coordinates[2],xx=Math.cos(viewYaw)*x-Math.sin(viewYaw)*z,zz=Math.sin(viewYaw)*x+Math.cos(viewYaw)*z,yy=Math.cos(viewPitch)*y-Math.sin(viewPitch)*zz,depth=Math.sin(viewPitch)*y+Math.cos(viewPitch)*zz;return[w/2+xx*scale,h/2-yy*scale,depth]}
function draw(){const started=performance.now();try{latest=model(get());latest.observer={origin_identity:O.assertIdentity('.1'),origin_ref:O.ORIGIN,comparison_projection:COMPARISON_ORIGIN,layer_label:'(−1+)',planes:['XY','XZ','YZ'],slice_x:Number($('wave-plane')?.value||0),role:'Declared graphical observer planes; label retained separately from numerical coordinates'};modelTime=time;const canvas=$('wave-canvas');let ctx=null;try{ctx=canvas.getContext('2d')}catch{};$('wave-node-count').textContent=latest.node_count+' stable sample identities';$('wave-zero-count').textContent=latest.zero_nodes+' amplitude samples within numerical tolerance (|value| < 1e-12)';$('wave-time').textContent=time.toFixed(3)+' s';$('wave-speed').textContent=latest.propagation_speed.toFixed(3)+' reference units/s';for(const[id,key]of[['wave-length','wavelength'],['wave-diameter','diameter'],['wave-frequency','frequency']])$(id+'-value').textContent=latest.parameters[key];$('wave-yaw-value').textContent=$('wave-yaw').value+'°';$('wave-pitch-value').textContent=$('wave-pitch').value+'°';drawTrace(latest);if(!ctx){$('wave-status').textContent='The canvas renderer is unavailable. Calculation metrics and JSON export remain available.';return}const w=Math.max(320,Math.floor(canvas.clientWidth||900)),h=Math.max(240,Math.floor(canvas.clientHeight||480)),dpr=Math.min(window.devicePixelRatio||1,2);if(canvas.width!==w*dpr||canvas.height!==h*dpr){canvas.width=w*dpr;canvas.height=h*dpr}ctx.setTransform(dpr,0,0,dpr,0,0);ctx.clearRect(0,0,w,h);ctx.fillStyle='#a96d1d';ctx.fillRect(0,0,w,h);const extent=Math.max(4*latest.parameters.wavelength,latest.parameters.diameter),scale=Math.min(w*.7,h*.65)/extent;
const axes=[[1,0,0],[0,1,0],[0,0,1]],colors=['#2865b2','#b57a2c','#a96d1d'];axes.forEach((axis,j)=>{let a=project(COMPARISON_ORIGIN.coordinates,scale,w,h),b=project(latest.frame.basis.map((row,k)=>COMPARISON_ORIGIN.coordinates[k]+row[j]*extent*.55),scale,w,h);ctx.strokeStyle=colors[j];ctx.lineWidth=1;ctx.beginPath();ctx.moveTo(a[0],a[1]);ctx.lineTo(b[0],b[1]);ctx.stroke();ctx.fillStyle=colors[j];drawAnnotation(ctx,['local x','local y','local z'][j],b[0]+5,b[1]-5)});
// The mesh is a height/displacement encoding of the scalar field, distinct from sample positions.
const world=local=>latest.frame.basis.map((row,j)=>COMPARISON_ORIGIN.coordinates[j]+row.reduce((sum,a,k)=>sum+a*local[k],0));
const glyph=n=>world([n.local[0],n.local[1]+n.amplitude*latest.parameters.diameter*.45,n.local[2]]);
const layer=Number($('wave-plane')?.value||0)*latest.parameters.wavelength,span=latest.parameters.diameter*.8;
const planes=[{name:'XY',color:'rgba(103,232,249,.10)',corners:[[-2*latest.parameters.wavelength,-span,0],[2*latest.parameters.wavelength,-span,0],[2*latest.parameters.wavelength,span,0],[-2*latest.parameters.wavelength,span,0]]},{name:'XZ',color:'rgba(196,181,253,.10)',corners:[[-2*latest.parameters.wavelength,0,-span],[2*latest.parameters.wavelength,0,-span],[2*latest.parameters.wavelength,0,span],[-2*latest.parameters.wavelength,0,span]]},{name:'YZ · observed slice',color:'rgba(251,191,36,.12)',corners:[[layer,-span,-span],[layer,span,-span],[layer,span,span],[layer,-span,span]]}];
for(const plane of planes){ctx.fillStyle=plane.color;ctx.strokeStyle='#a0afc2';ctx.beginPath();plane.corners.map(c=>project(world(c),scale,w,h)).forEach((p,i)=>i?ctx.lineTo(p[0],p[1]):ctx.moveTo(p[0],p[1]));ctx.closePath();ctx.fill();ctx.stroke();const p=project(world(plane.corners[2]),scale,w,h);ctx.fillStyle='#425c7a';ctx.fillText(plane.name,p[0],p[1]);}
const tiles=[];
function surface(ix,iz){const x=(ix/64-.5)*4*latest.parameters.wavelength,z=(iz/24-.5)*latest.parameters.diameter,amp=Math.exp(-2*(z/(latest.parameters.diameter/2))**2)*Math.cos(2*Math.PI*(x/latest.parameters.wavelength-latest.parameters.frequency*time));return {p:project(world([x,amp*latest.parameters.diameter*.45,z]),scale,w,h),amp}}
for(let ix=0;ix<64;ix++)for(let iz=0;iz<24;iz++){const vertices=[surface(ix,iz),surface(ix+1,iz),surface(ix+1,iz+1),surface(ix,iz+1)];tiles.push({vertices,depth:vertices.reduce((sum,v)=>sum+v.p[2],0)/4,amp:vertices.reduce((sum,v)=>sum+v.amp,0)/4})}
tiles.sort((a,b)=>a.depth-b.depth);for(const tile of tiles){ctx.fillStyle=tile.amp>=0?'rgba(40,101,178,.72)':'rgba(181,122,44,.70)';ctx.strokeStyle='rgba(66,92,122,.18)';ctx.lineWidth=.5;ctx.beginPath();tile.vertices.forEach((v,i)=>i?ctx.lineTo(v.p[0],v.p[1]):ctx.moveTo(v.p[0],v.p[1]));ctx.closePath();ctx.fill();ctx.stroke()}
// All original volumetric samples are retained and projected around the visible wave surface.
const points=latest.nodes.map(n=>({n,p:project(glyph(n),scale,w,h)})).sort((a,b)=>a.p[2]-b.p[2]);for(const {n,p}of points){ctx.fillStyle=n.zero_amplitude?'#a96d1d':n.amplitude>=0?'rgba(40,101,178,.55)':'rgba(181,122,44,.50)';ctx.beginPath();ctx.arc(p[0],p[1],n.zero_amplitude?2.8:1.3,0,Math.PI*2);ctx.fill()}
const o=project(COMPARISON_ORIGIN.coordinates,scale,w,h);ctx.fillStyle='#24364d';drawAnnotation(ctx,O.ID+' · layer (−1+)',o[0]+10,o[1]-10,true);if($('wave-frame-cost'))$('wave-frame-cost').textContent=(performance.now()-started).toFixed(2)+' ms · one field calculation, two views';if($('wave-events'))$('wave-events').textContent=events.length?events.slice(-8).map(e=>e.index+' · '+e.label+' · '+e.action+' · phase '+e.before.time.toFixed(3)+' → '+e.after.time.toFixed(3)+' s · '+e.recorded_at).join('\n'):'No sampled actions yet. Step, then apply its inverse.';$('wave-status').textContent=running?'Playing the reference field. All sample identities remain allocated.':'Reference paused. All sample identities remain allocated.';}catch(e){stop();latest=null;$('wave-status').textContent=e.message+' · Failed parameters: '+JSON.stringify(e.failure?.parameters||get())+(lastValidResult?' · Last valid model retained separately.':' · No valid model has been retained.')}}
function drawTrace(state){const canvas=$('wave-trace');if(!canvas)return;let ctx;try{ctx=canvas.getContext('2d')}catch{};const sample=state.nodes.find(n=>n.id==='WAVE-'+Math.round(16+8*(state.parameters.observer_plane||0))+'-3-3');state.observed_sample=sample.id;if($('wave-sample'))$('wave-sample').textContent=sample.id;if($('wave-amplitude'))$('wave-amplitude').textContent=displayScalar(sample.amplitude);if(!ctx)return;const w=Math.max(320,canvas.clientWidth||900),h=220;canvas.width=w;canvas.height=h;ctx.fillStyle='#a96d1d';ctx.fillRect(0,0,w,h);const left=45,right=w-20,mid=h/2;ctx.strokeStyle='#a0afc2';ctx.beginPath();ctx.moveTo(left,20);ctx.lineTo(left,h-30);ctx.moveTo(left,mid);ctx.lineTo(right,mid);ctx.stroke();ctx.strokeStyle='#2865b2';ctx.lineWidth=2;ctx.beginPath();for(let j=0;j<=256;j++){const t=time+(j/256-1)*2/state.parameters.frequency,amp=sample.envelope*Math.cos(sample.phase_radians+2*Math.PI*state.parameters.frequency*(time-t)),x=left+(right-left)*j/256,y=mid-amp*(h*.34);j?ctx.lineTo(x,y):ctx.moveTo(x,y)}ctx.stroke();ctx.fillStyle='#a96d1d';ctx.beginPath();ctx.arc(right,mid-sample.amplitude*(h*.34),4,0,Math.PI*2);ctx.fill();ctx.fillStyle='#53677f';ctx.fillText('A',14,25);ctx.fillText((time-2/state.parameters.frequency).toFixed(2)+' s',left,h-8);ctx.fillText(time.toFixed(2)+' s',right-50,h-8);}
function tick(stamp){if(!running)return;if(last!==null)time+=Math.min((stamp-last)/1000,.1);last=stamp;draw();raf=requestAnimationFrame(tick)}function stop(){running=false;last=null;if(raf!==null)cancelAnimationFrame(raf);raf=null;$('wave-play').textContent='Play time progression';$('wave-play').setAttribute('aria-pressed','false')}
$('wave-play').onclick=()=>{if(running){stop();draw()}else{running=true;last=null;$('wave-play').textContent='Pause time progression';$('wave-play').setAttribute('aria-pressed','true');raf=requestAnimationFrame(tick)}};
$('wave-node').onclick=()=>{stop();time=1/(4*Number($('wave-frequency').value));draw();$('wave-status').textContent='Quarter-cycle reference: samples within numerical tolerance remain in the 3D volume; their calculated values are retained.'};$('wave-reset').onclick=()=>{stop();time=0;draw()};$('wave-step').onclick=()=>{stop();const before=get();time+=.025;const after=get();lastAction={before,after};events.push({index:++executionIndex,label:'−2',action:'forward phase increment +0.025 s',before,after,recorded_at:new Date().toISOString()});draw()};if($('wave-inverse'))$('wave-inverse').onclick=()=>{stop();if(!lastAction){$('wave-status').textContent='Step once to create an action that can be inverted.';return}const before=get(),target=lastAction.before;time=target.time;$('wave-plane').value=target.observer_plane||0;for(const[id,key]of[['wave-length','wavelength'],['wave-diameter','diameter'],['wave-frequency','frequency']])$(id).value=target[key];$('wave-yaw').value=target.yaw*180/Math.PI;$('wave-pitch').value=target.pitch*180/Math.PI;const after=get();events.push({index:++executionIndex,label:'−2',action:'inverse of sampled forward action; restores preceding field parameters',before,after,recorded_at:new Date().toISOString()});lastAction=null;draw()};for(const id of ['wave-length','wave-diameter','wave-frequency','wave-yaw','wave-pitch','wave-plane'])$(id).addEventListener('input',draw);
$('wave-export').onclick=()=>{if(!latest)return;const url=URL.createObjectURL(new Blob([JSON.stringify({...latest,action_history:events,history_scope:'Sampled forward/inverse actions in this browser session; reset/reload is not a durable ledger',execution_index:executionIndex,view:{camera_yaw:viewYaw,camera_pitch:viewPitch,role:'Camera orbit; distinct from the physical reference basis'},display:{encoding:'Scalar amplitude mapped to local transverse height: y_display=y+A·0.45D; original spatial coordinates remain unchanged',surface:'y=0 field slice over axial position and transverse z',trace_sample:latest.observed_sample,trace_periods:2}},null,2)],{type:'application/json'})),a=document.createElement('a');a.href=url;a.download='keddeh-volumetric-wave-reference.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000)};
$('wave-canvas').addEventListener('pointerdown',e=>{drag=[e.clientX,e.clientY];$('wave-canvas').setPointerCapture(e.pointerId)});$('wave-canvas').addEventListener('pointermove',e=>{if(!drag)return;viewYaw+=(e.clientX-drag[0])*.007;viewPitch=Math.max(-1.4,Math.min(1.4,viewPitch+(e.clientY-drag[1])*.007));drag=[e.clientX,e.clientY];draw()});$('wave-canvas').addEventListener('pointerup',()=>{drag=null});$('wave-canvas').addEventListener('pointercancel',()=>{drag=null});$('view-left').onclick=()=>{viewYaw-=.2;draw()};$('view-right').onclick=()=>{viewYaw+=.2;draw()};$('view-reset').onclick=()=>{viewYaw=.6;viewPitch=.35;draw()};window.KeddehFacilityCamera=key=>{if(key==='Home'){viewYaw=.6;viewPitch=.35}else if(key==='ArrowLeft')viewYaw-=.2;else if(key==='ArrowRight')viewYaw+=.2;else if(key==='ArrowUp')viewPitch=Math.min(1.4,viewPitch+.15);else if(key==='ArrowDown')viewPitch=Math.max(-1.4,viewPitch-.15);draw()};document.addEventListener('fullscreenchange',draw);window.addEventListener('resize',draw);document.addEventListener('visibilitychange',()=>{if(document.hidden){stop();draw()}});draw();if(reduced)$('wave-status').textContent='Reduced motion preference detected. Time progression starts paused; step or play explicitly.';
})(typeof window==='undefined'?globalThis:window);
singular-origin.js
(function(root){'use strict';
const ID='.1';
const ORIGIN=Object.freeze({schema:'KEDDEH_SINGULAR_ORIGIN_IDENTITY_V1',id:ID,role:'Opaque singular origin referent; not a number or coordinate'});
function assertIdentity(value){if(typeof value!=='string'||value!==ID)throw new TypeError('Origin identity must be the exact opaque string .1');return ID;}
function projection(coordinates){if(!Array.isArray(coordinates)||coordinates.length<1||coordinates.length>3||Array.from({length:coordinates.length},(_,i)=>i).some(i=>!Object.prototype.hasOwnProperty.call(coordinates,i)||typeof coordinates[i]!=='number'||!Number.isFinite(coordinates[i])))throw new TypeError('Conventional projection requires one to three finite numeric coordinates');return Object.freeze({kind:'CONVENTIONAL_COMPARISON_PROJECTION',originIdentity:ID,coordinates:Object.freeze(coordinates.slice()),role:'Numerical rendering/comparison coordinates; separate from the singular identity'});}
const api=Object.freeze({ID,ORIGIN,assertIdentity,projection});root.KeddehSingularOrigin=api;if(typeof module!=='undefined'&&module.exports)module.exports=api;
})(typeof globalThis!=='undefined'?globalThis:this);
Active reader and source records
Open this paper in its own source-bound Keddeh runtime to keep a working note, inspect its local parent and reconstruct the reader state.
Open active reader · Exact manuscript · Download public source records
The full manuscript and admitted source records are included. Original-source references retain their stated access conditions.
Manuscript SHA-256: fe4a860770b8412f8d7e3d1218e8c8f74ec6a9ab67414a16bdcade5a14421ec8. Public delivery edition R1; complete owner edition 0b6114141cc5647360d31778388c3d67c572fcf36bc328527643437096c2c31d.