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
tests/ddr-joint-reference-void.test.ts
import{test,expect}from'bun:test'
import F from'@flatten-js/core'
import{minimalJointSignalVoid}from'../scripts/repair-ddr-joint-reference-void'
import{planeCoverageIntervals}from'../scripts/audit-ddr-host-reference-coverage'
test('joint capsule maintains minimum barrel clearance and restores DQS0 projection',()=>{
const centers=[{x:-5.72,y:-10.06},{x:-5.68,y:-10.8}],ring=minimalJointSignalVoid(centers),polygon=new F.Polygon(ring.map(p=>[p.x,p.y]))
for(const p of centers){expect(polygon.contains(new F.Point(p.x,p.y))).toBe(true);const distance=Math.min(...[...polygon.edges].map(e=>new F.Point(p.x,p.y).distanceTo(e.shape)[0]));expect(distance-.2286).toBeGreaterThanOrEqual(.1016-1e-10)}
expect(polygon.contains(new F.Point(-5.7,-10.43))).toBe(true)
const intervals=planeCoverageIntervals({x:-2.6795131935620846,y:-12.521806976417611},{x:-5.856351169979695,y:-9.344969},{outer_ring:{vertices:[{x:-31,y:-20},{x:31,y:-20},{x:31,y:20},{x:-31,y:20}]},inner_rings:[{vertices:ring}]})
expect(intervals.every(i=>i.covered)).toBe(true)
})
test('joint capsule rejects malformed or coincident via centers',()=>{
for(const centers of[[],[{x:0,y:0}],[{x:0,y:0},{x:0,y:0}],[{x:NaN,y:0},{x:1,y:0}]])expect(()=>minimalJointSignalVoid(centers)).toThrow()
})