0hmX/am3352
This code suite comprises TypeScript scripts that analyze, verify, and assemble complex DDR memory interface hardware, focusing on physical routing, via and pad placement, electrical clearance, and physical constraints, often involving precise geometric calculations and consistent provenance tracking.
- Version
- 1.0.5
- License
- unset
- Stars
- 0
scripts/rebase-ddr-d11-facing.ts
/** Rebase only the verified C8 escape; require fresh exact-parent outward-collar evidence. */
import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{resolve}from'node:path';import{createHash}from'node:crypto';import{objectHash as hash}from'./improve-ddr-a9-power-launches';import{applyFacingExitReplacements}from'./ddr-facing-context';
const parent=resolve('dist/ddr-sixteen-dq2-dq6-matched'),trial=resolve('dist/ddr-d11-facing-inner6-low'),out=resolve('dist/ddr-sixteen-d11-local-trial'),inputs=new Map<string,string>(),read=(p:string)=>{inputs.set(p,createHash('sha256').update(readFileSync(p)).digest('hex'));return JSON.parse(readFileSync(p,'utf8'))},c=read(parent+'/candidate.circuit.json'),h=read(parent+'/host-bundle.json'),input=read(parent+'/routing-input.json'),prior=read(parent+'/report.json'),r=read(trial+'/report.json'),changes=read(trial+'/replacements.json'),audit=read(trial+'/latest16-validation.json'),candidate=applyFacingExitReplacements(c,changes);
if(!r.accepted||!audit.valid||audit.parentCircuitSha256!==hash(c)||audit.candidateCircuitSha256!==hash(candidate)||prior.candidateCircuitSha256!==hash(c)||audit.hostCount!==h.traces.length||h.traces.length!==16||changes.invalidatedHostTraces.length||changes.traces.length!==1||changes.traces[0].before.source_trace_id!=='source_trace_652'||audit.collarPhysical.errors.length||audit.collarPhysical.violations.length)throw Error('Rebase source/proof differs');
const connections=input.connections.map((cn:any)=>({...cn,pointsToConnect:cn.pointsToConnect.map((p:any)=>{const change=changes.breakoutPoints.find((e:any)=>e.before.pcb_breakout_point_id===p.pointId);return change?{...p,x:change.after.x,y:change.after.y,layer:change.after.layer}:p})}));mkdirSync(out,{recursive:true});const write=(n:string,v:any)=>writeFileSync(out+'/'+n,JSON.stringify(v,null,2)+'\n');write('candidate.circuit.json',candidate);write('host-bundle.json',h);write('routing-input.json',{...input,traces:h.traces,connections});write('replacements.json',changes);write('report.json',{...r,parentDirectory:parent,parentCircuitSha256:hash(c),candidateCircuitSha256:hash(candidate),inputHashes:Object.fromEntries(inputs),topology:audit.topology,physical:audit.physical,allAngles:audit.angles,allJunctions:audit.joins,localContacts:audit.local,collarPhysical:audit.collarPhysical,retainedHostCount:16,scope:'ExactC8right-facinginner6escape and .2mm outwardcollar recheckedagainstcurrent16hosts, allretained. No D11host yet.'});console.log(JSON.stringify({out,candidateSha:hash(candidate),hosts:16}))