@wafertools/wafermap 0.36.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +357 -0
- package/README.md +7 -7
- package/dist/packages/canvas-adapter/charts/capability.js +1 -1
- package/dist/packages/canvas-adapter/charts/cardAbout.d.ts +21 -0
- package/dist/packages/canvas-adapter/charts/cardAbout.js +1 -0
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +65 -12
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/commonality.d.ts +18 -0
- package/dist/packages/canvas-adapter/charts/commonality.js +1 -0
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/groupComparison.d.ts +31 -0
- package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -0
- package/dist/packages/canvas-adapter/charts/index.d.ts +0 -10
- package/dist/packages/canvas-adapter/charts/index.js +1 -1
- package/dist/packages/canvas-adapter/charts/patCard.d.ts +21 -0
- package/dist/packages/canvas-adapter/charts/patCard.js +1 -0
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +56 -2
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/charts/pointInteractions.d.ts +2 -0
- package/dist/packages/canvas-adapter/charts/pointInteractions.js +1 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
- package/dist/packages/canvas-adapter/charts/sweep.js +1 -1
- package/dist/packages/canvas-adapter/dataTab.d.ts +3 -0
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/dieList.d.ts +12 -0
- package/dist/packages/canvas-adapter/dieList.js +2 -2
- package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +26 -0
- package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -0
- package/dist/packages/canvas-adapter/drilldown.d.ts +3 -0
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/filterButton.d.ts +3 -0
- package/dist/packages/canvas-adapter/filterButton.js +1 -0
- package/dist/packages/canvas-adapter/filterEditor.d.ts +53 -0
- package/dist/packages/canvas-adapter/filterEditor.js +1 -0
- package/dist/packages/canvas-adapter/guideWindow.d.ts +9 -1
- package/dist/packages/canvas-adapter/guideWindow.js +1 -1
- package/dist/packages/canvas-adapter/icons.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +50 -2
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/pageFilter.d.ts +84 -0
- package/dist/packages/canvas-adapter/pageFilter.js +2 -0
- package/dist/packages/canvas-adapter/patMaps.d.ts +26 -0
- package/dist/packages/canvas-adapter/patMaps.js +1 -0
- package/dist/packages/canvas-adapter/plotCard.d.ts +67 -0
- package/dist/packages/canvas-adapter/plotCard.js +1 -0
- package/dist/packages/canvas-adapter/plotEditor.d.ts +13 -2
- package/dist/packages/canvas-adapter/plotEditor.js +1 -1
- package/dist/packages/canvas-adapter/plotModal.js +1 -1
- package/dist/packages/canvas-adapter/plotStore.js +1 -1
- package/dist/packages/canvas-adapter/plotTab.d.ts +6 -0
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +15 -5
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/toolbar.d.ts +12 -0
- package/dist/packages/canvas-adapter/toolbar.js +2 -2
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +598 -115
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/core/classify.d.ts +11 -0
- package/dist/packages/core/classify.js +1 -1
- package/dist/packages/core/dies.d.ts +2 -0
- package/dist/packages/core/dies.js +1 -1
- package/dist/packages/core/wafer.d.ts +2 -2
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/buildWaferMap.d.ts +2 -0
- package/dist/packages/renderer/buildWaferMap.js +1 -1
- package/dist/packages/renderer/deprecate.d.ts +2 -8
- package/dist/packages/renderer/deprecate.js +1 -1
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/renderer/testLabel.d.ts +0 -11
- package/dist/packages/renderer/testLabel.js +1 -1
- package/dist/packages/stats/analyzeWaferLot.d.ts +6 -0
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.d.ts +8 -0
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/binPareto.d.ts +2 -54
- package/dist/packages/stats/binPareto.js +1 -1
- package/dist/packages/stats/binRows.js +1 -1
- package/dist/packages/stats/capability.d.ts +10 -0
- package/dist/packages/stats/capability.js +1 -1
- package/dist/packages/stats/cardSpec.d.ts +53 -0
- package/dist/packages/stats/cardSpec.js +1 -0
- package/dist/packages/stats/chartCatalogue.d.ts +37 -0
- package/dist/packages/stats/chartCatalogue.js +1 -0
- package/dist/packages/stats/clusterDetection.d.ts +9 -0
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/commonality.d.ts +62 -0
- package/dist/packages/stats/commonality.js +1 -0
- package/dist/packages/stats/control.d.ts +21 -0
- package/dist/packages/stats/control.js +1 -0
- package/dist/packages/stats/correlation.d.ts +9 -3
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/dieRegions.d.ts +4 -1
- package/dist/packages/stats/dieRegions.js +1 -1
- package/dist/packages/stats/differenceMap.d.ts +22 -0
- package/dist/packages/stats/differenceMap.js +1 -0
- package/dist/packages/stats/examplePicks.d.ts +22 -0
- package/dist/packages/stats/examplePicks.js +1 -0
- package/dist/packages/stats/filterFile.d.ts +41 -0
- package/dist/packages/stats/filterFile.js +2 -0
- package/dist/packages/stats/filterFindings.d.ts +20 -5
- package/dist/packages/stats/filterFindings.js +1 -1
- package/dist/packages/stats/groupCompare.d.ts +87 -0
- package/dist/packages/stats/groupCompare.js +1 -0
- package/dist/packages/stats/guideSections.d.ts +55 -0
- package/dist/packages/stats/guideSections.js +1 -0
- package/dist/packages/stats/index.d.ts +3 -1
- package/dist/packages/stats/index.js +1 -1
- package/dist/packages/stats/math.d.ts +29 -4
- package/dist/packages/stats/math.js +1 -1
- package/dist/packages/stats/metadataColumns.d.ts +3 -0
- package/dist/packages/stats/metadataColumns.js +1 -1
- package/dist/packages/stats/pat.d.ts +58 -0
- package/dist/packages/stats/pat.js +1 -0
- package/dist/packages/stats/patSummary.d.ts +45 -0
- package/dist/packages/stats/patSummary.js +1 -0
- package/dist/packages/stats/patternClassification.d.ts +3 -3
- package/dist/packages/stats/patternClassification.js +1 -1
- package/dist/packages/stats/plotData.d.ts +294 -17
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/plotId.d.ts +2 -0
- package/dist/packages/stats/plotId.js +1 -1
- package/dist/packages/stats/plotReferences.d.ts +17 -0
- package/dist/packages/stats/plotReferences.js +1 -0
- package/dist/packages/stats/plotSpec.d.ts +239 -3
- package/dist/packages/stats/plotSpec.js +4 -4
- package/dist/packages/stats/regions.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +31 -31
- package/dist/packages/stats/reportHtml.js +9 -13
- package/dist/packages/stats/synthesis.d.ts +44 -16
- package/dist/packages/stats/synthesis.js +1 -1
- package/dist/packages/stats/testPassRate.d.ts +7 -0
- package/dist/packages/stats/testPassRate.js +1 -1
- package/dist/packages/stats/types.d.ts +13 -8
- package/dist/packages/stats/yield.d.ts +3 -11
- package/dist/packages/stats/yield.js +1 -1
- package/llms.txt +1 -1
- package/package.json +2 -1
- package/dist/packages/canvas-adapter/charts/barPanel.d.ts +0 -83
- package/dist/packages/canvas-adapter/charts/barPanel.js +0 -1
- package/dist/packages/canvas-adapter/charts/binCluster.d.ts +0 -27
- package/dist/packages/canvas-adapter/charts/binCluster.js +0 -1
- package/dist/packages/canvas-adapter/charts/boxplot.d.ts +0 -72
- package/dist/packages/canvas-adapter/charts/boxplot.js +0 -1
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.d.ts +0 -53
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.js +0 -1
- package/dist/packages/canvas-adapter/charts/histogram.d.ts +0 -61
- package/dist/packages/canvas-adapter/charts/histogram.js +0 -1
- package/dist/packages/canvas-adapter/charts/scatter.d.ts +0 -80
- package/dist/packages/canvas-adapter/charts/scatter.js +0 -1
- package/dist/packages/canvas-adapter/charts/testPassRate.d.ts +0 -27
- package/dist/packages/canvas-adapter/charts/testPassRate.js +0 -1
- package/dist/packages/canvas-adapter/charts/trend.d.ts +0 -50
- package/dist/packages/canvas-adapter/charts/trend.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{newPlotId as p}from"./plotId.js";export{p as newPlotId};export const PLOTS_FORMAT="wafermap-plots",PLOTS_VERSION=1,SWEEPS_FORMAT="tsmap-sweeps",PLOT_CHARTS=["scatter","histogram","box","bar","line","sweep"],PLOT_BUILTINS=["wafer","x","y","ring","quadrant","reticleCell","reticleShot","hbin","sbin","site","yield","dieCount","waferOrder"],PLOT_AGGREGATES=["mean","median","min","max","sum","count","yield"],PLOT_LIMITS=["both","test","spec","none"];const u=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),c=e=>typeof e=="number"&&Number.isFinite(e);export function sameField(e,t){return!e||!t?e===t:"test"in e?"test"in t&&e.test===t.test:"builtin"in e?"builtin"in t&&e.builtin===t.builtin:"meta"in t&&e.meta===t.meta}export function isField(e){return u(e)?"test"in e?Number.isInteger(e.test):"builtin"in e?PLOT_BUILTINS.includes(e.builtin):"meta"in e?typeof e.meta=="string"&&e.meta!=="":!1:!1}function a(e,t,i){if(e!==void 0){if(!u(e)){i.push(`${t}: not a field, left out`);return}if("test"in e){if(!Number.isInteger(e.test)){i.push(`${t}: test number ${JSON.stringify(e.test)} is not an integer, left out`);return}const s={...e,test:e.test};return typeof e.name=="string"&&e.name!==""?s.name=e.name:delete s.name,s}if("builtin"in e)return PLOT_BUILTINS.includes(e.builtin)?{...e,builtin:e.builtin}:e;if("meta"in e){if(typeof e.meta!="string"||e.meta===""){i.push(`${t}: metadata key is empty, left out`);return}return{...e,meta:e.meta}}return e}}function y(e,t,i){if(e===void 0)return;if(!u(e)){i.push(`${t}: not an object, left out`);return}const s={...e};"label"in e&&typeof e.label!="string"&&(i.push(`${t}.label: not text, left out`),delete s.label),"scale"in e&&e.scale!=="linear"&&e.scale!=="log"&&(i.push(`${t}.scale: "${String(e.scale)}" is not linear or log, left out`),delete s.scale);for(const o of["min","max"])o in e&&!c(e[o])&&(i.push(`${t}.${o}: not a number, left out`),delete s[o]);return"reverse"in e&&typeof e.reverse!="boolean"&&(i.push(`${t}.reverse: not true or false, left out`),delete s.reverse),s}const x=/^\s*\d+\s*(\.\.\s*\d+\s*)?$/,$=e=>typeof e=="number"&&Number.isInteger(e)||typeof e=="string"&&x.test(e);export function readSweepPayload(e,t,i){if(!u(e))return i.push(`${t}: no sweep definition, left empty`),{series:[]};const s={...e};delete s.id,delete s.title;const o=Array.isArray(e.series)?e.series:[];Array.isArray(e.series)||i.push(`${t}.series: not a list, left empty`);const l=[];o.forEach((n,r)=>{const f=`${t}.series ${r+1}`;if(!u(n)){i.push(`${f}: not an object, skipped`);return}const d={...n};if((typeof n.label!="string"||n.label.trim()==="")&&(d.label=`Series ${r+1}`),!Array.isArray(n.tests)||!n.tests.every($)){i.push(`${f}: its tests must be test numbers or ranges such as "1010..1030", skipped`);return}"xValues"in n&&!(Array.isArray(n.xValues)&&n.xValues.every(c))&&(i.push(`${f}.xValues: not a list of numbers, left out`),delete d.xValues),"xFromName"in n&&typeof n.xFromName!="string"&&(i.push(`${f}.xFromName: not text, left out`),delete d.xFromName),"color"in n&&typeof n.color!="string"&&delete d.color,"testNames"in n&&!(u(n.testNames)&&Object.values(n.testNames).every(m=>typeof m=="string"))&&(i.push(`${f}.testNames: not a list of names, left out`),delete d.testNames),l.push(d)}),s.series=l;for(const n of["xLabel","xUnit","yLabel"])n in e&&typeof e[n]!="string"&&(i.push(`${t}.${n}: not text, left out`),delete s[n]);return"xScale"in e&&e.xScale!=="linear"&&e.xScale!=="log"&&(i.push(`${t}.xScale: "${String(e.xScale)}" is not linear or log, left out`),delete s.xScale),"crossing"in e&&typeof e.crossing!="boolean"&&(i.push(`${t}.crossing: not true or false, left out`),delete s.crossing),"separationAt"in e&&!(Array.isArray(e.separationAt)&&e.separationAt.every(c))&&(i.push(`${t}.separationAt: not a list of numbers, left out`),delete s.separationAt),s}export function sweepToPlot(e){const{id:t,title:i,...s}=e;return{id:t,...i?{title:i}:{},chart:"sweep",sweep:s}}export function plotToSweep(e){if(e.chart==="sweep")return{...e.sweep??{series:[]},id:e.id,title:e.title??"Sweep"}}export function readPlot(e,t,i){if(!u(e))return i.push(`${t}: not an object, skipped`),null;const s=e.chart;if(typeof s!="string"||s==="")return i.push(`${t}: no chart, skipped`),null;const o={...e};(typeof e.id!="string"||e.id==="")&&(o.id=p(),i.push(`${t}: no id, given a new one`)),"title"in e&&typeof e.title!="string"?(i.push(`${t}.title: not text, left out`),delete o.title):typeof e.title=="string"&&e.title.trim()===""&&delete o.title;const l=u(e.fields)?e.fields:{};e.fields!==void 0&&!u(e.fields)&&i.push(`${t}.fields: not an object, left empty`);const n={...l};for(const r of["x","y"]){const f=a(l[r],`${t}.fields.${r}`,i);f?n[r]=f:delete n[r]}if(l.color!==void 0){const r=l.color;if(u(r)&&"follow"in r)r.follow==="groupBy"?n.color={follow:"groupBy"}:n.color=r;else if(u(r)&&"none"in r)n.color={none:!0};else{const f=a(r,`${t}.fields.color`,i);f?n.color=f:delete n.color}}if(s==="sweep"&&Object.keys(n).length===0?delete o.fields:o.fields=n,"level"in e&&e.level!=="die"&&e.level!=="wafer"&&(i.push(`${t}.level: "${String(e.level)}" is not die or wafer, left out`),delete o.level),"aggregate"in e&&!PLOT_AGGREGATES.includes(e.aggregate)&&(i.push(`${t}.aggregate: "${String(e.aggregate)}" is not known to this version, left out`),delete o.aggregate),"limits"in e&&!PLOT_LIMITS.includes(e.limits)&&(i.push(`${t}.limits: "${String(e.limits)}" is not both, test, spec or none, left out`),delete o.limits),"bins"in e&&!(Number.isInteger(e.bins)&&e.bins>=1)&&(i.push(`${t}.bins: not a whole number of at least 1, left out`),delete o.bins),s==="sweep"&&(o.sweep=readSweepPayload(e.sweep,`${t}.sweep`,i)),e.axes!==void 0)if(!u(e.axes))i.push(`${t}.axes: not an object, left out`),delete o.axes;else{const r={...e.axes};for(const f of["x","y"]){const d=y(e.axes[f],`${t}.axes.${f}`,i);d?r[f]=d:delete r[f]}o.axes=r}return o}function b(e,t){const i=/position (\d+)/.exec(t);if(!i)return t;const s=Math.min(Number(i[1]),e.length),o=e.slice(0,s),l=o.split(`
|
|
2
|
-
`).length,
|
|
3
|
-
`)+1)+1;return`${t} (line ${
|
|
4
|
-
`}export function addPlots(e,t){const i=new Set(e.map(l=>l.id)),
|
|
1
|
+
import{newPlotId as m}from"./plotId.js";export{m as newPlotId};export const PLOTS_FORMAT="wafermap-plots",PLOTS_VERSION=1,SWEEPS_FORMAT="tsmap-sweeps",PLOT_CHARTS=["scatter","histogram","box","bar","line","sweep","probability","control","goal","heatmap"],PLOT_BUILTINS=["wafer","x","y","ring","quadrant","reticleCell","reticleShot","hbin","sbin","site","yield","dieCount","waferOrder","test","pat","radius"],PLOT_JUDGES=["limits","flag"],isPassRateSet=e=>isTestSet(e)&&e.passRate===!0,PLOT_BIN_BY=["count","width"],PLOT_BINS_MIN=2,PLOT_BINS_MAX=20,PLOT_BINS_DEFAULT=5,isBinned=e=>r(e)&&"binned"in e,PLOT_REFERENCES_MAX=8,PLOT_REFERENCE_STATS=["median","mean"],isStatReference=e=>"stat"in e,PLOT_AGGREGATES=["mean","median","min","max","sum","count","yield"],PLOT_LIMITS=["both","test","spec","none"],PLOT_NORMALIZE=["limits","zscore","robust"];export function plotConditions(e){const t=e.where;return t&&!t.off?t.conditions:[]}const r=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),p=e=>typeof e=="number"&&Number.isFinite(e),A=/^\s*\d+\s*(\.\.\s*\d+\s*)?$/,b=e=>typeof e=="number"&&Number.isInteger(e)||typeof e=="string"&&A.test(e);export const PLOT_FACET_LIMIT=24,PLOT_X_LEVELS=3,xFieldsOf=e=>e===void 0?[]:Array.isArray(e)?e:[e];export function sameField(e,t){return!e||!t?e===t:isBinned(e)||isBinned(t)?isBinned(e)&&isBinned(t)&&sameField(e.binned,t.binned):"test"in e?"test"in t&&e.test===t.test:"builtin"in e?"builtin"in t&&e.builtin===t.builtin:"tests"in e?"tests"in t&&!!e.passRate==!!t.passRate&&(e.judge??"limits")===(t.judge??"limits")&&e.tests.length===t.tests.length&&e.tests.every((i,o)=>String(i)===String(t.tests[o])):"passRate"in e?"passRate"in t&&!("tests"in t)&&e.passRate===t.passRate&&(e.judge??"limits")===(t.judge??"limits"):"meta"in t&&e.meta===t.meta}export const isTestSet=e=>r(e)&&"tests"in e&&Array.isArray(e.tests);export function isField(e){return r(e)?"binned"in e?isField(e.binned)&&!isBinned(e.binned)&&!isTestSet(e.binned)&&!("passRate"in e.binned):"test"in e?Number.isInteger(e.test):"builtin"in e?PLOT_BUILTINS.includes(e.builtin):"meta"in e?typeof e.meta=="string"&&e.meta!=="":"tests"in e?Array.isArray(e.tests)&&e.tests.length>0&&e.tests.every(b):"passRate"in e?Number.isInteger(e.passRate)&&(e.judge===void 0||PLOT_JUDGES.includes(e.judge)):!1:!1}function x(e,t,i){"judge"in e&&!PLOT_JUDGES.includes(e.judge)&&(i.push(`${t}.judge: "${String(e.judge)}" is not limits or flag, left out`),delete e.judge)}function a(e,t,i){if(e!==void 0){if(!r(e)){i.push(`${t}: not a field, left out`);return}if("binned"in e){const o=a(e.binned,`${t}.binned`,i);if(!o||isBinned(o)||isTestSet(o)||"passRate"in o){o&&i.push(`${t}: only one test or value can be binned, left out`);return}const n={...e,binned:o};return"bins"in e&&!(Number.isInteger(e.bins)&&e.bins>=PLOT_BINS_MIN&&e.bins<=PLOT_BINS_MAX)&&(i.push(`${t}.bins: ${JSON.stringify(e.bins)} is not a whole number from ${PLOT_BINS_MIN} to ${PLOT_BINS_MAX}, left out`),delete n.bins),"by"in e&&!PLOT_BIN_BY.includes(e.by)&&(i.push(`${t}.by: "${String(e.by)}" is not count or width, left out`),delete n.by),n}if("test"in e){if(!Number.isInteger(e.test)){i.push(`${t}: test number ${JSON.stringify(e.test)} is not an integer, left out`);return}const o={...e,test:e.test};return typeof e.name=="string"&&e.name!==""?o.name=e.name:delete o.name,o}if("builtin"in e)return PLOT_BUILTINS.includes(e.builtin)?{...e,builtin:e.builtin}:e;if("meta"in e){if(typeof e.meta!="string"||e.meta===""){i.push(`${t}: metadata key is empty, left out`);return}return{...e,meta:e.meta}}if("passRate"in e&&!("tests"in e)){if(!Number.isInteger(e.passRate)){i.push(`${t}: pass-rate test ${JSON.stringify(e.passRate)} is not an integer, left out`);return}const o={...e};return typeof e.name=="string"&&e.name!==""||delete o.name,x(o,t,i),o}if("tests"in e){if(!Array.isArray(e.tests)||e.tests.length===0||!e.tests.every(b)){i.push(`${t}: its tests must be test numbers or ranges such as "1010..1030", left out`);return}const o={...e,tests:e.tests};return"passRate"in e&&e.passRate!==!0&&(i.push(`${t}.passRate: not true, left out`),delete o.passRate),x(o,t,i),"names"in e&&!(r(e.names)&&Object.values(e.names).every(n=>typeof n=="string"))&&(i.push(`${t}.names: not a list of names, left out`),delete o.names),o}return e}}export function readFilter(e,t,i){const o=Array.isArray(e.conditions)?e.conditions:"field"in e?[{field:e.field,values:e.values}]:[],n=[];if(o.forEach((c,$)=>{const h=Array.isArray(e.conditions)?`${t}.conditions[${$}]`:t,y=S(c,h,i);y&&n.push(y)}),n.length===0)return;const{field:f,values:s,conditions:l,...u}=e,d={...u,conditions:n};return"off"in e&&typeof e.off!="boolean"&&(i.push(`${t}.off: not true or false, left out`),delete d.off),d}function S(e,t,i){if(!r(e)){i.push(`${t}: not a condition, left out`);return}const o=a(e.field,`${t}.field`,i);if(!o)return;const n={...e,field:o};if("values"in e){const f=Array.isArray(e.values)?e.values.filter(s=>typeof s=="string"):[];f.length?n.values=f:(i.push(`${t}.values: not a list of values, left out`),delete n.values)}for(const f of["min","max"])f in e&&!p(e[f])&&(i.push(`${t}.${f}: not a number, left out`),delete n[f]);if(n.min!==void 0&&n.max!==void 0&&n.min>n.max&&(i.push(`${t}: min is above max, the range left out`),delete n.min,delete n.max),"not"in e&&typeof e.not!="boolean"&&(i.push(`${t}.not: not true or false, left out`),delete n.not),!n.values&&n.min===void 0&&n.max===void 0){i.push(`${t}: needs values or a range, left out`);return}return n}function g(e,t,i){if(e===void 0)return;if(!r(e)){i.push(`${t}: not an object, left out`);return}const o={...e};"label"in e&&typeof e.label!="string"&&(i.push(`${t}.label: not text, left out`),delete o.label),"scale"in e&&e.scale!=="linear"&&e.scale!=="log"&&(i.push(`${t}.scale: "${String(e.scale)}" is not linear or log, left out`),delete o.scale);for(const n of["min","max"])n in e&&!p(e[n])&&(i.push(`${t}.${n}: not a number, left out`),delete o[n]);for(const n of["reverse","includeLimits","clip"])n in e&&typeof e[n]!="boolean"&&(i.push(`${t}.${n}: not true or false, left out`),delete o[n]);if("references"in e){const n=[],f=Array.isArray(e.references)?e.references:[];Array.isArray(e.references)||i.push(`${t}.references: not a list, left out`),f.forEach((s,l)=>{const u=r(s)&&(s.label===void 0||typeof s.label=="string"),d=u&&p(s.at)&&(s.to===void 0||p(s.to)&&s.to!==s.at),c=u&&!d&&PLOT_REFERENCE_STATS.includes(s.stat);d||c?n.length<PLOT_REFERENCES_MAX?n.push(d?{...s,at:s.at,...s.to!==void 0?{to:s.to}:{}}:{...s}):i.push(`${t}.references[${l}]: more than ${PLOT_REFERENCES_MAX}, left out`):i.push(`${t}.references[${l}]: needs a number (and a different number for a band), or median or mean, left out`)}),n.length?o.references=n:delete o.references}return o}export function readSweepPayload(e,t,i){if(!r(e))return i.push(`${t}: no sweep definition, left empty`),{series:[]};const o={...e};delete o.id,delete o.title;const n=Array.isArray(e.series)?e.series:[];Array.isArray(e.series)||i.push(`${t}.series: not a list, left empty`);const f=[];n.forEach((s,l)=>{const u=`${t}.series ${l+1}`;if(!r(s)){i.push(`${u}: not an object, skipped`);return}const d={...s};if((typeof s.label!="string"||s.label.trim()==="")&&(d.label=`Series ${l+1}`),!Array.isArray(s.tests)||!s.tests.every(b)){i.push(`${u}: its tests must be test numbers or ranges such as "1010..1030", skipped`);return}"xValues"in s&&!(Array.isArray(s.xValues)&&s.xValues.every(p))&&(i.push(`${u}.xValues: not a list of numbers, left out`),delete d.xValues),"xFromName"in s&&typeof s.xFromName!="string"&&(i.push(`${u}.xFromName: not text, left out`),delete d.xFromName),"color"in s&&typeof s.color!="string"&&delete d.color,"testNames"in s&&!(r(s.testNames)&&Object.values(s.testNames).every(c=>typeof c=="string"))&&(i.push(`${u}.testNames: not a list of names, left out`),delete d.testNames),f.push(d)}),o.series=f;for(const s of["xLabel","xUnit","yLabel"])s in e&&typeof e[s]!="string"&&(i.push(`${t}.${s}: not text, left out`),delete o[s]);return"xScale"in e&&e.xScale!=="linear"&&e.xScale!=="log"&&(i.push(`${t}.xScale: "${String(e.xScale)}" is not linear or log, left out`),delete o.xScale),"crossing"in e&&typeof e.crossing!="boolean"&&(i.push(`${t}.crossing: not true or false, left out`),delete o.crossing),"separationAt"in e&&!(Array.isArray(e.separationAt)&&e.separationAt.every(p))&&(i.push(`${t}.separationAt: not a list of numbers, left out`),delete o.separationAt),o}export function sweepToPlot(e){const{id:t,title:i,...o}=e;return{id:t,...i?{title:i}:{},chart:"sweep",sweep:o}}export function plotToSweep(e){if(e.chart==="sweep")return{...e.sweep??{series:[]},id:e.id,title:e.title??"Sweep"}}export function readPlot(e,t,i){if(!r(e))return i.push(`${t}: not an object, skipped`),null;const o=e.chart;if(typeof o!="string"||o==="")return i.push(`${t}: no chart, skipped`),null;const n={...e};(typeof e.id!="string"||e.id==="")&&(n.id=m(),i.push(`${t}: no id, given a new one`)),"title"in e&&typeof e.title!="string"?(i.push(`${t}.title: not text, left out`),delete n.title):typeof e.title=="string"&&e.title.trim()===""&&delete n.title;const f=r(e.fields)?e.fields:{};e.fields!==void 0&&!r(e.fields)&&i.push(`${t}.fields: not an object, left empty`);const s={...f};for(const l of["x","y"]){if(l==="x"&&Array.isArray(f.x)){const d=f.x.map((c,$)=>a(c,`${t}.fields.x ${$+1}`,i)).filter(c=>!!c);d.length?s.x=d:delete s.x;continue}const u=a(f[l],`${t}.fields.${l}`,i);u?s[l]=u:delete s[l]}if(f.rows!==void 0){const l=a(f.rows,`${t}.fields.rows`,i);l?s.rows=l:delete s.rows}if(f.facet!==void 0){const l=a(f.facet,`${t}.fields.facet`,i);l?s.facet=l:delete s.facet}if(f.color!==void 0){const l=f.color;if(r(l)&&"follow"in l)l.follow==="groupBy"?s.color={follow:"groupBy"}:s.color=l;else if(r(l)&&"none"in l)s.color={none:!0};else{const u=a(l,`${t}.fields.color`,i);u?s.color=u:delete s.color}}if(o==="sweep"&&Object.keys(s).length===0?delete n.fields:n.fields=s,"level"in e&&e.level!=="die"&&e.level!=="wafer"&&(i.push(`${t}.level: "${String(e.level)}" is not die or wafer, left out`),delete n.level),"aggregate"in e&&!PLOT_AGGREGATES.includes(e.aggregate)&&(i.push(`${t}.aggregate: "${String(e.aggregate)}" is not known to this version, left out`),delete n.aggregate),"where"in e){const l=e.where,u=r(l)?readFilter(l,`${t}.where`,i):void 0;u?n.where=u:(i.push(`${t}.where: needs at least one condition, left out`),delete n.where)}"stack"in e&&e.stack!=="stack"&&e.stack!=="percent"&&(i.push(`${t}.stack: "${String(e.stack)}" is not stack or percent, left out`),delete n.stack),"sort"in e&&e.sort!=="value"&&e.sort!=="ascending"&&(i.push(`${t}.sort: "${String(e.sort)}" is not known to this version, left out`),delete n.sort),"top"in e&&!(Number.isInteger(e.top)&&e.top>=1)&&(i.push(`${t}.top: not a whole number of at least 1, left out`),delete n.top),"baseline"in e&&!(Number.isInteger(e.baseline)&&e.baseline>=3)&&(i.push(`${t}.baseline: not a whole number of at least 3, left out`),delete n.baseline),"fit"in e&&e.fit!=="linear"&&e.fit!=="orthogonal"&&(i.push(`${t}.fit: "${String(e.fit)}" is not linear or orthogonal, left out`),delete n.fit);for(const l of["identity","normalCurve","valueLabels"])l in e&&typeof e[l]!="boolean"&&(i.push(`${t}.${l}: not true or false, left out`),delete n[l]);if("orientation"in e&&e.orientation!=="vertical"&&e.orientation!=="horizontal"&&(i.push(`${t}.orientation: "${String(e.orientation)}" is not vertical or horizontal, left out`),delete n.orientation),"barNorm"in e&&e.barNorm!=="count"&&e.barNorm!=="percent"&&(i.push(`${t}.barNorm: "${String(e.barNorm)}" is not count or percent, left out`),delete n.barNorm),"histNorm"in e&&e.histNorm!=="count"&&e.histNorm!=="percent"&&(i.push(`${t}.histNorm: "${String(e.histNorm)}" is not count or percent, left out`),delete n.histNorm),"whatIf"in e){const l=e.whatIf,u=r(l)&&p(l.lo)?l.lo:void 0,d=r(l)&&p(l.hi)?l.hi:void 0;u===void 0&&d===void 0?(i.push(`${t}.whatIf: needs a low or a high limit, left out`),delete n.whatIf):n.whatIf={...u!==void 0?{lo:u}:{},...d!==void 0?{hi:d}:{}}}if("spread"in e&&!["sd","ci95","iqr","minmax"].includes(e.spread)&&(i.push(`${t}.spread: "${String(e.spread)}" is not known to this version, left out`),delete n.spread),"cumulative"in e&&typeof e.cumulative!="boolean"&&(i.push(`${t}.cumulative: not true or false, left out`),delete n.cumulative),"probabilityAxis"in e&&e.probabilityAxis!=="normal"&&e.probabilityAxis!=="linear"&&(i.push(`${t}.probabilityAxis: "${String(e.probabilityAxis)}" is not normal or linear, left out`),delete n.probabilityAxis),"normalize"in e&&!PLOT_NORMALIZE.includes(e.normalize)&&(i.push(`${t}.normalize: "${String(e.normalize)}" is not known to this version, left out`),delete n.normalize),"limits"in e&&!PLOT_LIMITS.includes(e.limits)&&(i.push(`${t}.limits: "${String(e.limits)}" is not both, test, spec or none, left out`),delete n.limits),"bins"in e&&!(Number.isInteger(e.bins)&&e.bins>=1)&&(i.push(`${t}.bins: not a whole number of at least 1, left out`),delete n.bins),o==="sweep"&&(n.sweep=readSweepPayload(e.sweep,`${t}.sweep`,i)),e.axes!==void 0)if(!r(e.axes))i.push(`${t}.axes: not an object, left out`),delete n.axes;else{const l={...e.axes};for(const u of["x","y"]){const d=g(e.axes[u],`${t}.axes.${u}`,i);d?l[u]=d:delete l[u]}n.axes=l}return n}export function syntaxErrorAt(e,t){const i=/position (\d+)/.exec(t);if(!i)return t;const o=Math.min(Number(i[1]),e.length),n=e.slice(0,o),f=n.split(`
|
|
2
|
+
`).length,s=o-(n.lastIndexOf(`
|
|
3
|
+
`)+1)+1;return`${t} (line ${f}, column ${s})`}export function readIdentified(e,t,i){const o=[],n=new Set;return e.forEach((f,s)=>{const l=i.labelOf(f,s),u=i.read(f,l,t);u&&(n.has(u.id)&&(u.id=i.newId(),t.push(`${l}: its id was already used, given a new one`)),n.add(u.id),o.push(u))}),o}export function unwrapListFile(e,t){let i;try{i=JSON.parse(e)}catch(f){return{error:`Not valid JSON: ${syntaxErrorAt(e,f instanceof Error?f.message:String(f))}`}}let o;if(Array.isArray(i))o=i;else if(r(i)){const f=t.legacy?.(i);if(typeof f=="string")return{error:f};if(f)o=f;else{if(i.format!==t.format)return{error:`This is not a ${t.noun} file (expected "format": "${t.format}")`};o=i[t.key]}}else return{error:`This is not a ${t.noun} file`};if(!Array.isArray(o))return{error:`The file has no "${t.key}" list`};const n=[];return r(i)&&p(i.version)&&i.version>t.version&&n.push(`Written by a newer version (${i.version}); settings this version does not know are kept but not used`),{list:o,warnings:n}}export function readPlotsFile(e){const t=unwrapListFile(e,{format:PLOTS_FORMAT,noun:"plots",key:"plots",version:PLOTS_VERSION,legacy:f=>{if(f.format===SWEEPS_FORMAT)return Array.isArray(f.sweeps)?f.sweeps.map(s=>r(s)?{id:s.id,title:s.title,chart:"sweep",sweep:s}:s):'The file has no "sweeps" list'}});if("error"in t)return{plots:[],warnings:[],error:t.error};const{list:i,warnings:o}=t,n=readIdentified(i,o,{labelOf:(f,s)=>r(f)&&typeof f.title=="string"&&f.title?`"${f.title}"`:`plot ${s+1}`,read:readPlot,newId:m});return n.length===0&&i.length>0?{plots:n,warnings:o,error:"No plot in the file could be read"}:{plots:n,warnings:o}}export function writePlotsFile(e){return JSON.stringify({format:PLOTS_FORMAT,version:PLOTS_VERSION,plots:e},null,2)+`
|
|
4
|
+
`}export function addPlots(e,t){const{items:i,copies:o}=addIdentified(e,t,n=>n.title??n.id,m);return{plots:i,copies:o}}export function addIdentified(e,t,i,o){const n=new Set(e.map(l=>l.id)),f=[],s=t.map(l=>{if(!n.has(l.id))return n.add(l.id),l;const u=o();return n.add(u),f.push(i(l)),{...l,id:u}});return{items:[...e,...s],copies:f}}export function plotIssue(e){if(!PLOT_CHARTS.includes(e.chart))return"Needs a newer version of this tool";const t=e.fields??{};for(const i of[...xFieldsOf(t.x),t.y,t.color,t.facet,t.rows,...e.where?.conditions.map(o=>o.field)??[]])if(!(i===void 0||r(i)&&("follow"in i||"none"in i))&&!isField(i))return"Needs a newer version of this tool"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DIE_REGIONS as
|
|
1
|
+
import{DIE_REGIONS as b}from"./dieRegions.js";import{isYieldEligibleDie as E,isPositionedDie as h,diePassStatus as W,getDieKey as x}from"../core/dies.js";function N(e){return x(e)}export function buildRegionYieldData(e,t,o,n,s){const r=new Map,i=[];for(let c=0;c<t.length;c++){const u=e[c];if(!u?.length)continue;const l=new Set(typeof n=="function"?n(c):n),f=s(u.filter(h),t[c],o);for(const a of f){i.includes(a.key)||i.push(a.key);const S=r.get(a.key)??{label:a.label,pass:0,total:0};for(const g of a.dies){if(!E(g))continue;const d=W(g,l);d!==void 0&&(S.total++,d&&S.pass++)}r.set(a.key,S)}}return i.map(c=>{const u=r.get(c);return u.total===0?null:{key:c,label:u.label,n:u.total,passDies:u.pass,yieldPercent:u.pass/u.total*100}}).filter(c=>c!==null)}export function diesInRegion(e,t,o,n,s){const r=s(e.filter(h),t,o).find(i=>i.key===n);return r?r.dies.filter(i=>E(i)&&(i.hbin??i.sbin)!==void 0):[]}const R=["E","ENE","NE","NNE","N","NNW","NW","WNW","W","WSW","SW","SSW","S","SSE","SE","ESE"],M=["E","NE","N","NW","W","SW","S","SE"],A=["E","N","W","S"];export function compassBucket(e,t,o){const n=Math.PI/o,s=(Math.atan2(t,e)+2*Math.PI+n)%(2*Math.PI);return Math.floor(s/(2*Math.PI)*o)%o}export function sectorCompassNames(e){const t=[4,8,16].includes(e)?e:16;return t===4?A:t===8?M:R}export const QUADRANT_CYCLE=["NE","NW","SW","SE"];const D={NE:["NW","SE"],NW:["NE","SW"],SE:["NE","SW"],SW:["NW","SE"]};export function areQuadrantsAdjacent(e,t){return D[e]?.includes(t)??!1}const p=1440;export function regionAngleBins(e,t){const o=parseRegionKey(e);let n,s;if(o.family==="quadrant"){const i=QUADRANT_CYCLE.indexOf(o.quadrant);if(i<0)return;n=i*p/4,s=p/4}else if(o.family==="sector"){const i=[4,8,16].includes(t)?t:void 0,c=i?sectorCompassNames(i).indexOf(o.sector??""):-1;if(!i||c<0)return;s=p/i,n=c*s-s/2}else return;const r=new Set;for(let i=0;i<s;i++)r.add(((n+i)%p+p)%p);return r}export function parseReticleCellKey(e){const t=/^reticle-position:cell:(-?\d+),(-?\d+)$/.exec(e);return t?{column:Number(t[1]),row:Number(t[2])}:void 0}export function parseRegionKey(e){return e.startsWith("ring:")?{family:"ring",ring:Number(e.slice(5))}:e.startsWith("quadrant:")?{family:"quadrant",quadrant:e.slice(9)}:e.startsWith("sector:")?{family:"sector",sector:e.slice(7)}:{family:"unknown"}}function m(e,t,o){const n=b[t].grouping,s=new Map;for(const r of e){const i=n.place(r,o);if(!i)continue;const c=s.get(i.key)??{family:n.family,key:i.key,label:i.label,dieKeys:[],dies:[]};c.dieKeys.push(N(r)),c.dies.push(r),s.set(i.key,c)}return[...s.values()].sort((r,i)=>n.order(r.key,i.key))}export function buildRingRegions(e,t,o){return m(e,"ring",{wafer:t,ringCount:o})}export function buildQuadrantRegions(e,t,o){return m(e,"quadrant",{wafer:t,ringCount:o})}export function buildReticlePositionRegions(e,t){return t?m(e,"reticleCell",{ringCount:0,reticle:t}):[]}const I=3;export function buildTestSiteRegions(e,t=!1){const o=new Map;for(const n of e){if(n.siteNum===void 0)continue;const s=o.get(n.siteNum)??[];s.push(n),o.set(n.siteNum,s)}if(!t){let n=0;for(const s of o.values())s.length>=I&&n++;if(n<2)return[]}return[...o.entries()].sort(([n],[s])=>n-s).map(([n,s])=>({family:"test-site",key:`test-site:${n}`,label:`Site ${n}`,dieKeys:s.map(N),dies:s}))}export function buildSectorRegions(e,t,o){const n=[4,8,16].includes(o)?o:16,s=sectorCompassNames(n),r=new Map,i=t.center.x,c=t.center.y,u=t.radius;for(const l of e){const f=l.physX-i,a=l.physY-c;if(Math.hypot(f,a)/u<.2)continue;const g=s[compassBucket(f,a,n)],d=`sector:${g}`,y=r.get(d)??{family:"sector",key:d,label:`Sector ${g}`,dieKeys:[],dies:[]};y.dieKeys.push(N(l)),y.dies.push(l),r.set(d,y)}return[...r.values()].sort((l,f)=>l.key.localeCompare(f.key))}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import{waferDisplayLabel as I}from"../core/waferLabel.js";import{binPassSets as
|
|
2
|
-
`)}function
|
|
3
|
-
`)),u?
|
|
1
|
+
import{waferDisplayLabel as I}from"../core/waferLabel.js";import{binPassSets as Ie,binPassSetsByWafer as ke,mergeBinDefs as ee,resolveBinColors as Ee,resolveBinColorsByWafer as He}from"../renderer/binColors.js";import{commonPassBins as Ae,itemPassBins as k,passBinsLabel as je}from"../core/passBins.js";import{itemRingCount as Ge}from"../core/ringCount.js";import{stackBinsAreData as qe}from"../core/aggregates.js";import{isParametricTest as E,isBuiltMap as te}from"../renderer/buildWaferMap.js";import{buildRingRegions as ne,buildQuadrantRegions as se,buildRegionYieldData as ze}from"./regions.js";import{openHtmlReport as Oe}from"./renderFindingsReport.js";import{analyzeWaferLot as _e}from"./analyzeWaferLot.js";import{computeFunctionalYield as Qe,analyzeWaferMap as Ve}from"./analyzeWaferMap.js";import{mergeTestDefs as Ue}from"./mergeTestDefs.js";import{buildFacetTable as Ke,facetValueOf as Je,FACET_NONE_VALUE as Xe}from"./facets.js";import{visibleFindings as H}from"./filterFindings.js";import{buildYieldDataCombined as Ze}from"./yield.js";import{describeWaferPopulation as ae,populationLabel as et}from"./population.js";import{buildTestPassRateData as tt,hasJudgeableTests as nt,poolFunctionalYield as st}from"./testPassRate.js";import{buildCapabilityData as at,pooledTestStatsSteps as it}from"./capability.js";import{buildSynthesis as ot}from"./synthesis.js";import{binBreakdownRows as rt,binBreakdownTitle as lt,binCountsFrom as ct,pooledBinCounts as dt,totalOf as ut}from"./binRows.js";import{MEAN_WAFER_YIELD_LABEL as ft,shortfallLegend as A}from"./presentation.js";import{regionYieldRows as ie,waferYieldRows as mt}from"./yieldRows.js";import{describeValues as pt}from"./math.js";import{fmt as N}from"../renderer/fmt.js";import{isYieldEligibleDie as j,getDieKey as gt,isPositionedDie as ht,diePassStatus as oe}from"../core/dies.js";import{excludedCounts as bt,testValue as yt}from"../core/dieTable.js";import{limitSetName as St}from"../renderer/valueFilter.js";import{findingsTableHtml as re,findingAnchor as wt,synthesisSectionHtml as $t,reportScripts as G,barCell as M,deltaCell as q,withSectionNav as le,renderMetadataSection as ce,renderMetricGrid as de,renderSection as x,renderTable as P,reportStyles as z}from"./reportHtml.js";import{escHtml as w,drain as vt}from"../core/utils.js";function O(e,i){return i===0?"\u2014":`${(e/i*100).toFixed(1)}%`}function Dt(e){if(!e)return"";const i=e.lot??e.lotId,o=e.wafer??e.waferId,s=[i,o].filter(Boolean).map(String);return s.length?` \u2014 ${s.map(w).join(" \xB7 ")}`:""}function ue(e,i,o,s,r){if(!e.size)return"";const t=rt(e,i,s).map(a=>{const l=a.passing?"muted-row":"",c=u=>({html:w(u),className:l});return[c(String(a.bin)),c(a.name??"\u2014"),c(String(a.count)),M(a.percent,`${a.percent.toFixed(1)}%`,l,r?.get(a.bin))]});return x(lt(o,ut(e)),P(["Bin","Name","Dies","Share"],t,{className:"compact"}))}function xt(e,i,o,s,r,t){const a=Ie(e,r);return["hard","soft"].map(l=>ue(ct(e,l,l==="hard"?s.hard:s.soft),l==="hard"?i:o,l,a[l],t[l])).join(`
|
|
2
|
+
`)}function fe(e,i,o,s){const r=new Set(s),t=new Map(o.map(n=>[gt(n),n]));if(!o.some(n=>n.hbin!=null||n.sbin!=null)||!i.length)return"";const l=[];for(const n of i){let m=0,y=0;for(const v of n.dieKeys){const S=t.get(v);if(!S||!j(S))continue;const p=oe(S,r);p!==void 0&&(y++,p&&m++)}y&&l.push({label:n.label,pass:m,total:y})}if(!l.length)return"";const{rows:c}=ie(l.map(n=>({key:n.label,label:n.label,n:n.total,passDies:n.pass,yieldPercent:n.pass/n.total*100}))),u=c.map(n=>[w(n.label),String(n.passDies),String(n.n),M(n.yieldPercent,O(n.passDies,n.n)),q(n.delta)]);return x(e,P(["Region","Pass","Total","Yield","vs wafer"],u,{className:"compact"})+`<p class="report-legend">${A("the wafer")}</p>`)}function Pt(e,i){const o=new Float64Array(e.length);let s=0;for(const y of e){const v=yt(y,i);v!==void 0&&Number.isFinite(v)&&(o[s++]=v)}if(s===0)return;const{count:r,min:t,mean:a,max:l,q1:c,median:u,q3:n,stddev:m}=pt(o.subarray(0,s));return{testNumber:i,count:r,min:t,mean:a,max:l,q1:c,median:u,q3:n,stddev:m}}function me(e,i,o,s,r,t){if(!i.length)return"";const a=e.filter(d=>j(d)),l=new Map((o??[]).map(d=>[d.testNumber,d])),c=new Map((s??[]).map(d=>[d.testNumber,d.yieldPercent])),u=[];for(const d of i.filter(E)){const f=l.get(d.testNumber)??Pt(a,d.testNumber);f&&u.push({name:d.name,unit:d.unit||void 0,stats:f,limitYield:c.get(d.testNumber)})}if(!u.length)return"";const n=d=>u.every(f=>f.stats[d]!==void 0),m=n("q1")&&n("median")&&n("q3"),y=n("stddev"),v=u.some(d=>d.limitYield!==void 0&&d.limitYield!==null),S=(d,f)=>d===void 0?"\u2014":N(d,f),p=bt(a),g=p?`${[...p.counts.values()].reduce((d,f)=>d+f,0).toLocaleString("en-GB")} values outside the ${St(p.by)} are excluded (not in N): `+[...p.counts].map(([d,f])=>`${w(i.find($=>$.testNumber===d)?.name??`test ${d}`)} ${f.toLocaleString("en-GB")}`).join(", ")+". ":"",b=["Test","N","Min",...m?["Q1","Median"]:[],"Mean",...m?["Q3"]:[],"Max",...y?["StdDev"]:[],...v?["Limit yield"]:[]],D=u.map(({name:d,unit:f,stats:$,limitYield:F})=>[w(d),{html:String($.count),className:"numeric"},S($.min,f),...m?[S($.q1,f),S($.median,f)]:[],S($.mean,f),...m?[S($.q3,f)]:[],S($.max,f),...y?[S($.stddev,f)]:[],...v?[F==null?"\u2014":`${F.toFixed(1)}%`]:[]]);return x("Test Values",P(b,D,{className:"compact"})+`<p class="report-legend">${y?"StdDev is the sample standard deviation (n\u22121). ":""}${g}${r??""}</p>`,"",t)}function pe(e,i,o,s){const r=o??Qe(e,i);if(!r?.length)return"";const t=r.map(a=>[w(a.label),String(a.totalDies),String(a.passDies),String(a.failDies),a.passRatePercent!==null?`${a.passRatePercent.toFixed(1)}%`:"\u2014"]);return x("Functional Tests",P(["Test","N","Pass","Fail","Pass Rate"],t,{className:"compact"}),"",s)}function ge(e,i){const o=at(e,i);if(!o.length)return"";const s=t=>t===null?"\u2014":t.toFixed(2),r=o.map(t=>[w(t.label),t.hasSpec?t.limitBasis==="spec"?`LSL ${N(t.lsl,t.unit)} \u2013 USL ${N(t.usl,t.unit)}`:`Lo limit ${N(t.lsl,t.unit)} \u2013 Hi limit ${N(t.usl,t.unit)}`:"\u2014",N(t.mean,t.unit),s(t.cp),s(t.cpk),s(t.pp),s(t.ppk)]);return x("Process Capability",P(["Test","Limits","Mean","Cp","Cpk","Pp","Ppk"],r,{className:"compact"}))}function he(e,i,o="",s=!1){const r=H(e);return r.length?x("Findings",re(r,i,o,s)):""}const _=e=>`report-tests-${e}`,Q=e=>`report-functional-${e}`;function be(e,i,o,s){const r=new Set(H(e.findings).map(a=>a.id)),t=a=>a.kind==="finding"?r.has(a.id)?wt(a.id,o):void 0:s.get(a.testNumber);return $t(ot(e,{passBins:i?[...i]:void 0}),t)}function ye(e,i,o,s){const r=new Map;for(const t of e)(E(t)?o:s)&&r.set(t.testNumber,E(t)?_(i):Q(i));return r}export function renderSummaryReportHtml(e,i={}){const{wafer:o,dies:s,yieldSummary:r,dataCoverage:t,hbinDefs:a,sbinDefs:l,testDefs:c=[],statsSummary:u,passBins:n,ringCount:m}=e,y=e.binColors??Ee(s,{passBins:n,hbinDefs:a,sbinDefs:l}),v=o.metadata,S=Dt(v),p=i.title??`Wafer Summary${S}`,g=new Date().toLocaleString(),b=s.filter(ht),D=ne(b,o,m),d=se(b,o,m),f=qe(u?.stats.isLotStack,u?.stats.aggregationMethod),$=f?[{label:"Total dies",value:String(r.totalDies)},{label:"Filled dies",value:String(t.filledDies),hint:`${O(t.filledDies,t.totalDies)} fill`},{label:"Pass dies",value:String(r.passDies)},{label:"Fail dies",value:String(r.failDies)},...r.partialDies>0?[{label:"Partial",value:String(r.partialDies)}]:[],...r.yieldPercent!==null?[{label:`Yield (pass: ${je([n])})`,value:`${r.yieldPercent.toFixed(1)}%`}]:[],...r.edgeExcludedDies>0?[{label:"Edge excluded (outer zone)",value:String(r.edgeExcludedDies)}]:[]]:[{label:"Dies",value:String(s.length)},{label:"Filled dies",value:String(t.filledDies),hint:`${O(t.filledDies,t.totalDies)} fill`}],F=me(s,c,u?.stats.perTestStats,u?.stats.testSpecYield,void 0,_("")),B=pe(s,c,u?.stats.functionalYield,Q("")),C=[ce([{metadata:o.metadata}]),x("Summary",[de($)].filter(Boolean).join(`
|
|
3
|
+
`)),u?be(u,n,"",ye(c,"",!!F,!!B)):"",f?xt(s,a,l,{hard:u?.stats.hardBinCounts,soft:u?.stats.softBinCounts},n,y):"",f?fe("Ring Yield",D,s,n):"",f?fe("Quadrant Yield",d,s,n):"",F,B,ge([{dies:s}],c),u?he(u.findings,void 0,"",e.live):""].filter(Boolean).join(`
|
|
4
4
|
`);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
6
6
|
<head>
|
|
7
7
|
<meta charset="UTF-8">
|
|
8
|
-
<title>${
|
|
8
|
+
<title>${w(p)}</title>
|
|
9
9
|
<style>
|
|
10
|
-
${
|
|
10
|
+
${z()}
|
|
11
11
|
</style>
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<main class="report">
|
|
15
15
|
<header class="report-header">
|
|
16
|
-
<h1>${
|
|
17
|
-
<p class="report-subtitle">Generated ${
|
|
16
|
+
<h1>${w(p)}</h1>
|
|
17
|
+
<p class="report-subtitle">Generated ${w(g)}</p>
|
|
18
18
|
</header>
|
|
19
|
-
${
|
|
20
|
-
<p class="footer">Generated ${
|
|
19
|
+
${le(C)}
|
|
20
|
+
<p class="footer">Generated ${w(g)}</p>
|
|
21
21
|
</main>
|
|
22
|
-
${
|
|
22
|
+
${G(e.live)}
|
|
23
23
|
</body>
|
|
24
|
-
</html>`}function
|
|
25
|
-
`))}const
|
|
26
|
-
`)}`)}if(!a.length)return"";const l=r.length>t.length?`<p class="report-note">${r.length-t.length} further
|
|
27
|
-
`)+l)}function
|
|
28
|
-
`)}function
|
|
29
|
-
`);return{lotSummary:n,sections:
|
|
24
|
+
</html>`}function Ft(e,i){const o=e.perWafer.flatMap(t=>{const a=t.summary.stats.yieldPercent;return a===null?[]:[{waferIndex:t.waferIndex,yieldPercent:a}]}),s=new Map(mt(o).rows.map(t=>[t.waferIndex,t])),r=e.perWafer.map(t=>{const a=w(I(i[t.waferIndex],t.waferIndex)),l=s.get(t.waferIndex);return l?[l.outlier?`${a} \xB7 ${l.outlier} outlier`:a,M(l.yieldPercent,`${l.yieldPercent.toFixed(1)}%`),q(l.delta)]:[a,"N/A",""]});return P(["Wafer","Yield","vs lot median"],r,{className:"compact"})+`<p class="report-legend">${A("the lot median")}</p>`}function Bt(e){const i=[];for(const t of e.perWafer){const a=H(t.summary.findings);if(!a.length)continue;const l=I({wafer:{metadata:t.summary.wafer}},t.waferIndex);i.push(`<h3 class="report-subheading">${w(l)}</h3>`+re(a))}if(!i.length)return"";const o=i.length,s=e.perWafer.length,r=`<p class="report-note">${o} of ${s} wafer${s===1?"":"s"} have per-wafer findings; the rest had none.</p>`;return x("Findings by Wafer",r+i.join(`
|
|
25
|
+
`))}const Ct=3;function Tt(e,i,o){const s=e.map(c=>({metadata:c.wafer?.metadata})),r=Ke(s,{facetableOnly:!0}).filter(c=>c.splittable);if(!r.length)return"";const t=r.slice(0,Ct),a=[];for(const c of t){const u=new Map;e.forEach((g,b)=>{const D=Je(g.wafer?.metadata,c.key)??Xe;(u.get(D)??u.set(D,[]).get(D)).push(b)});const n=[...u.entries()].map(([g,b])=>({key:g,items:b.map(D=>e[D])}));if(n.length<2)continue;const m=n.map(g=>[w(g.key),w(g.items.map(b=>b.label).join(", "))]),y=Ze(n.map(g=>({key:g.key,items:g.items.map(b=>({label:b.label,dies:b.dies,passBins:k(b,o)}))}))).map(g=>[w(g.label),String(g.itemCount),`${g.percent.toFixed(1)}%`]),v=[P([c.label,"Wafers"],m,{className:"compact"}),P([c.label,"Wafers","Yield"],y,{className:"compact"})],S=e.flatMap(g=>g.dies??[]);let p=0;for(const g of["spec","testFlag","functional"]){if(!nt(i,g,S))continue;const b=tt(n.map(f=>({key:f.key,items:f.items.map($=>({dies:$.dies,testSpecYield:$.statsSummary?.stats.testSpecYield,functionalYield:$.statsSummary?.stats.functionalYield}))})),i,g);if(!b.rows.length)continue;const D=b.rows.map(f=>[w(f.label),...f.byGroup.map($=>$.passRatePercent===null?"\u2014":`${$.passRatePercent.toFixed(1)}%`),f.overall.passRatePercent===null?"\u2014":`${f.overall.passRatePercent.toFixed(1)}%`]),d=g==="spec"?"Pass rate \xB7 test limits":g==="testFlag"?"Pass rate \xB7 tester flag":"Pass rate \xB7 functional";b.disagreementDies&&(p=b.disagreementDies),v.push(`<h4 class="report-subheading">${w(d)}</h4>`+P(["Test",...b.groups,"All"],D,{className:"compact"}))}p&&v.push(`<p class="report-note">${p.toLocaleString()} dies judged differently by limits and tester flag.</p>`),a.push(`<h3 class="report-subheading">${w(c.label)}</h3>${v.join(`
|
|
26
|
+
`)}`)}if(!a.length)return"";const l=r.length>t.length?`<p class="report-note">${r.length-t.length} further wafer field(s) not shown.</p>`:"";return x("Group Comparison",a.join(`
|
|
27
|
+
`)+l)}function Yt(e,i,o,s,r,t){const a=ke(r);return["hard","soft"].map(l=>ue(dt(s,e,l),l==="hard"?i:o,l,a[l],t[l])).join(`
|
|
28
|
+
`)}function Se(e,i,o,s,r,t){const a=ze(o,s,r,c=>t[c],i);if(!a.length)return"";const l=ie(a).rows.map(c=>[w(c.label),M(c.yieldPercent,`${c.yieldPercent.toFixed(1)}%`),q(c.delta)]);return x(e,P(["Region","Yield","vs lot"],l,{className:"compact"})+`<p class="report-legend">${A("the lot")}</p>`)}function Nt(e,i,o,s,r,t){let a;if(s?.length&&s.every(c=>c.stats.perTestStats!==void 0)){const c=new Map;for(const u of s)for(const n of u.stats.perTestStats??[]){const m=c.get(n.testNumber)??{n:0,sum:0,min:1/0,max:-1/0,parts:[]};m.n+=n.count,m.sum+=n.mean*n.count,m.min=Math.min(m.min,n.min),m.max=Math.max(m.max,n.max),m.parts.push({n:n.count,mean:n.mean,sd:n.stddev}),c.set(n.testNumber,m)}a=[...c.entries()].map(([u,n])=>{const m=n.sum/n.n,y=n.parts.every(S=>S.sd!==void 0),v=y&&n.n>1?n.parts.reduce((S,p)=>S+Math.max(0,p.n-1)*p.sd**2+p.n*(p.mean-m)**2,0)/(n.n-1):y?0:void 0;return{testNumber:u,count:n.n,min:n.min,max:n.max,mean:m,...v!==void 0?{stddev:Math.sqrt(v)}:{}}})}const l=a?void 0:[...vt(it(e,o)).stats].map(([c,u])=>({testNumber:c,...u}));return me(i,o,a??l,r,a?"Quartiles are not shown for a lot: they cannot be combined from each wafer\u2019s own.":void 0,t)}function Mt(e,i,o,s){const r=st(o);return pe(e,i,r,s)}const V=["lot","product","testProgram","temperature"];function Rt(e){const i=new Map(V.map(t=>[t,new Set]));for(const t of e)for(const a of V){const l=t.wafer?.metadata?.[a];l!=null&&l!==""&&i.get(a).add(String(l))}const o=V.filter(t=>i.get(t).size>1);if(o.length===0)return[{label:"",items:e,varying:o}];const s=new Map,r=[];for(const t of e){const a=o.map(l=>String(t.wafer?.metadata?.[l]??"(none)")).join(" \xB7 ");s.has(a)||(s.set(a,[]),r.push(a)),s.get(a).push(t)}return r.map(t=>({label:t,items:s.get(t),varying:o}))}function we(e,i,o,s,r,t,a,l,c="",u=!1){const n=_e(e.map(h=>h.source??h),{perWaferSummaries:e.map(h=>h.statsSummary),...a}),m=[],y=[],v=[],S=[];for(const h of e){const T=h.dies??[];h.wafer&&(m.push(h.wafer),v.push(T),S.push(k(h,r)));for(const Y of T)y.push(Y)}const p=e.map(h=>({dies:h.dies??[],passBins:k(h,r)})),g=l??He(p,{hbinDefs:i,sbinDefs:o}).colors,b=y.some(h=>h.hbin!=null),D=y.some(h=>h.sbin!=null),d=b||D,f=n.perWafer.map(h=>h.summary.stats.yieldPercent).filter(h=>h!==null),$=f.length?f.reduce((h,T)=>h+T,0)/f.length:null;let F=0,B=0,C=0,R=0,W=0;for(const h of p){const T=new Set(h.passBins);for(const Y of h.dies){if(F++,Y.edgeExcluded&&R++,Y.partial&&W++,!j(Y))continue;const Z=oe(Y,T);Z!==void 0&&(B++,Z&&C++)}}const ve=B-C,U=B>0?C/B*100:null,De=[{label:"Wafers",value:String(n.stats.waferCount)},{label:"Total dies",value:String(F)},...d?[{label:"Good dies",value:String(C)},{label:"Bad dies",value:String(ve)}]:[],...R>0?[{label:"Edge excluded",value:String(R)}]:[],...W>0?[{label:"Partial dies",value:String(W)}]:[],...$!==null?[{label:ft,value:`${$.toFixed(1)}%`}]:[],...U!==null?[{label:"Total yield",value:`${U.toFixed(1)}%`}]:[]],xe=ae(n.perWafer.map(h=>h.summary.wafer)),Pe=x(xe.lotId!==void 0?"Lot Summary":"Summary",de(De)),Fe=ce(e.map(h=>({metadata:h.wafer?.metadata}))),Be=x("Per-Wafer Yield",Ft(n,e)),K=t??Ge(e[0]),Ce=Tt(e,s,r),L=n.perWafer.map(h=>h.summary),Te=d?Yt(y,i,o,L,p,g):"",Ye=d&&m.length?Se("Ring Yield (All Wafers)",ne,v,m,K,S):"",Ne=d&&m.length?Se("Quadrant Yield (All Wafers)",se,v,m,K,S):"",J=s.length?Nt(e,y,s,L,n.stats.testSpecYield,_(c)):"",X=s.length?Mt(y,s,L,Q(c)):"",Me=s.length?ge(e,s):"",Re=n.findings.length?he(n.findings,n.stats.waferCount,c,u):"",We=Bt(n),Le=[Pe,be(n,Ae(p.map(h=>h.passBins)),c,ye(s,c,!!J,!!X)),Fe,Be,Ce,Te,Ye,Ne,J,X,Me,Re,We].filter(Boolean).join(`
|
|
29
|
+
`);return{lotSummary:n,sections:Le}}function $e(e,i,o,s=""){return`<main class="report">
|
|
30
30
|
<header class="report-header">
|
|
31
|
-
<h1>${
|
|
32
|
-
<p class="report-subtitle">Generated ${
|
|
31
|
+
<h1>${w(e)}</h1>
|
|
32
|
+
<p class="report-subtitle">Generated ${w(o)}</p>
|
|
33
33
|
</header>
|
|
34
|
-
${
|
|
35
|
-
<p class="footer">Generated ${
|
|
36
|
-
</main>`}export function renderLotSummaryReportHtml(e,i={}){const{items:o,hbinDefs:s,sbinDefs:r,testDefs:t=[],passBins:a,ringCount:l,analyzeOptions:c}=e,u=new Date().toLocaleString(),n=
|
|
34
|
+
${le(i,s)}
|
|
35
|
+
<p class="footer">Generated ${w(o)}</p>
|
|
36
|
+
</main>`}export function renderLotSummaryReportHtml(e,i={}){const{items:o,hbinDefs:s,sbinDefs:r,testDefs:t=[],passBins:a,ringCount:l,analyzeOptions:c}=e,u=new Date().toLocaleString(),n=Rt(o);if(n.length===1){const{lotSummary:p,sections:g}=we(n[0].items,s,r,t,a,l,c,e.binColors,"",e.live),b=ae(p.perWafer.map(d=>d.summary.wafer)),D=i.title??(b.lotId!==void 0?`Lot Summary \u2014 ${b.lotId}`:`Summary \u2014 ${et(b)}`);return`<!DOCTYPE html>
|
|
37
37
|
<html lang="en">
|
|
38
38
|
<head>
|
|
39
39
|
<meta charset="UTF-8">
|
|
40
|
-
<title>${
|
|
40
|
+
<title>${w(D)}</title>
|
|
41
41
|
<style>
|
|
42
|
-
${
|
|
42
|
+
${z()}
|
|
43
43
|
</style>
|
|
44
44
|
</head>
|
|
45
45
|
<body>
|
|
46
|
-
${
|
|
47
|
-
${
|
|
46
|
+
${$e(D,g,u)}
|
|
47
|
+
${G(e.live)}
|
|
48
48
|
</body>
|
|
49
|
-
</html>`}const
|
|
49
|
+
</html>`}const m=i.title??"Summary",y=n.map((p,g)=>{const b=`g${g+1}-`,{lotSummary:D,sections:d}=we(p.items,s,r,t,a,l,c,e.binColors,b,e.live),f=p.varying.includes("lot")?void 0:D.lot?.lot??D.lot?.lotId,$=f?`${p.label} \xB7 Lot ${String(f)}`:p.label;return $e(`${m} \u2014 ${$}`,d,u,b)}),v=`<p style="max-width:1080px;margin:0 auto 8px;padding:8px 12px;background:var(--report-surface);border:1px solid var(--report-line);border-radius:4px;font-size:12px;color:var(--report-muted);">This load spans ${n.length} groups by identity \u2014 shown separately below so stats are never pooled across them.</p>`,S=y.map((p,g)=>`${g===0?"":'<hr style="max-width:1080px;margin:32px auto 0;border:none;border-top:3px solid var(--report-line-strong);">'}
|
|
50
50
|
${p}`).join(`
|
|
51
51
|
`);return`<!DOCTYPE html>
|
|
52
52
|
<html lang="en">
|
|
53
53
|
<head>
|
|
54
54
|
<meta charset="UTF-8">
|
|
55
|
-
<title>${
|
|
55
|
+
<title>${w(m)}</title>
|
|
56
56
|
<style>
|
|
57
|
-
${
|
|
57
|
+
${z()}
|
|
58
58
|
</style>
|
|
59
59
|
</head>
|
|
60
60
|
<body>
|
|
61
61
|
<div class="report" style="padding-top:24px;">
|
|
62
62
|
${v}
|
|
63
63
|
</div>
|
|
64
|
-
${
|
|
65
|
-
${
|
|
64
|
+
${S}
|
|
65
|
+
${G(e.live)}
|
|
66
66
|
</body>
|
|
67
|
-
</html>`}export{
|
|
67
|
+
</html>`}export{Oe as openHtmlReport};export function renderWaferReportHtml(e,i,o={}){return renderSummaryReportHtml({wafer:e.wafer,dies:e.dies,yieldSummary:e.yield,dataCoverage:e.dataCoverage,hbinDefs:e.hbinDefs,sbinDefs:e.sbinDefs,testDefs:e.testDefs,statsSummary:i??e.statsSummary??(te(e)?Ve(e):void 0),passBins:[...e.passBins],ringCount:e.ringCount,binColors:o.binColors,live:o.live},o)}export function renderLotReportHtml(e,i={}){const o=ee(e.map(t=>t.hbinDefs)),s=ee(e.map(t=>t.sbinDefs)),r=e.some(t=>t.testDefs?.length)?Ue([...e]).defs:void 0;return renderLotSummaryReportHtml({items:e.map((t,a)=>({label:I(t,a),wafer:t.wafer,dies:t.dies,passBins:[...t.passBins],statsSummary:t.statsSummary,source:te(t)?t:void 0})),hbinDefs:o.length?o:void 0,sbinDefs:s.length?s:void 0,testDefs:r,ringCount:e[0]?.ringCount,analyzeOptions:i.analyzeOptions,binColors:i.binColors,live:i.live},{title:i.title})}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SYNTHESIS_ALSO_HEADING as v,synthesisMoreTests as w,synthesisRowShare as $}from"./synthesis.js";import{formatFindingTooltip as y,findingMetricLabel as k,isProportionFinding as S}from"./findingText.js";import{arrangeFindings as z}from"./filterFindings.js";import{SEVERITY_MARK as
|
|
1
|
+
import{SYNTHESIS_ALSO_HEADING as v,synthesisMoreTests as w,synthesisRowShare as $}from"./synthesis.js";import{formatFindingTooltip as y,findingMetricLabel as k,isProportionFinding as S}from"./findingText.js";import{arrangeFindings as z}from"./filterFindings.js";import{SEVERITY_MARK as h,METER_DOTS as j,filledDots as T,impactWord as N,impactShortWord as I,shortfallColor as b,shortfallStep as M,formatPoints as F,barPercent as A}from"./presentation.js";import{fmt as f,plainBinTerms as E}from"../renderer/fmt.js";import{buildFacetTable as L,attributeLabel as D}from"./facets.js";import{escHtml as o}from"../core/utils.js";import{derivedKeyText as _,derivedFields as R}from"../renderer/testLabel.js";export function renderSection(e,r,t="",a){return`<section class="${["report-section",t].filter(Boolean).join(" ")}"${a?` id="${o(a)}"`:""}>
|
|
2
2
|
<h2>${o(e)}</h2>
|
|
3
3
|
${r}
|
|
4
4
|
</section>`}export function renderDefinitionList(e,r="meta-list"){if(!e.length)return"";const t=e.map(a=>`<div class="definition-item"><dt>${o(a.label)}</dt><dd>${o(a.value)}</dd></div>`).join(`
|
|
@@ -11,11 +11,11 @@ ${e.map(t=>`<div class="metric">
|
|
|
11
11
|
${t.hint?`<span class="metric-hint">${o(t.hint)}</span>`:""}
|
|
12
12
|
</div>`).join(`
|
|
13
13
|
`)}
|
|
14
|
-
</dl>`:""}export function renderTable(e,r,t={}){if(!r.length)return`<p class="no-data">${o(t.emptyMessage??"No data")}</p>`;const a=["report-table",t.className].filter(Boolean).join(" "),l=e.map(
|
|
14
|
+
</dl>`:""}export function renderTable(e,r,t={}){if(!r.length)return`<p class="no-data">${o(t.emptyMessage??"No data")}</p>`;const a=["report-table",t.className].filter(Boolean).join(" "),l=e.map(i=>`<th>${o(i)}</th>`).join(""),c=i=>typeof i=="string"?`<td>${i}</td>`:`<td${i.className?` class="${i.className}"`:""}>${i.html}</td>`,p=r.map(i=>`<tr>${i.map(c).join("")}</tr>`).join(`
|
|
15
15
|
`);return`<table class="${a}">
|
|
16
16
|
<thead><tr>${l}</tr></thead>
|
|
17
17
|
<tbody>${p}</tbody>
|
|
18
|
-
</table>`}export function renderMeter(e,r){const t=T(e);return`<span class="meter"><span class="meter-dots" aria-hidden="true">${"\u25CF".repeat(t)}${"\u25CB".repeat(j-t)}</span><span class="meter-word">${o(r)}</span></span>`}export function renderSeverityMeter(e){const{tier:r,word:t}=
|
|
18
|
+
</table>`}export function renderMeter(e,r){const t=T(e);return`<span class="meter"><span class="meter-dots" aria-hidden="true">${"\u25CF".repeat(t)}${"\u25CB".repeat(j-t)}</span><span class="meter-word">${o(r)}</span></span>`}export function renderSeverityMeter(e){const{tier:r,word:t}=h[e];return renderMeter(r,t)}export const severityTier=e=>h[e].tier;export function barCell(e,r,t="",a){const l=a?`;background:${o(a)}`:"";return{html:`<span class="cellbar"><span class="cellbar-value">${o(r)}</span><span class="cellbar-track" aria-hidden="true"><i style="width:${A(e).toFixed(1)}%${l}"></i></span></span>`,className:["barcell",t].filter(Boolean).join(" ")}}export function deltaCell(e){const r=M(e);return{html:o(F(e)),className:["numeric",r?`low-${r}`:""].filter(Boolean).join(" ")}}export function withSectionNav(e,r=""){const t=[];let a=0;const l=e.replace(/<section class="(report-section[^"]*)"(?: id="([^"]*)")?>(\s*<h2>)(.*?)(<\/h2>)/g,(p,i,n,d,m,s)=>{++a;const g=n??`sec-${r}${a}`;return t.push({id:g,title:m}),`<section class="${i}" id="${g}">${d}${m}${s}`});return t.length<4?e:`<nav class="report-toc" aria-label="Sections">${t.map(p=>`<a href="#${p.id}">${p.title}</a>`).join("")}</nav>
|
|
19
19
|
${l}`}export function formatFindingDelta(e){if(e.variable.kind==="spatialPattern")return"\u2014";const r=e.effect.absoluteDelta??0,t=r>0?"+":r<0?"\u2212":"";if(S(e))return`${t}${Math.abs(r*100).toFixed(1)} pp`;if(e.variable.kind==="test"){if(e.effect.relativeDelta!==void 0&&Number.isFinite(e.effect.relativeDelta)){const a=Math.abs(e.effect.relativeDelta*100).toFixed(1);return`${t}${a}%`}return`${t}${f(Math.abs(r),e.variable.unit)}`}return`${t}${f(Math.abs(r),e.variable.unit)}`}export function derivedFindingsKeyHtml(e){const r=_(e.map(t=>({label:t.variable.label,...R(t.variable)})));return r?`<p class="report-note">${o(r)}</p>`:""}export function findingAnchor(e,r=""){return`finding-${r}`+e.replace(/[^A-Za-z0-9]/g,t=>`_${t.charCodeAt(0).toString(16)}_`)}const B="Indented rows are the findings a pattern explains, most severe first. The other findings follow, grouped by region, most severe first.";export function findingsTableHtml(e,r,t,a=!1){const l=z(e),c=[...l.patterns.flatMap(n=>[{f:n.finding,nested:!1},...n.children.map(d=>({f:d,nested:!0}))]),...l.groups.flatMap(n=>n.findings.map(d=>({f:d,nested:!1})))],p=c.length?c.map(({f:n,nested:d})=>`<tr class="tier-${severityTier(n.severity)}${d?" nested":""}${a?" live":""}"${t!==void 0?` id="${findingAnchor(n.id,t)}"`:""}${a?` data-finding="${o(n.id)}"`:""} title="${o(y(n))}${a?`
|
|
20
20
|
Click to show it on the map`:""}">
|
|
21
21
|
<td class="tight">${renderSeverityMeter(n.severity)}</td>
|
|
@@ -37,17 +37,16 @@ Click to show it on the map`:""}">
|
|
|
37
37
|
<tbody>
|
|
38
38
|
${p}
|
|
39
39
|
</tbody>
|
|
40
|
-
</table>${l.patterns.length?`<p class="report-note">${o(B)}</p>`:""}${derivedFindingsKeyHtml(e)}`}export function synthesisSectionHtml(e,r){const t=(
|
|
41
|
-
<li class="tier-${a.impact}">${renderMeter(a.impact,N(a.impact))}<span>${o(a.text)}<span class="synthesis-see">See: ${
|
|
40
|
+
</table>${l.patterns.length?`<p class="report-note">${o(B)}</p>`:""}${derivedFindingsKeyHtml(e)}`}export function synthesisSectionHtml(e,r){const t=(s,g)=>{const u=r(g);return u?`<a href="#${o(u)}">${o(s)}</a>`:o(s)},[a,...l]=e.items,c=[...l,...e.also?.items??[]],p=e.also?.more??0,i=a?[t(a.subject,a.target),...a.chips.map(s=>t(s.label,s.target))]:[],n=a&&w(a);n&&i.push(o(n));const d=a?`<ol class="synthesis-items">
|
|
41
|
+
<li class="tier-${a.impact}">${renderMeter(a.impact,N(a.impact))}<span>${o(a.text)}<span class="synthesis-see">See: ${i.join(" \xB7 ")}</span></span></li>
|
|
42
42
|
</ol>`:`<p class="synthesis-none">${o(e.nothing??"Nothing stands out.")}</p>`,m=c.length?`<p class="synthesis-smaller">${o(v)}</p>
|
|
43
43
|
<ul class="synthesis-more">
|
|
44
|
-
${c.map(
|
|
44
|
+
${c.map(s=>`<li>${renderMeter(s.impact,I(s.impact))}<span>${t(s.brief,s.target)}</span><span class="synthesis-share">${o($(s))}</span></li>`).join(`
|
|
45
45
|
`)}${p?`
|
|
46
46
|
<li class="synthesis-rest"><span></span><span>and ${p} more</span><span></span></li>`:""}
|
|
47
47
|
</ul>`:"";return renderSection("What stands out",`<p class="synthesis-headline">${o(e.headline)}</p>
|
|
48
48
|
${d}
|
|
49
49
|
${m}
|
|
50
|
-
${e.watch?`<ul class="synthesis-watch">${e.watch.map(i=>`<li><strong>Watch</strong> ${t(i.text,i.target)}</li>`).join("")}</ul>`:""}
|
|
51
50
|
<p class="synthesis-checked">${o(e.checked)}</p>`,"synthesis")}const x=`<script>
|
|
52
51
|
(function () {
|
|
53
52
|
var embedded = location.href === 'about:srcdoc';
|
|
@@ -117,9 +116,9 @@ document.addEventListener('click', function (e) {
|
|
|
117
116
|
--report-tier-medium-edge: #a8741a;
|
|
118
117
|
--report-tier-low-bg: #edf2f7;
|
|
119
118
|
--report-tier-low-edge: #5f7f9f;
|
|
120
|
-
--report-low-1: ${
|
|
121
|
-
--report-low-2: ${
|
|
122
|
-
--report-low-3: ${
|
|
119
|
+
--report-low-1: ${b(1)};
|
|
120
|
+
--report-low-2: ${b(2)};
|
|
121
|
+
--report-low-3: ${b(3)};
|
|
123
122
|
--report-bar: #9db8d3;
|
|
124
123
|
}
|
|
125
124
|
|
|
@@ -187,9 +186,6 @@ document.addEventListener('click', function (e) {
|
|
|
187
186
|
.synthesis-more { list-style: none; margin: 0 0 8px; padding: 0; }
|
|
188
187
|
.synthesis-more li { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: baseline; margin: 0 0 3px; }
|
|
189
188
|
.synthesis-share { font-variant-numeric: tabular-nums; color: var(--report-muted); }
|
|
190
|
-
.synthesis-watch { list-style: none; margin: 0 0 6px; padding: 0; }
|
|
191
|
-
.synthesis-watch li { margin: 0 0 3px; }
|
|
192
|
-
.synthesis-watch strong { margin-right: 6px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--report-muted); }
|
|
193
189
|
.synthesis-checked, .synthesis-none { color: var(--report-muted); margin: 0; }
|
|
194
190
|
.synthesis a { color: var(--report-link); text-decoration: underline; text-underline-offset: 2px; }
|
|
195
191
|
.synthesis-see { display: block; margin-top: 4px; color: var(--report-muted); }
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type FacetCuration } from './facets.js';
|
|
1
2
|
import type { LotStatsSummary, StatsSeverity, StatsSummary } from './types.js';
|
|
3
|
+
import type { PlotSpec } from './plotSpec.js';
|
|
2
4
|
/**
|
|
3
5
|
* What an item shows when it is chosen: a finding (its dies, as the findings list shows them), or a test
|
|
4
6
|
* (its values, with the dies it fails). Every item and every Watch line has one, so a surface can make
|
|
@@ -20,19 +22,41 @@ export interface SynthesisChip {
|
|
|
20
22
|
kind: 'hardBin' | 'softBin';
|
|
21
23
|
bin: number;
|
|
22
24
|
};
|
|
25
|
+
/** Set for a test whose values shift on the item's dies: the chip shows that region on the test's map. */
|
|
26
|
+
shift?: true;
|
|
23
27
|
}
|
|
24
28
|
/** How much of the lot an item costs, in three steps. Drawn as a meter, never as colour alone. */
|
|
25
29
|
export type ImpactTier = 'high' | 'medium' | 'low';
|
|
26
30
|
export interface SynthesisItem {
|
|
27
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* `loss`: the item costs dies (a region's shortfall, a fail bin, an outlier wafer, a failing test). `signal`: it costs
|
|
33
|
+
* none of its own but moves the values (a test shifted in a region, a drift across the wafers, a spread too wide for
|
|
34
|
+
* its limits, dies out of limits yet binned as passing). Both are ranked by `affected`.
|
|
35
|
+
*/
|
|
36
|
+
kind: 'loss' | 'signal';
|
|
37
|
+
/** From the share of the lot the item affects, the same quantity the items are ranked by. */
|
|
28
38
|
impact: ImpactTier;
|
|
29
|
-
/**
|
|
39
|
+
/** `affected` as a fraction (0–1) of the analysed dies; set once the items are ranked. */
|
|
30
40
|
shareOfDies: number;
|
|
31
|
-
/** Estimated dies lost to this item (pass-rate shortfall × dies in the region). */
|
|
41
|
+
/** Estimated dies lost to this item (pass-rate shortfall × dies in the region). 0 for a signal. */
|
|
32
42
|
diesLost: number;
|
|
43
|
+
/**
|
|
44
|
+
* The dies the item affects, the quantity it is ranked by: a loss, the dies it cost; a shift, the dies it moved
|
|
45
|
+
* weighted by how far (in full from two standard deviations); a spread too wide for its limits, the dies it is
|
|
46
|
+
* expected to put outside them.
|
|
47
|
+
*/
|
|
48
|
+
affected: number;
|
|
49
|
+
/** The item's size as its compact row shows it: `2.4%` of the dies for a loss, `1.3σ` for a shift, `Ppk 0.62`. */
|
|
50
|
+
measure: string;
|
|
33
51
|
severity: StatsSeverity;
|
|
34
52
|
/** The item as a sentence. Plain text: what the item shows is `target`, and its parts are `chips`. */
|
|
35
53
|
text: string;
|
|
54
|
+
/**
|
|
55
|
+
* The item in one short sentence, for a card that has a chart to say the rest: its own figure (a region's shortfall
|
|
56
|
+
* and the dies it cost, a test's failures, a shift's size), without the bins, regions and tests `text` goes on to
|
|
57
|
+
* name. Plain text.
|
|
58
|
+
*/
|
|
59
|
+
reason: string;
|
|
36
60
|
/** The item in a few words, for the compact list: `Ring 2: hard bin 4 (Short), 62 dies`. */
|
|
37
61
|
brief: string;
|
|
38
62
|
/** What `target` is, as a reader names it: `Ring 4 (edge)`, `W06`, `IP3_DBM`. */
|
|
@@ -47,16 +71,12 @@ export interface SynthesisItem {
|
|
|
47
71
|
findingIds: string[];
|
|
48
72
|
/** Tests the item names: its own test, or tests whose failing dies lie mostly on its dies. */
|
|
49
73
|
testNumbers: number[];
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export interface SynthesisWatch {
|
|
57
|
-
text: string;
|
|
58
|
-
target: SynthesisTarget;
|
|
59
|
-
findingIds: string[];
|
|
74
|
+
/**
|
|
75
|
+
* The chart that shows the item, as a plot of the lot (Insights' Worth a look card): a region's loss as yield by that
|
|
76
|
+
* kind of region, a fail bin as the bins' shares by it, a shift as the test by it, a failing or too-wide test as its
|
|
77
|
+
* histogram, a trend as a control chart, an outlier wafer as yield by wafer. Its title is the plot's own.
|
|
78
|
+
*/
|
|
79
|
+
chart: Omit<PlotSpec, 'id'>;
|
|
60
80
|
}
|
|
61
81
|
export interface Synthesis {
|
|
62
82
|
headline: string;
|
|
@@ -70,8 +90,6 @@ export interface Synthesis {
|
|
|
70
90
|
items: SynthesisItem[];
|
|
71
91
|
more: number;
|
|
72
92
|
};
|
|
73
|
-
/** At most two things to keep an eye on, after the items. Absent when there are none. */
|
|
74
|
-
watch?: SynthesisWatch[];
|
|
75
93
|
/** Said instead of the items when none is material, so a good lot reads as one rather than as an empty list. */
|
|
76
94
|
nothing?: string;
|
|
77
95
|
/** What was compared and not repeated above. Required: a short synthesis must not read as "not analysed". */
|
|
@@ -84,6 +102,11 @@ export interface SynthesisContext {
|
|
|
84
102
|
* yield and does not call any bin a failure, rather than assume `[1]`.
|
|
85
103
|
*/
|
|
86
104
|
passBins?: readonly number[];
|
|
105
|
+
/**
|
|
106
|
+
* The host's wafer attributes (`attributes` on the render options), over the defaults: which wafer fields' groups are
|
|
107
|
+
* compared (those Group by offers) and what each is called. Omitted ⇒ the defaults.
|
|
108
|
+
*/
|
|
109
|
+
attributes?: Record<string, FacetCuration>;
|
|
87
110
|
}
|
|
88
111
|
/**
|
|
89
112
|
* The summary a synthesis is written from. A lot of one wafer is that wafer: the lot's own findings need
|
|
@@ -96,9 +119,14 @@ export declare function synthesisSource(summary: StatsSummary | LotStatsSummary)
|
|
|
96
119
|
* lost, and a line saying what was compared.
|
|
97
120
|
*/
|
|
98
121
|
export declare function buildSynthesis(input: StatsSummary | LotStatsSummary, ctx?: SynthesisContext): Synthesis;
|
|
122
|
+
/**
|
|
123
|
+
* A stable key for an item: what it shows, the same in the panel and in Insights, so a row's Chart link finds the item's
|
|
124
|
+
* card and a card's Show on map finds its row.
|
|
125
|
+
*/
|
|
126
|
+
export declare const synthesisKey: (it: Pick<SynthesisItem, "target">) => string;
|
|
99
127
|
/** The heading over the compact list of further items: the floor is the same one that admits an item at all. */
|
|
100
128
|
export declare const SYNTHESIS_ALSO_HEADING: string;
|
|
101
|
-
/** A compact-list row: the item in a few words, then its
|
|
129
|
+
/** A compact-list row: the item in a few words, then its size (`2.4%` of the dies, `1.3σ`, `Ppk 0.62`). Plain text. */
|
|
102
130
|
export declare const synthesisRowShare: (it: SynthesisItem) => string;
|
|
103
131
|
/** After an item's chips: the folded tests not shown as one. Undefined when every test is a chip. Plain text. */
|
|
104
132
|
export declare const synthesisMoreTests: (it: SynthesisItem) => string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{maxOf as ee,minOf as te}from"../core/utils.js";import{isPassBin as se,passBinsLabel as ie}from"../core/passBins.js";import{DRIFT_MIN_WAFERS as ne}from"./lotDrift.js";import{plainBinTerms as oe}from"../renderer/fmt.js";const ae=2,j=1,Y=3,q=5,B=.01,re=.02,le=.04,de=.15,ce=.4,fe=.5,he=.1,ue=2,pe=new Set(["ring","quadrant","sector","reticle-position","test-site","cluster","edge-arc"]);function ge(e){const i=e.highlight;return"dieKeysByWafer"in i&&i.dieKeysByWafer?Object.values(i.dieKeysByWafer).reduce((s,n)=>s+n.length,0):"dieKeys"in i&&i.dieKeys&&i.dieKeys.length>0?i.dieKeys.length:e.level==="lot"?void 0:e.stats.sampleSizeLeft}function X(e){const i=e.highlight,s=new Set;if("dieKeysByWafer"in i&&i.dieKeysByWafer)for(const[n,d]of Object.entries(i.dieKeysByWafer))for(const t of d)s.add(`${n}:${t}`);else if("dieKeys"in i&&i.dieKeys)for(const n of i.dieKeys)s.add(n);return s}const $=e=>Math.abs(e.effect.absoluteDelta??0),_=e=>$(e)*(ge(e)??0),v=e=>(e*100).toFixed(1),x=e=>{const i=e.variable.label.replace(/ \(same dies\)$/,"").replace(/^HBin and SBin (\d+)/,"HBin $1").replace(/^(HBin \d+(?: \([^)]*\))?) and SBin .*$/,"$1");return oe(i)},p=e=>Math.round(e).toLocaleString("en-GB"),k=(e,i,s=`${i}s`)=>`${p(e)} ${e===1?i:s}`;function E(e){const i=e.comparison.left;return e.comparison.family==="quadrant"&&!/quadrant/i.test(i)?`${i} quadrant`:i}function $e(e){const i=e.map((t,r)=>r),s=t=>i[t]===t?t:i[t]=s(i[t]),n=e.map(X);for(let t=0;t<e.length;t++)for(let r=t+1;r<e.length;r++){const a=n[t].size<=n[r].size?n[t]:n[r],l=a===n[t]?n[r]:n[t];if(a.size===0)continue;let c=0;for(const h of a)l.has(h)&&c++;c>=fe*a.size&&(i[s(t)]=s(r))}const d=new Map;return e.forEach((t,r)=>{const a=s(r);(d.get(a)??d.set(a,[]).get(a)).push(r)}),[...d.values()]}const G=e=>e.variable.kind==="hardBin"||e.variable.kind==="softBin",R=(e,i)=>e.level===i.level&&e.comparison.family===i.comparison.family&&e.comparison.left===i.comparison.left;function me(e,i,s){const n=t=>i.filter(r=>r.variable.kind===t&&R(r,e)&&r.effect.direction==="higher"&&s(r));return(n("hardBin").length>0?n("hardBin"):n("softBin")).filter(t=>t!==e).sort((t,r)=>$(r)-$(t))}const we={ring:"rings",quadrant:"quadrants",sector:"sectors","edge-arc":"edge arcs",cluster:"clusters","reticle-position":"reticle positions","test-site":"test sites"},be=2;function ye(e){const i=new Map;for(const n of e){const d=n.comparison.family;(i.get(d)??i.set(d,new Set).get(d)).add(E(n))}const s=[];for(const[n,d]of i)d.size<=be?s.push(...d):s.push(`${d.size} ${we[n]??n}`);return s.join(", ")}const Se=e=>e.charAt(0).toUpperCase()+e.slice(1),F=e=>({kind:"finding",id:e.id}),Ie=e=>({label:Se(x(e)),target:F(e),...e.variable.bin!==void 0&&(e.variable.kind==="hardBin"||e.variable.kind==="softBin")?{bin:{kind:e.variable.kind,bin:e.variable.bin}}:{}});function ve(e,i,s,n){const d=[...e].sort((f,w)=>_(w)-_(f))[0],t=e.find(f=>n.isPassRate(f)&&R(f,d))??d,r=e.filter(f=>f!==t),a=t.level==="lot"&&"waferIndices"in t.highlight?t.highlight.waferIndices?.length:void 0,l=a!==void 0&&s?` on ${a}/${s} wafers`:"",c=!n.isPassRate(t),h=t.comparison.family==="sector"?"the other sectors":"the rest of the wafer";let y=c?`${E(t)}: ${x(t)} ${v($(t))} points higher than ${h}${l}`:`${E(t)}: pass rate ${v($(t))} points below ${h}${l}`;const g=me(t,i,n.isFailBin).map(f=>({f,share:$(f)/($(t)||1)})).filter(f=>c||f.share>=he).slice(0,ue);if(c)for(const{f}of g)y+=`, ${x(f)} ${v($(f))} points higher`;else if(g.length>0){const f=g.reduce((S,D)=>S+D.share,0)<=1.000000001,w=f&&g[0].share>.5?"mostly ":"";g.forEach(({f:S},D)=>{y+=D===0?`; ${f?w:""}`:", ",y+=x(S)+(D===0?f?` accounts for ${v($(S))} of those points`:` is ${v($(S))} points higher`:f?` for ${v($(S))}`:` ${v($(S))} points higher`)})}y+=` \u2014 about ${p(_(t))} dies lost`;const u=r.filter(f=>!R(f,t));u.length>0&&(y+=` (also seen as ${ye(u)})`);const m=c?x(t):"pass rate";return{impact:"low",shareOfDies:0,diesLost:_(t),severity:t.severity,text:y,brief:`${E(t)}: ${m}, ${p(_(t))} dies`,subject:E(t),target:F(t),chips:[...c?[t]:[],...g.map(({f})=>f)].map(Ie),findingIds:[t.id,...r.map(f=>f.id)],testNumbers:[]}}function ke(e,i){return e>=le||i>=ce?"high":e>=re||i>=de?"medium":"low"}function De(e){const i=s=>s.stats.yieldPercent==null?0:s.stats.analyzedDies*(1-s.stats.yieldPercent/100);return e.level==="wafer"?i(e):e.perWafer.reduce((s,n)=>s+i(n.summary),0)}function Be(e){return e.level==="wafer"?e.stats.analyzedDies:e.perWafer.reduce((i,s)=>i+s.summary.stats.analyzedDies,0)}const U=e=>e.id.startsWith("inter-wafer:yield:");function _e(e){const i=[];for(const s of e.findings){if(!U(s)||s.effect.direction!=="lower")continue;const n="waferIndices"in s.highlight?s.highlight.waferIndices?.[0]:void 0,d=n===void 0?void 0:e.perWafer.find(t=>t.waferIndex===n)?.summary.stats.analyzedDies;d!==void 0&&i.push({impact:"low",shareOfDies:0,diesLost:$(s)*d,severity:s.severity,text:`${s.summary.replace(/ percentage points lower than the lot median$/," points below the lot median")} \u2014 about ${p($(s)*d)} dies lost`,brief:`${s.comparison.left}: yield, ${p($(s)*d)} dies`,subject:s.comparison.left,target:F(s),chips:[],findingIds:[s.id],testNumbers:[]})}return i}function Me(e,i){if(e.level==="wafer"){const t=e.stats.testFailures?.[i];return t?{keys:new Set(t.dieKeys),lost:t.lostDies}:void 0}const s=new Set;let n=0,d=!1;for(const t of e.perWafer){const r=t.summary.stats.testFailures?.[i];if(r){d=!0,n+=r.lostDies;for(const a of r.dieKeys)s.add(`${t.waferIndex}:${a}`)}}return d?{keys:s,lost:n}:void 0}function Ae(e,i){const s=e.stats,n=[],d=(t,r,a,l,c,h,y=c)=>{if(a<=0||l<=0)return;i.add(t);const g=Me(e,t),u=g?Math.min(g.lost,a):a,m=a-u,f=a/l*100;n.push({testNumber:t,label:r,verb:c,plainVerb:y,failDies:a,passingDies:m,keys:g?.keys,item:{impact:"low",shareOfDies:0,diesLost:u,severity:"info",text:`${r} ${c} on ${p(a)} of ${p(l)} dies (${f.toFixed(1)}%)`+(m>0?`; ${p(m)} of them are binned as passing, so about ${p(u)} dies lost`:""),brief:m>0?`${r}: ${h}, ${p(u)} dies lost`:`${r}: ${p(a)} dies ${h}`,subject:r,target:{kind:"test",testNumber:t},chips:[],findingIds:[],testNumbers:[t]}})};for(const t of s.testSpecYield??[]){const r=t.failHighDies===0?"is below its low limit":t.failLowDies===0?"is above its high limit":`is outside its limits (${p(t.failLowDies)} low, ${p(t.failHighDies)} high)`;d(t.testNumber,t.label,t.failLowDies+t.failHighDies,t.totalDies,r,"outside limits",t.failLowDies>0&&t.failHighDies>0?"is outside its limits":r)}for(const t of s.functionalYield??[])d(t.testNumber,t.label,t.failDies,t.totalDies,"fails","fail");return n}const Le=.5,xe=2,Ee=2,Fe=5;function He(e,i,s,n){const d=new Set,t=new Map,r=new Map,a=[...e].sort((l,c)=>c.failDies-l.failDies||l.testNumber-c.testNumber);for(const l of a){const c=l.keys;if(n>0&&l.failDies/n<B){d.add(l);continue}let h;if(c&&c.size>0&&n>0)for(const u of i){const m=s.get(u);if(!m||m.size===0)continue;let f=0;for(const S of c)m.has(S)&&f++;const w=f/c.size;w>=Le&&w>=xe*(m.size/n)&&(!h||f>h.inside)&&(h={item:u,inside:f})}if(!h){d.add(l);continue}const y=t.get(h.item)??0;if(y<Ee){const u=h.inside===l.failDies?"all":p(h.inside);h.item.text+=`. ${l.label} ${l.verb} on ${k(l.failDies,"die")}, ${u} of them in ${h.item.subject}`,t.set(h.item,y+1)}const g=r.get(h.item)??0;g<Fe?(h.item.chips.push({label:l.label,target:l.item.target}),r.set(h.item,g+1)):h.item.moreTests=(h.item.moreTests??0)+1,h.item.testNumbers.push(l.testNumber)}return e.filter(l=>d.has(l))}function Ne(e,i,s){const n=[],d={unusual:0,notable:1,info:2},t=e.findings.filter(a=>a.id.startsWith("drift:")).sort((a,l)=>d[a.severity]-d[l.severity]||(a.stats.adjustedPValue??1)-(l.stats.adjustedPValue??1));for(const a of t)n.push({text:a.summary,target:F(a),findingIds:[a.id]});for(const a of[...s].sort((l,c)=>c.passingDies-l.passingDies))n.push({text:`${a.label} ${a.plainVerb} on ${p(a.passingDies)} dies binned as passing`,target:a.item.target,findingIds:[]});const r=(e.stats.capability??[]).filter(a=>a.hasSpec&&a.ppk!==null&&a.ppk!==void 0&&a.ppk<j&&!i.has(a.testNumber)).sort((a,l)=>(a.ppk??0)-(l.ppk??0));for(const a of r)n.push({text:`${a.label} has Ppk ${a.ppk.toFixed(2)} against its limits (below ${j.toFixed(1)})`,target:{kind:"test",testNumber:a.testNumber},findingIds:[]});return n.slice(0,ae)}function Te(e,i){const s=i.passBins&&i.passBins.length>0?`; pass ${ie([i.passBins])}`:"";if(e.level==="wafer"){const c=e.stats.yieldPercent;return c==null?`${p(e.stats.totalDies)} dies, no bin data to judge yield by.`:`Yield ${c.toFixed(1)}% (${p(e.stats.totalDies)} dies${s}).`}const n=e.lotYieldSeries.map(c=>c.yieldPercent).filter(c=>typeof c=="number");if(n.length===0)return`${k(e.stats.waferCount,"wafer")}, no bin data to judge yield by.`;const d=n.reduce((c,h)=>c+h,0)/n.length,t=e.perWafer.reduce((c,h)=>c+h.summary.stats.totalDies,0),[r,a]=[te(n).toFixed(1),ee(n).toFixed(1)],l=r!==a?`, range ${r}\u2013${a}%`:"";return`Yield ${d.toFixed(1)}% (mean of ${k(n.length,"wafer")}, ${p(t)} dies${s})${l}.`}function We(e,i){const s=[],n=e.level==="wafer"?e.stats.testsConsidered.length:new Set(e.perWafer.flatMap(l=>l.summary.stats.testsConsidered)).size,d=e.level==="wafer"?e.stats.hardBinsConsidered.length:new Set(e.perWafer.flatMap(l=>l.summary.stats.hardBinsConsidered)).size,t=e.stats.testValueAnalysis?.state;if(n>0&&t!=="off"&&s.push(k(n,"test")+(t==="skipped"?" (against their limits only)":"")),d>0&&s.push(k(d,"hard bin")),s.push("the ring, quadrant and sector regions"),e.level==="lot"&&e.stats.waferCount>=3){const l=e.findings.filter(U);s.push(l.length===0?"wafer-to-wafer yield (no outlier wafers)":`wafer-to-wafer yield (${k(l.length,"outlier wafer")})`),e.stats.waferCount>=ne&&s.push("the yield trend across the wafers (input order)")}const r=e.findings.filter(l=>!i.has(l.id)).length,a=r>0?` ${k(r,"smaller finding")} not listed above.`:" Nothing else was found.";return`Compared: ${s.join(", ")}.${a}`}export function synthesisSource(e){return e.level==="lot"&&e.perWafer.length===1?e.perWafer[0].summary:e}export function buildSynthesis(e,i={}){const s=synthesisSource(e),n=s.findings,d=s.level==="lot"?s.stats.waferCount:void 0,t=i.passBins,r=new Map(n.map(o=>[o.id,o])),a=(s.level==="wafer"?[s]:s.perWafer.map(o=>o.summary)).every(o=>(o.stats.hardBinsConsidered??[]).length===0),l=o=>t!==void 0&&G(o)&&se(o.variable.kind,o.variable.bin??NaN,t,!a),c={isPassRate:o=>o.variable.kind==="yield"||t?.length===1&&l(o),isFailBin:o=>t!==void 0&&G(o)&&!l(o)},h=n.filter(o=>pe.has(o.comparison.family)&&_(o)>0&&(c.isPassRate(o)&&o.effect.direction==="lower"||c.isFailBin(o)&&o.effect.direction==="higher")),g=h.some(o=>o.variable.kind==="hardBin")?h.filter(o=>o.variable.kind!=="softBin"):h,u=[],m=new Map,f=new Set;for(const o of $e(g)){const b=o.map(A=>g[A]),I=ve(b,n,d,c);u.push(I);const T=I.target.kind==="finding"?I.target.id:void 0;m.set(I,X(b.find(A=>A.id===T)??b[0]))}for(const o of n.filter(b=>b.variable.kind==="spatialPattern")){const b=new Set((o.relatedIds??[]).filter(L=>r.has(L))),I=u.find(L=>L.findingIds.some(Z=>b.has(Z)));if(!I)continue;const T=o.level==="lot"&&"waferIndices"in o.highlight?o.highlight.waferIndices?.length:void 0,A=T!==void 0&&d?` on ${T}/${d} wafers`:"";I.text=`${o.variable.label} pattern${A}. ${I.text}`,I.chips.unshift({label:`${o.variable.label} pattern`,target:F(o)}),I.findingIds.unshift(o.id,...[...b].filter(L=>!I.findingIds.includes(L)))}const w=Be(s),S=new Set,D=Ae(s,S),V=He(D,[...u],m,w);s.level==="lot"&&u.push(..._e(s)),u.push(...V.map(o=>o.item));const P=De(s),H=u.filter(o=>w>0&&o.diesLost/w>=B);for(const o of H)o.shareOfDies=o.diesLost/w,o.impact=ke(o.diesLost/w,P>0?o.diesLost/P:0);H.sort((o,b)=>b.diesLost-o.diesLost);const M=H.slice(0,Y),N=H.slice(Y);for(const o of[...M,...N])for(const b of o.findingIds)f.add(b);const z=N.length>0?{items:N.slice(0,q),more:Math.max(0,N.length-q)}:void 0,J=M[0]?.target.kind==="test"?M[0].target.testNumber:void 0,Q=D.filter(o=>o.testNumber!==J&&w>0&&o.passingDies/w>=B),W=Ne(s,S,Q);for(const o of W)for(const b of o.findingIds)f.add(b);const K=s.level==="lot"?"region, fail bin or wafer":"region or fail bin",O=n.filter(o=>o.severity==="unusual"&&!f.has(o.id)).length,C=M.length===0?O>0?`No ${K} costs as much as ${v(B)} yield points, though ${k(O,"finding")} below ${O===1?"is":"are"} marked unusual.`:`Nothing stands out: no ${K} costs as much as ${v(B)} yield points.`:void 0;return{headline:Te(s,i),items:M,...z?{also:z}:{},...W.length?{watch:W}:{},...C?{nothing:C}:{},checked:We(s,f)}}export const SYNTHESIS_ALSO_HEADING=`Also, each costing at least ${(B*100).toFixed(0)}% of the dies`,synthesisRowShare=e=>`${(e.shareOfDies*100).toFixed(1)}%`,synthesisMoreTests=e=>e.moreTests?`and ${e.moreTests} more test${e.moreTests===1?"":"s"}`:void 0;export function synthesisText(e){return[e.headline,...e.nothing?[e.nothing]:[],...e.items.map((i,s)=>`${s+1}. ${i.text}`),...e.also?[`${SYNTHESIS_ALSO_HEADING}: ${e.also.items.map(i=>`${i.brief} (${synthesisRowShare(i)})`).join("; ")}${e.also.more?`; and ${e.also.more} more`:""}.`]:[],...e.watch?e.watch.map(i=>`Watch: ${i.text}`):[],e.checked].join(`
|
|
1
|
+
import{maxOf as me,minOf as ge}from"../core/utils.js";import{isPassBin as be,passBinsLabel as $e}from"../core/passBins.js";import{DRIFT_MIN_WAFERS as we}from"./lotDrift.js";import{isOneBinCluster as ye}from"./filterFindings.js";import{plainBinTerms as ve}from"../renderer/fmt.js";import{benjaminiHochberg as Se,normalUpperTail as Ne}from"./math.js";import{compareGroups as Ie,formatP as re}from"./groupCompare.js";import{attributeLabel as oe,buildFacetTable as ke,facetValueOf as xe}from"./facets.js";const Me=1,De=2,Be=.5,le=3,fe=5,K=.01,_e=.02,Fe=.04,Le=.15,Oe=.4,X=.5,ze=.1,Ae=2,ce=new Set(["ring","quadrant","sector","reticle-position","test-site","cluster","edge-arc"]);function Z(e){const t=e.highlight;return"dieKeysByWafer"in t&&t.dieKeysByWafer?Object.values(t.dieKeysByWafer).reduce((s,i)=>s+i.length,0):"dieKeys"in t&&t.dieKeys&&t.dieKeys.length>0?t.dieKeys.length:e.level==="lot"?void 0:e.stats.sampleSizeLeft}function ee(e){const t=e.highlight,s=new Set;if("dieKeysByWafer"in t&&t.dieKeysByWafer)for(const[i,d]of Object.entries(t.dieKeysByWafer))for(const c of d)s.add(`${i}:${c}`);else if("dieKeys"in t&&t.dieKeys)for(const i of t.dieKeys)s.add(i);return s}const D=e=>Math.abs(e.effect.absoluteDelta??0),E=e=>D(e)*(Z(e)??0),A=e=>(e*100).toFixed(1),G=e=>{const t=e.variable.label.replace(/ \(same dies\)$/,"").replace(/^HBin and SBin (\d+)/,"HBin $1").replace(/^(HBin \d+(?: \([^)]*\))?) and SBin .*$/,"$1");return ve(t)},S=e=>Math.round(e).toLocaleString("en-GB"),T=(e,t,s=`${t}s`)=>`${S(e)} ${e===1?t:s}`;function C(e){const t=e.comparison.left;return e.comparison.family==="quadrant"&&!/quadrant/i.test(t)?`${t} quadrant`:t}const de=ye;function Te(e){const t=e.map((f,n)=>n),s=f=>t[f]===f?f:t[f]=s(t[f]),i=e.map(ee),d=(f,n)=>{const u=i[f].size<=i[n].size?i[f]:i[n],b=u===i[f]?i[n]:i[f];let p=0;for(const m of u)b.has(m)&&p++;return p},c=e.map((f,n)=>n).filter(f=>de(e[f])),r=e.map((f,n)=>n).filter(f=>!de(e[f]));for(let f=0;f<r.length;f++)for(let n=f+1;n<r.length;n++){const u=Math.min(i[r[f]].size,i[r[n]].size);u>0&&d(r[f],r[n])>=X*u&&(t[s(r[f])]=s(r[n]))}for(const f of c){let n=-1,u=0;for(const b of r){if(te(e[b])&&e[b].variable.bin!==e[f].variable.bin)continue;const p=d(f,b);p>u&&p>=X*i[f].size&&p>=X*E(e[b])&&(n=b,u=p)}n>=0&&(t[f]=s(n))}const h=new Map;return e.forEach((f,n)=>{const u=s(n);(h.get(u)??h.set(u,[]).get(u)).push(n)}),[...h.values()]}const te=e=>e.variable.kind==="hardBin"||e.variable.kind==="softBin",se=(e,t)=>e.level===t.level&&e.comparison.family===t.comparison.family&&e.comparison.left===t.comparison.left;function Ee(e,t,s){const i=c=>t.filter(r=>r.variable.kind===c&&se(r,e)&&r.effect.direction==="higher"&&s(r));return(i("hardBin").length>0?i("hardBin"):i("softBin")).filter(c=>c!==e).sort((c,r)=>D(r)-D(c))}const We={ring:"rings",quadrant:"quadrants",sector:"sectors","edge-arc":"edge arcs",cluster:"clusters","reticle-position":"reticle positions","test-site":"test sites"},He=2;function ue(e){const t=new Map;for(const i of e){const d=i.comparison.family;(t.get(d)??t.set(d,new Set).get(d)).add(C(i))}const s=[];for(const[i,d]of t)d.size<=He?s.push(...d):s.push(`${d.size} ${We[i]??i}`);return s.join(", ")}const Re=e=>e.charAt(0).toUpperCase()+e.slice(1),P=e=>({kind:"finding",id:e.id}),je=e=>({label:Re(G(e)),target:P(e),...e.variable.bin!==void 0&&(e.variable.kind==="hardBin"||e.variable.kind==="softBin")?{bin:{kind:e.variable.kind,bin:e.variable.bin}}:{}});function ie(e){const t=e.comparison.family;return{builtin:t==="quadrant"||t==="sector"?"quadrant":t==="reticle-position"?"reticleCell":t==="test-site"?"site":"ring"}}const ne=(e,t)=>({chart:"bar",fields:{x:e,y:t,color:{none:!0}},valueLabels:!0,axes:{y:{references:[{stat:"median"}]}}}),V=e=>({test:e}),he=(e,t=!1)=>({chart:"histogram",fields:{y:V(e),color:{none:!0}},...t?{normalCurve:!0}:{}});function Ce(e,t,s,i){const d=[...e].sort((l,g)=>E(g)-E(l))[0],c=e.find(l=>i.isPassRate(l)&&se(l,d))??d,r=e.filter(l=>l!==c),h=c.level==="lot"&&"waferIndices"in c.highlight?c.highlight.waferIndices?.length:void 0,f=h!==void 0&&s?` on ${h}/${s} wafers`:"",n=!i.isPassRate(c),u=c.comparison.family==="sector"?"the other sectors":"the rest of the wafer";let b=n?`${C(c)}: ${G(c)} ${A(D(c))} points higher than ${u}${f}`:`${C(c)}: pass rate ${A(D(c))} points below ${u}${f}`;const p=`${b} \u2014 about ${S(E(c))} dies lost`,m=Ee(c,t,i.isFailBin).map(l=>({f:l,share:D(l)/(D(c)||1)})).filter(l=>n||l.share>=ze).slice(0,Ae);if(n)for(const{f:l}of m)b+=`, ${G(l)} ${A(D(l))} points higher`;else if(m.length>0){const l=m.reduce((N,v)=>N+v.share,0)<=1.000000001,g=l&&m[0].share>.5?"mostly ":"";m.forEach(({f:N},v)=>{b+=v===0?`; ${l?g:""}`:", ",b+=G(N)+(v===0?l?` accounts for ${A(D(N))} of those points`:` is ${A(D(N))} points higher`:l?` for ${A(D(N))}`:` ${A(D(N))} points higher`)})}b+=` \u2014 about ${S(E(c))} dies lost`;const x=r.filter(l=>!se(l,c));x.length>0&&(b+=` (also seen as ${ue(x)})`);const o=n?G(c):"pass rate";return{kind:"loss",impact:"low",shareOfDies:0,diesLost:E(c),affected:E(c),measure:"",severity:c.severity,text:b,reason:p,brief:`${C(c)}: ${o}, ${S(E(c))} dies`,subject:C(c),target:P(c),chips:[...n?[c]:[],...m.map(({f:l})=>l)].map(je),findingIds:[c.id,...r.map(l=>l.id)],testNumbers:[],chart:n?{chart:"bar",fields:{x:ie(c),color:{builtin:c.variable.kind==="softBin"?"sbin":"hbin"}},stack:"percent"}:ne(ie(c),{builtin:"yield"})}}function Pe(e,t){return e>=Fe||t>=Oe?"high":e>=_e||t>=Le?"medium":"low"}function Ke(e){const t=s=>s.stats.yieldPercent==null?0:s.stats.analyzedDies*(1-s.stats.yieldPercent/100);return e.level==="wafer"?t(e):e.perWafer.reduce((s,i)=>s+t(i.summary),0)}function qe(e){return e.level==="wafer"?e.stats.analyzedDies:e.perWafer.reduce((t,s)=>t+s.summary.stats.analyzedDies,0)}const pe=e=>e.id.startsWith("inter-wafer:yield:");function Ge(e){const t=[];for(const s of e.findings){if(!pe(s)||s.effect.direction!=="lower")continue;const i="waferIndices"in s.highlight?s.highlight.waferIndices?.[0]:void 0,d=i===void 0?void 0:e.perWafer.find(c=>c.waferIndex===i)?.summary.stats.analyzedDies;d!==void 0&&t.push({kind:"loss",impact:"low",shareOfDies:0,diesLost:D(s)*d,affected:D(s)*d,measure:"",severity:s.severity,text:`${s.summary.replace(/ percentage points lower than the lot median$/," points below the lot median")} \u2014 about ${S(D(s)*d)} dies lost`,reason:`${s.summary.replace(/ percentage points lower than the lot median$/," points below the lot median")} \u2014 about ${S(D(s)*d)} dies lost`,brief:`${s.comparison.left}: yield, ${S(D(s)*d)} dies`,subject:s.comparison.left,target:P(s),chips:[],findingIds:[s.id],testNumbers:[],chart:ne({builtin:"wafer"},{builtin:"yield"})})}return t}function Ye(e,t){if(e.level==="wafer"){const c=e.stats.testFailures?.[t];return c?{keys:new Set(c.dieKeys),lost:c.lostDies}:void 0}const s=new Set;let i=0,d=!1;for(const c of e.perWafer){const r=c.summary.stats.testFailures?.[t];if(r){d=!0,i+=r.lostDies;for(const h of r.dieKeys)s.add(`${c.waferIndex}:${h}`)}}return d?{keys:s,lost:i}:void 0}function Ue(e,t){const s=e.stats,i=[],d=r=>ne({builtin:e.level==="lot"?"wafer":"ring"},{passRate:r}),c=(r,h,f,n,u,b,p=u,m=!1)=>{if(f<=0||n<=0)return;t.add(r);const x=Ye(e,r),o=x?Math.min(x.lost,f):f,l=f-o,g=f/n*100;i.push({testNumber:r,label:h,verb:u,plainVerb:p,failDies:f,passingDies:l,keys:x?.keys,item:{kind:"loss",impact:"low",shareOfDies:0,diesLost:o,affected:o,measure:"",severity:"info",text:`${h} ${u} on ${S(f)} of ${S(n)} dies (${g.toFixed(1)}%)`+(l>0?`; ${S(l)} of them are binned as passing, so about ${S(o)} dies lost`:""),reason:`${h} ${u} on ${S(f)} of ${S(n)} dies (${g.toFixed(1)}%)`,brief:l>0?`${h}: ${b}, ${S(o)} dies lost`:`${h}: ${S(f)} dies ${b}`,subject:h,target:{kind:"test",testNumber:r},chips:[],findingIds:[],testNumbers:[r],chart:m?d(r):he(r)}})};for(const r of s.testSpecYield??[]){const h=r.failHighDies===0?"is below its low limit":r.failLowDies===0?"is above its high limit":`is outside its limits (${S(r.failLowDies)} low, ${S(r.failHighDies)} high)`;c(r.testNumber,r.label,r.failLowDies+r.failHighDies,r.totalDies,h,"outside limits",r.failLowDies>0&&r.failHighDies>0?"is outside its limits":h)}for(const r of s.functionalYield??[])c(r.testNumber,r.label,r.failDies,r.totalDies,"fails","fail","fails",!0);return i}const Xe=.5,Ve=2,Je=2,Y=5;function Qe(e,t,s,i){const d=new Set,c=new Map,r=new Map,h=[...e].sort((f,n)=>n.failDies-f.failDies||f.testNumber-n.testNumber);for(const f of h){const n=f.keys;if(i>0&&f.failDies/i<K){d.add(f);continue}let u;if(n&&n.size>0&&i>0)for(const m of t){const x=s.get(m);if(!x||x.size===0)continue;let o=0;for(const g of n)x.has(g)&&o++;const l=o/n.size;l>=Xe&&l>=Ve*(x.size/i)&&(!u||o>u.inside)&&(u={item:m,inside:o})}if(!u){d.add(f);continue}const b=c.get(u.item)??0;if(b<Je){const m=u.inside===f.failDies?"all":S(u.inside);u.item.text+=`. ${f.label} ${f.verb} on ${T(f.failDies,"die")}, ${m} of them in ${u.item.subject}`,c.set(u.item,b+1)}const p=r.get(u.item)??0;p<Y?(u.item.chips.push({label:f.label,target:f.item.target}),r.set(u.item,p+1)):u.item.moreTests=(u.item.moreTests??0)+1,u.item.testNumbers.push(f.testNumber)}return e.filter(f=>d.has(f))}function U(e){return{kind:"signal",impact:"low",shareOfDies:0,diesLost:0,affected:e.affected,measure:e.measure,severity:e.severity,text:e.text,reason:e.reason??e.text,brief:e.brief,subject:e.subject,target:e.target,chips:[],findingIds:e.findingIds??[],testNumbers:e.testNumbers??[],chart:e.chart}}const ae=e=>Math.abs(e)<Be?0:Math.min(1,(Math.abs(e)/De)**2),H=e=>`${Math.abs(e).toFixed(1)}\u03C3`,Ze=e=>e.variable.kind==="test"&&e.variable.measure!=="limitFailRate"&&ce.has(e.comparison.family)&&Number.isFinite(e.effect.effectSize??NaN)&&!e.id.startsWith("drift:");function et(e,t,s){const i=new Map;for(const r of e)!Ze(r)||r.variable.index===void 0||(i.get(r.variable.index)??i.set(r.variable.index,[]).get(r.variable.index)).push(r);const d=r=>(Z(r)??r.stats.sampleSizeLeft)*ae(r.effect.effectSize??0),c=[];for(const[r,h]of[...i].sort((f,n)=>f[0]-n[0])){const f=[...h].sort((o,l)=>d(l)-d(o)),n=f[0],u=n.effect.effectSize??0;if(d(n)===0)continue;const b=ee(n);let p=t.find(o=>o.target.kind==="test"&&o.target.testNumber===r)??t.find(o=>o.testNumbers.includes(r))??t.find(o=>f.some(l=>o.findingIds.includes(l.id))),m=0;for(const o of p?[]:t){const l=s.get(o);if(!l||l.size===0||b.size===0)continue;let g=0;for(const N of b)l.has(N)&&g++;g>=X*Math.min(l.size,b.size)&&g>m&&(m=g,p=o)}if(p){p.text+=`. ${n.summary}`,p.testNumbers.includes(r)||(p.chips.filter(l=>l.target.kind==="test"||l.shift).length<Y?p.chips.push({label:n.variable.label,target:P(n),shift:!0}):p.moreTests=(p.moreTests??0)+1,p.testNumbers.push(r));for(const o of f)p.findingIds.includes(o.id)||p.findingIds.push(o.id);continue}const x=Z(n)??n.stats.sampleSizeLeft;c.push(U({affected:d(n),measure:H(u),severity:n.severity,text:`${n.summary}: a shift of ${H(u)} over ${T(x,"die")}`+(f.length>1?` (also seen as ${ue(f.slice(1))})`:""),reason:`${n.summary}: a shift of ${H(u)} over ${T(x,"die")}`,brief:`${C(n)}: ${n.variable.label} ${n.effect.direction}`,subject:C(n),target:P(n),findingIds:f.map(o=>o.id),testNumbers:[r],chart:{chart:"box",fields:{x:ie(n),y:V(r),color:{none:!0}}}}))}return c}function tt(e,t){return e.filter(s=>s.id.startsWith("drift:")).map(s=>{const i=s.variable.kind==="yield",d=s.effect.effectSize??0;return U({affected:t*(i?Math.abs(d):ae(d)),measure:i?`${A(Math.abs(d))} pts`:H(d),severity:s.severity,text:s.summary,brief:`${s.variable.label}: drifts across the wafers`,subject:s.variable.label,target:P(s),findingIds:[s.id],...s.variable.index!==void 0?{testNumbers:[s.variable.index]}:{},chart:{chart:"control",fields:{x:{builtin:"waferOrder"},y:i||s.variable.index===void 0?{builtin:"yield"}:V(s.variable.index)}}})})}function st(e,t,s){return(e.stats.capability??[]).filter(i=>i.hasSpec&&i.ppk!==null&&i.ppk!==void 0&&i.ppk<Me&&!t.has(i.testNumber)).map(i=>{const d=i.ppk,c=Ne(3*d);return U({affected:s*c,measure:`Ppk ${d.toFixed(2)}`,severity:"notable",text:`${i.label} has Ppk ${d.toFixed(2)} against its limits: a spread that would put about ${A(c)}% of the dies outside them`,brief:`${i.label}: Ppk ${d.toFixed(2)}`,subject:i.label,target:{kind:"test",testNumber:i.testNumber},testNumbers:[i.testNumber],chart:he(i.testNumber,!0)})})}const it=.05;function nt(e,t){const s={items:[],compared:[]},i=e.perWafer;if(i.length<4)return s;const d=ke(i.map(o=>({metadata:o.summary.wafer,dieCount:o.summary.stats.totalDies})),{facetableOnly:!0,curation:t}).filter(o=>o.splittable&&o.values.length<=Math.max(2,Math.floor(i.length/2)));if(d.length===0)return s;const c=o=>e.perWaferTestStats?.find(l=>l.waferIndex===o.waferIndex)?.tests??o.summary.stats.perTestStats??[],r=i.map(o=>new Map(c(o).filter(l=>l.count>=2&&Number.isFinite(l.mean)).map(l=>[l.testNumber,l]))),h=new Map;for(const o of r)for(const[l,g]of o)h.has(l)||h.set(l,g.label);const f=i.map(o=>o.summary.stats.analyzedDies),n=[];for(const o of d){const l=i.map(g=>xe(g.summary.wafer,o.key,t));for(const[g,N]of[...h].sort((v,_)=>v[0]-_[0])){const v=new Map,_=[];if(r.forEach((y,I)=>{const k=y.get(g),$=l[I];!k||$===void 0||((v.get($)??v.set($,[]).get($)).push(I),Number.isFinite(k.stddev)&&_.push(k.stddev**2))}),v.size<2)continue;const F=Ie([...v].map(([y,I])=>({key:y,values:I.map(k=>r[k].get(g).mean)}))),O=F.welch?.p??F.kruskal?.p,W=_.length?Math.sqrt(_.reduce((y,I)=>y+I,0)/_.length):NaN;if(O===void 0||!Number.isFinite(O)||!(W>0))continue;let M;for(const[y,I]of v){const k=I.map(a=>r[a].get(g).mean),$=[...v].filter(([a])=>a!==y).flatMap(([,a])=>a.map(w=>r[w].get(g).mean));if(k.length<2||$.length<2)continue;const L=k.reduce((a,w)=>a+w,0)/k.length-$.reduce((a,w)=>a+w,0)/$.length,R=L/W;(!M||Math.abs(R)>Math.abs(M.d)+1e-9||Math.abs(Math.abs(R)-Math.abs(M.d))<=1e-9&&(I.length<M.groupWafers||I.length===M.groupWafers&&L>0))&&(M={testNumber:g,label:N,field:o.key,group:y,groupWafers:I.length,groupDies:I.reduce((a,w)=>a+f[w],0),d:R,higher:L>0,p:O})}if(M&&v.size===2){const[y,I]=[...v].find(([k])=>k!==M.group);M.other={group:y,wafers:I.length}}M&&n.push(M)}}const u=Se(n.map(o=>o.p)),b=new Map;n.forEach((o,l)=>{const g=o.groupDies*ae(o.d);u[l]>=it||g===0||(b.get(o.field)??b.set(o.field,[]).get(o.field)).push({c:o,q:u[l],weight:g})});const p=n.length?[...new Set(n.map(o=>o.field))].map(o=>oe(o,t)):[],m=(o,l)=>o.other?`${o.label} is ${o.higher?"higher":"lower"} on ${l} ${o.group} than on ${l} ${o.other.group} (${o.groupWafers} and ${o.other.wafers} wafers)`:`${o.label} is ${o.higher?"higher":"lower"} on ${l} ${o.group} (${o.groupWafers} of ${i.length} wafers) than on the other wafers`;return{items:[...b].map(([o,l])=>{l.sort(($,L)=>Math.abs(L.c.d)-Math.abs($.c.d)||L.weight-$.weight||$.c.testNumber-L.c.testNumber);const g=l.reduce(($,L)=>Math.max($,L.weight),0),N=oe(o,t),[v,..._]=l,F=v.c,O=`${m(F,N)}: a shift of ${H(F.d)}`,W=_.slice(0,2).map(({c:$})=>`${$.label} ${$.higher?"higher":"lower"} on ${$.group} (${H($.d)})`),M=_.length-W.length,y=l.length,I=y===1?`${O}, each wafer one value (q ${re(v.q)})`:`${y} tests differ by ${N}. Largest: ${O}, each wafer one value (q ${re(v.q)}); next: ${W.join(", ")}${M>0?`, and ${M} more`:""}`,k=U({affected:g,measure:H(F.d),severity:v.q<.001?"unusual":"notable",text:I,reason:y===1?O:`${y} tests differ by ${N}. Largest: ${O}`,brief:y===1?`${N} ${F.group}: ${F.label} ${F.higher?"higher":"lower"}`:`${N}: ${y} tests differ`,subject:N,target:{kind:"test",testNumber:F.testNumber},testNumbers:l.map($=>$.c.testNumber),chart:{chart:"box",fields:{x:{meta:o},y:V(F.testNumber),color:{meta:o}}}});return y>1&&(k.chips=l.slice(0,Y).map(({c:$})=>({label:`${$.label} ${H($.d)}`,target:{kind:"test",testNumber:$.testNumber}})),y>Y&&(k.moreTests=y-Y)),k}),compared:p}}function at(e){return e.map(t=>U({affected:t.passingDies,measure:"",severity:"notable",text:`${t.label} ${t.plainVerb} on ${T(t.passingDies,"die")} binned as passing`,brief:`${t.label}: ${S(t.passingDies)} dies out of limits, binned passing`,subject:t.label,target:t.item.target,testNumbers:[t.testNumber],chart:t.item.chart}))}function rt(e,t){const s=t.passBins&&t.passBins.length>0?`; pass ${$e([t.passBins])}`:"";if(e.level==="wafer"){const n=e.stats.yieldPercent;return n==null?`${S(e.stats.totalDies)} dies, no bin data to judge yield by.`:`Yield ${n.toFixed(1)}% (${S(e.stats.totalDies)} dies${s}).`}const i=e.lotYieldSeries.map(n=>n.yieldPercent).filter(n=>typeof n=="number");if(i.length===0)return`${T(e.stats.waferCount,"wafer")}, no bin data to judge yield by.`;const d=i.reduce((n,u)=>n+u,0)/i.length,c=e.perWafer.reduce((n,u)=>n+u.summary.stats.totalDies,0),[r,h]=[ge(i).toFixed(1),me(i).toFixed(1)],f=r!==h?`, range ${r}\u2013${h}%`:"";return`Yield ${d.toFixed(1)}% (mean of ${T(i.length,"wafer")}, ${S(c)} dies${s})${f}.`}function ot(e,t,s=[]){const i=[],d=e.level==="wafer"?e.stats.testsConsidered.length:new Set(e.perWafer.flatMap(n=>n.summary.stats.testsConsidered)).size,c=e.level==="wafer"?e.stats.hardBinsConsidered.length:new Set(e.perWafer.flatMap(n=>n.summary.stats.hardBinsConsidered)).size,r=e.stats.testValueAnalysis?.state;if(d>0&&r!=="off"&&i.push(T(d,"test")+(r==="skipped"?" (against their limits only)":"")),c>0&&i.push(T(c,"hard bin")),i.push("the ring, quadrant and sector regions"),e.level==="lot"&&e.stats.waferCount>=3){const n=e.findings.filter(pe);i.push(n.length===0?"wafer-to-wafer yield (no outlier wafers)":`wafer-to-wafer yield (${T(n.length,"outlier wafer")})`),e.stats.waferCount>=we&&i.push("the yield trend across the wafers (input order)"),s.length&&i.push(`the tests between the groups of ${s.join(", ")} (each wafer one value)`)}const h=e.findings.filter(n=>!t.has(n.id)).length,f=h>0?` ${T(h,"smaller finding")} not listed above.`:" Nothing else was found.";return`Compared: ${i.join(", ")}.${f}`}export function synthesisSource(e){return e.level==="lot"&&e.perWafer.length===1?e.perWafer[0].summary:e}export function buildSynthesis(e,t={}){const s=synthesisSource(e),i=s.findings,d=s.level==="lot"?s.stats.waferCount:void 0,c=t.passBins,r=new Map(i.map(a=>[a.id,a])),h=(s.level==="wafer"?[s]:s.perWafer.map(a=>a.summary)).every(a=>(a.stats.hardBinsConsidered??[]).length===0),f=a=>c!==void 0&&te(a)&&be(a.variable.kind,a.variable.bin??NaN,c,!h),n={isPassRate:a=>a.variable.kind==="yield"||c?.length===1&&f(a),isFailBin:a=>c!==void 0&&te(a)&&!f(a)},u=i.filter(a=>ce.has(a.comparison.family)&&E(a)>0&&(n.isPassRate(a)&&a.effect.direction==="lower"||n.isFailBin(a)&&a.effect.direction==="higher")),p=u.some(a=>a.variable.kind==="hardBin")?u.filter(a=>a.variable.kind!=="softBin"):u,m=[],x=new Map,o=new Set;for(const a of Te(p)){const w=a.map(z=>p[z]),B=Ce(w,i,d,n);m.push(B);const j=B.target.kind==="finding"?B.target.id:void 0;x.set(B,ee(w.find(z=>z.id===j)??w[0]))}for(const a of i.filter(w=>w.variable.kind==="spatialPattern")){const w=new Set((a.relatedIds??[]).filter(q=>r.has(q))),B=m.find(q=>q.findingIds.some(Q=>w.has(Q)));if(!B)continue;const j=a.level==="lot"&&"waferIndices"in a.highlight?a.highlight.waferIndices?.length:void 0,z=j!==void 0&&d?` on ${j}/${d} wafers`:"";B.text=`${a.variable.label} pattern${z}. ${B.text}`,B.reason=`${a.variable.label} pattern${z}. ${B.reason}`,B.chips.unshift({label:`${a.variable.label} pattern`,target:P(a)}),B.findingIds.unshift(a.id,...[...w].filter(q=>!m.some(Q=>Q.findingIds.includes(q))))}const l=qe(s),g=new Set,N=Ue(s,g),v=[...m],_=Qe(N,v,x,l);s.level==="lot"&&m.push(...Ge(s)),m.push(..._.map(a=>a.item));const F=new Set(_.filter(a=>l>0&&a.item.diesLost/l>=K).map(a=>a.testNumber));m.push(...et(i,[...v,..._.map(a=>a.item)],x),...tt(i,l),...st(s,g,l),...at(N.filter(a=>a.passingDies>0&&!F.has(a.testNumber))));let O=[];if(s.level==="lot"){const a=nt(s,t.attributes);O=a.compared;for(const w of a.items){const B=w.testNumbers[0],j=w.testNumbers.length===1?m.find(z=>z.target.kind==="test"&&z.target.testNumber===B)??m.find(z=>z.testNumbers.includes(B)):void 0;j?j.text+=`. ${w.text}`:m.push(w)}}const W=Ke(s),M=m.filter(a=>l>0&&a.affected/l>=K);for(const a of M)a.shareOfDies=a.affected/l,a.impact=Pe(a.shareOfDies,a.kind==="loss"&&W>0?a.diesLost/W:0),a.measure||(a.measure=`${(a.shareOfDies*100).toFixed(1)}%`);const y=a=>`${String(a.testNumbers[0]??"").padStart(10,"0")}${a.findingIds[0]??""}`;M.sort((a,w)=>w.affected-a.affected||(y(a)<y(w)?-1:y(a)>y(w)?1:0));const I=M.slice(0,le),k=M.slice(le);for(const a of[...I,...k])for(const w of a.findingIds)o.add(w);const $=k.length>0?{items:k.slice(0,fe),more:Math.max(0,k.length-fe)}:void 0,L=s.level==="lot"?"region, fail bin or wafer":"region or fail bin",R=i.filter(a=>a.severity==="unusual"&&!o.has(a.id)).length,J=I.length===0?R>0?`No ${L} costs as much as ${A(K)} yield points, though ${T(R,"finding")} below ${R===1?"is":"are"} marked unusual.`:`Nothing stands out: no ${L} costs as much as ${A(K)} yield points.`:void 0;return{headline:rt(s,t),items:I,...$?{also:$}:{},...J?{nothing:J}:{},checked:ot(s,o,O)}}export const synthesisKey=e=>e.target.kind==="finding"?`finding:${e.target.id}`:`test:${e.target.testNumber}`,SYNTHESIS_ALSO_HEADING=`Also, each affecting at least ${(K*100).toFixed(0)}% of the dies`,synthesisRowShare=e=>e.measure,synthesisMoreTests=e=>e.moreTests?`and ${e.moreTests} more test${e.moreTests===1?"":"s"}`:void 0;export function synthesisText(e){return[e.headline,...e.nothing?[e.nothing]:[],...e.items.map((t,s)=>`${s+1}. ${t.text}`),...e.also?[`${SYNTHESIS_ALSO_HEADING}: ${e.also.items.map(t=>`${t.brief} (${synthesisRowShare(t)})`).join("; ")}${e.also.more?`; and ${e.also.more} more`:""}.`]:[],e.checked].join(`
|
|
2
2
|
`)}
|