@wafertools/wafermap 0.39.0 → 0.40.1
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/CHANGELOG.md +38 -3
- package/README.md +2 -2
- package/dist/packages/canvas-adapter/charts/commonality.js +4 -1
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +10 -2
- package/dist/packages/canvas-adapter/charts/plotChart.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 +12 -6
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/drilldown.d.ts +1 -1
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/filterButton.d.ts +2 -0
- package/dist/packages/canvas-adapter/filterButton.js +1 -1
- package/dist/packages/canvas-adapter/identityHeader.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +9 -4
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/openWaferMode.d.ts +7 -0
- package/dist/packages/canvas-adapter/openWaferMode.js +1 -0
- package/dist/packages/canvas-adapter/plotTab.d.ts +1 -1
- 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 +2 -2
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/sweepEditor.js +1 -1
- package/dist/packages/canvas-adapter/toCanvas.d.ts +1 -0
- package/dist/packages/canvas-adapter/toCanvas.js +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +61 -38
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/virtualTable.d.ts +2 -1
- package/dist/packages/canvas-adapter/virtualTable.js +1 -1
- package/dist/packages/core/compact.js +2 -2
- package/dist/packages/core/dieTable.js +1 -1
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/fmt.d.ts +2 -0
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/stats/commonality.d.ts +38 -5
- package/dist/packages/stats/commonality.js +1 -1
- package/dist/packages/stats/dieRegions.d.ts +2 -0
- package/dist/packages/stats/dieRegions.js +1 -1
- package/dist/packages/stats/examplePicks.d.ts +6 -0
- package/dist/packages/stats/examplePicks.js +1 -1
- package/dist/packages/stats/groupEffects.d.ts +74 -0
- package/dist/packages/stats/groupEffects.js +1 -0
- package/dist/packages/stats/plotData.d.ts +7 -2
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/renderFindingsReport.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +7 -7
- package/dist/packages/stats/reportHtml.js +18 -13
- package/dist/packages/stats/sweep.d.ts +3 -3
- package/dist/packages/stats/sweepXFromName.js +1 -1
- package/dist/packages/stats/synthesis.d.ts +21 -1
- package/dist/packages/stats/synthesis.js +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import{SYNTHESIS_ALSO_HEADING as
|
|
1
|
+
import{SYNTHESIS_ALSO_HEADING as w,SYNTHESIS_POSSIBLE_HEADING as $,synthesisMoreTests as y,synthesisRowShare as k}from"./synthesis.js";import{formatFindingTooltip as S,findingMetricLabel as z,isProportionFinding as j}from"./findingText.js";import{arrangeFindings as T}from"./filterFindings.js";import{SEVERITY_MARK as b,METER_DOTS as N,filledDots as I,impactWord as E,impactShortWord as M,shortfallColor as u,shortfallStep as A,formatPoints as F,barPercent as L}from"./presentation.js";import{fmt as f,plainBinTerms as D}from"../renderer/fmt.js";import{buildFacetTable as _,attributeLabel as B}from"./facets.js";import{escHtml as a}from"../core/utils.js";import{derivedKeyText as R,derivedFields as C}from"../renderer/testLabel.js";export function renderSection(e,r,t="",o){return`<section class="${["report-section",t].filter(Boolean).join(" ")}"${o?` id="${a(o)}"`:""}>
|
|
2
2
|
<h2>${a(e)}</h2>
|
|
3
3
|
${r}
|
|
4
4
|
</section>`}export function renderDefinitionList(e,r="meta-list"){if(!e.length)return"";const t=e.map(o=>`<div class="definition-item"><dt>${a(o.label)}</dt><dd>${a(o.value)}</dd></div>`).join(`
|
|
5
5
|
`);return`<dl class="${r}">
|
|
6
6
|
${t}
|
|
7
|
-
</dl>`}export function buildMetadataRows(e){return
|
|
7
|
+
</dl>`}export function buildMetadataRows(e){return _(e,{facetableOnly:e.length>1}).map(t=>({label:B(t.key),value:t.values.map(o=>o.value).join(", ")}))}export function renderMetadataSection(e){const r=buildMetadataRows(e);return r.length?renderSection("Wafer Info",renderDefinitionList(r)):""}export function renderMetricGrid(e){return e.length?`<dl class="metric-grid">
|
|
8
8
|
${e.map(t=>`<div class="metric">
|
|
9
9
|
<dt>${a(t.label)}</dt>
|
|
10
10
|
<dd>${a(t.value)}</dd>
|
|
11
11
|
${t.hint?`<span class="metric-hint">${a(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">${a(t.emptyMessage??"No data")}</p>`;const o=["report-table",t.className].filter(Boolean).join(" "),p=e.map(
|
|
14
|
+
</dl>`:""}export function renderTable(e,r,t={}){if(!r.length)return`<p class="no-data">${a(t.emptyMessage??"No data")}</p>`;const o=["report-table",t.className].filter(Boolean).join(" "),p=e.map(s=>`<th>${a(s)}</th>`).join(""),c=s=>typeof s=="string"?`<td>${s}</td>`:`<td${s.className?` class="${s.className}"`:""}>${s.html}</td>`,l=r.map(s=>`<tr>${s.map(c).join("")}</tr>`).join(`
|
|
15
15
|
`);return`<table class="${o}">
|
|
16
16
|
<thead><tr>${p}</tr></thead>
|
|
17
17
|
<tbody>${l}</tbody>
|
|
18
|
-
</table>`}export function renderMeter(e,r){const t=
|
|
19
|
-
${p}`}export function formatFindingDelta(e){if(e.variable.kind==="spatialPattern")return"\u2014";const r=e.effect.absoluteDelta??0,t=r>0?"+":r<0?"\u2212":"";if(
|
|
18
|
+
</table>`}export function renderMeter(e,r){const t=I(e);return`<span class="meter"><span class="meter-dots" aria-hidden="true">${"\u25CF".repeat(t)}${"\u25CB".repeat(N-t)}</span><span class="meter-word">${a(r)}</span></span>`}export function renderSeverityMeter(e){const{tier:r,word:t}=b[e];return renderMeter(r,t)}export const severityTier=e=>b[e].tier;export function barCell(e,r,t="",o){const p=o?`;background:${a(o)}`:"";return{html:`<span class="cellbar"><span class="cellbar-value">${a(r)}</span><span class="cellbar-track" aria-hidden="true"><i style="width:${L(e).toFixed(1)}%${p}"></i></span></span>`,className:["barcell",t].filter(Boolean).join(" ")}}export function deltaCell(e){const r=A(e);return{html:a(F(e)),className:["numeric",r?`low-${r}`:""].filter(Boolean).join(" ")}}export function withSectionNav(e,r=""){const t=[];let o=0;const p=e.replace(/<section class="(report-section[^"]*)"(?: id="([^"]*)")?>(\s*<h2>)(.*?)(<\/h2>)/g,(l,s,n,d,m,g)=>{++o;const i=n??`sec-${r}${o}`;return t.push({id:i,title:m}),`<section class="${s}" id="${i}">${d}${m}${g}`});return t.length<4?e:`<nav class="report-toc" aria-label="Sections">${t.map(l=>`<a href="#${l.id}">${l.title}</a>`).join("")}</nav>
|
|
19
|
+
${p}`}export function formatFindingDelta(e){if(e.variable.kind==="spatialPattern")return"\u2014";const r=e.effect.absoluteDelta??0,t=r>0?"+":r<0?"\u2212":"";if(j(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 o=Math.abs(e.effect.relativeDelta*100).toFixed(1);return`${t}${o}%`}return`${t}${f(Math.abs(r),e.variable.unit)}`}return`${t}${f(Math.abs(r),e.variable.unit)}`}export function derivedFindingsKeyHtml(e){const r=R(e.map(t=>({label:t.variable.label,...C(t.variable)})));return r?`<p class="report-note">${a(r)}</p>`:""}export function findingAnchor(e,r=""){return`finding-${r}`+e.replace(/[^A-Za-z0-9]/g,t=>`_${t.charCodeAt(0).toString(16)}_`)}const H="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,o=!1){const p=T(e),c=[...p.patterns.flatMap(n=>[{f:n.finding,nested:!1},...n.children.map(d=>({f:d,nested:!0}))]),...p.groups.flatMap(n=>n.findings.map(d=>({f:d,nested:!1})))],l=c.length?c.map(({f:n,nested:d})=>`<tr class="tier-${severityTier(n.severity)}${d?" nested":""}${o?" live":""}"${t!==void 0?` id="${findingAnchor(n.id,t)}"`:""}${o?` data-finding="${a(n.id)}"`:""} title="${a(S(n))}${o?`
|
|
20
20
|
Click to show it on the map`:""}">
|
|
21
21
|
<td class="tight">${renderSeverityMeter(n.severity)}</td>
|
|
22
22
|
<td class="tight">${a(n.comparison.left)}</td>
|
|
23
|
-
<td>${a(
|
|
23
|
+
<td>${a(D(z(n)))}</td>
|
|
24
24
|
<td class="numeric">${a(formatFindingDelta(n))}</td>
|
|
25
25
|
<td class="numeric">${a(formatFindingCoverage(n,r))}</td>
|
|
26
26
|
</tr>`).join(`
|
|
@@ -37,16 +37,21 @@ Click to show it on the map`:""}">
|
|
|
37
37
|
<tbody>
|
|
38
38
|
${l}
|
|
39
39
|
</tbody>
|
|
40
|
-
</table>${p.patterns.length?`<p class="report-note">${a(
|
|
41
|
-
<li class="tier-${o.impact}">${renderMeter(o.impact,
|
|
42
|
-
</ol>`:`<p class="synthesis-none">${a(e.nothing??"Nothing stands out.")}</p>`,m=c.length?`<p class="synthesis-smaller">${a(
|
|
40
|
+
</table>${p.patterns.length?`<p class="report-note">${a(H)}</p>`:""}${derivedFindingsKeyHtml(e)}`}export function synthesisSectionHtml(e,r){const t=(i,v)=>{const h=r(v);return h?`<a href="#${a(h)}">${a(i)}</a>`:a(i)},[o,...p]=e.items,c=[...p,...e.also?.items??[]],l=e.also?.more??0,s=o?[t(o.subject,o.target),...o.chips.map(i=>t(i.label,i.target))]:[],n=o&&y(o);n&&s.push(a(n));const d=o?`<ol class="synthesis-items">
|
|
41
|
+
<li class="tier-${o.impact}">${renderMeter(o.impact,E(o.impact))}<span>${a(o.text)}<span class="synthesis-see">See: ${s.join(" \xB7 ")}</span></span></li>
|
|
42
|
+
</ol>`:`<p class="synthesis-none">${a(e.nothing??"Nothing stands out.")}</p>`,m=c.length?`<p class="synthesis-smaller">${a(w)}</p>
|
|
43
43
|
<ul class="synthesis-more">
|
|
44
|
-
${c.map(
|
|
44
|
+
${c.map(i=>`<li>${renderMeter(i.impact,M(i.impact))}<span>${t(i.brief,i.target)}</span><span class="synthesis-share">${a(k(i))}</span></li>`).join(`
|
|
45
45
|
`)}${l?`
|
|
46
46
|
<li class="synthesis-rest"><span></span><span>and ${l} more</span><span></span></li>`:""}
|
|
47
|
+
</ul>`:"",g=e.possible?.length?`<p class="synthesis-smaller">${a($)}</p>
|
|
48
|
+
<ul class="synthesis-more">
|
|
49
|
+
${e.possible.map(i=>`<li><span>${a(i.text)}</span></li>`).join(`
|
|
50
|
+
`)}
|
|
47
51
|
</ul>`:"";return renderSection("What stands out",`<p class="synthesis-headline">${a(e.headline)}</p>
|
|
48
52
|
${d}
|
|
49
53
|
${m}
|
|
54
|
+
${g}
|
|
50
55
|
<p class="synthesis-checked">${a(e.checked)}</p>`,"synthesis")}const x=`<script>
|
|
51
56
|
(function () {
|
|
52
57
|
var embedded = location.href === 'about:srcdoc';
|
|
@@ -116,9 +121,9 @@ document.addEventListener('click', function (e) {
|
|
|
116
121
|
--report-tier-medium-edge: #a8741a;
|
|
117
122
|
--report-tier-low-bg: #edf2f7;
|
|
118
123
|
--report-tier-low-edge: #5f7f9f;
|
|
119
|
-
--report-low-1: ${
|
|
120
|
-
--report-low-2: ${
|
|
121
|
-
--report-low-3: ${
|
|
124
|
+
--report-low-1: ${u(1)};
|
|
125
|
+
--report-low-2: ${u(2)};
|
|
126
|
+
--report-low-3: ${u(3)};
|
|
122
127
|
--report-bar: #9db8d3;
|
|
123
128
|
}
|
|
124
129
|
|
|
@@ -34,13 +34,13 @@ export interface SweepSeriesSpec {
|
|
|
34
34
|
* Read each test's x value from its NAME instead — for programs that record
|
|
35
35
|
* the swept quantity only in the test text. A placeholder pattern, not a
|
|
36
36
|
* regular expression: `{x}` reads a number, `*` matches any run of
|
|
37
|
-
* characters, `?` matches exactly one character, everything else is literal. `"
|
|
38
|
-
* a test named `"
|
|
37
|
+
* characters, `?` matches exactly one character, everything else is literal. `"LEVEL_{x}"` reads 12,000 from
|
|
38
|
+
* a test named `"Cum_share= LEVEL_12K / …"`.
|
|
39
39
|
*
|
|
40
40
|
* - The pattern is found ANYWHERE in the name; no leading or trailing `*`.
|
|
41
41
|
* - Literal text matches case-insensitively; the value's SI prefix does not
|
|
42
42
|
* (`m` is milli, `M` mega). `{x}` reads the prefix, and `K` is accepted as
|
|
43
|
-
* kilo. Put the prefix in the pattern instead (`"
|
|
43
|
+
* kilo. Put the prefix in the pattern instead (`"LEVEL_{x}K"`) to keep
|
|
44
44
|
* the numbers as the name shows them (12 rather than 12,000).
|
|
45
45
|
* - Each x stays attached to its own test, so a test missing from the data
|
|
46
46
|
* loses one point instead of shifting every later x the way a positional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SI_PREFIX_SCALE as
|
|
1
|
+
import{SI_PREFIX_SCALE as b,KNOWN_BASE_UNITS as p}from"../renderer/fmt.js";const c=Object.fromEntries(Object.entries({...b,K:1e3}).map(([e,t])=>[e,Math.round(Math.log10(t))])),m=e=>e!==void 0&&/\p{L}/u.test(e),g=[...new Set(p.map(e=>e.toLowerCase()))];function E(e,t){const n=e[t];if(n===void 0||!m(n))return null;const o=t+1;if(!m(e[o]))return c[n]??null;const a=e.slice(o),s=g.find(r=>a.toLowerCase().startsWith(r)&&!m(a[r.length]));if(s===void 0)return null;const l=a.slice(0,s.length);return!p.includes(l)||!/\p{Ll}/u.test(e)?n.toLowerCase()==="m"?"ambiguous":c[n]??c[n.toLowerCase()]??c[n.toUpperCase()]??null:c[n]??null}export const NAME_PATTERN_EXAMPLES=[{name:"Fmax @ 0.55 V",pattern:"@ {x}",reads:.55,note:"the text before the number picks it out; the unit after it is ignored"},{name:"1234-5",pattern:"-{x}",reads:5,note:"the number after the dash"},{name:"1234-5",pattern:"{x}",reads:1234,note:"with nothing around it, {x} takes the first number"},{name:"A-1-5",pattern:"A-1-{x}",reads:5,note:"a pattern fits the first place it can, so add more of the name"},{name:"VDD=1.2V_IDS",pattern:"VDD={x}",reads:1.2},{name:"Idsat Vg=0.8 Vd=1.0",pattern:"Vd={x}",reads:1,note:"the second of two levels"},{name:"Tj-40C_Vth",pattern:"Tj{x}C",reads:-40,note:"a minus sign belongs to the number"},{name:"Step 03 of 12",pattern:"Step {x}",reads:3},{name:"PAT_7_RUN2",pattern:"PAT_{x}_",reads:7,note:"text after {x} must follow it, so RUN2 is not read"},{name:"LEVEL_12K",pattern:"LEVEL_{x}",reads:12e3,note:"{x} reads the K as kilo"},{name:"LEVEL_12K",pattern:"LEVEL_{x}K",reads:12,note:"write the K in the pattern to keep the number as the name shows it"},{name:"Fmax_25C_0.55V",pattern:"C_{x}",reads:.55,note:"the text just before the number, here the end of the temperature"},{name:"VCC_1.8V_TEMP_125",pattern:"TEMP_{x}",reads:125,note:"other numbers in the name are ignored"},{name:"RUN3_LEVEL_12K",pattern:"RUN*LEVEL_{x}",reads:12e3,note:"* skips any length of text between the two parts"},{name:"fmax @ 0.55 v",pattern:"FMAX @ {x}",reads:.55,note:"text matches in any case"},{name:"Vth @ 50mV",pattern:"@ {x}",reads:.05,note:"the m of mV is read as milli, so 50 mV is 0.05"},{name:"Delay 5ns @ 25C",pattern:"Delay {x}",reads:5e-9,note:"a unit with a prefix is scaled to its base unit"},{name:"Leak I=1e-6A",pattern:"I={x}",reads:1e-6,note:"exponent notation is read"},{name:"12314",pattern:"123?{x}",reads:4,note:"? is any one character, so names of one shape can be read by position: here the digit after 123 and one more"},{name:"12336",pattern:"123?{x}",reads:6,note:"the same pattern on the next name"}],NAME_PATTERN_LIMIT="A pattern reads a whole number or nothing: it cannot take part of a number, so reading the last digit of 12314 needs the characters before it spelled out or skipped with ? (123?{x}), which suits names of one length. It cannot count back from the end of a name. For names of uneven length, choose Values and type the X values instead.";export function compileXNamePattern(e){const t=[];let n="",o=0;const a=()=>{n&&(t.push({kind:"lit",text:n.toLowerCase()}),n="")};for(let s=0;s<e.length;s++){if(e.startsWith("{x}",s)){a(),t.push({kind:"x"}),o++,s+=2;continue}if(e[s]==="*"){a(),t.at(-1)?.kind!=="star"&&t.push({kind:"star"});continue}if(e[s]==="?"){a(),t.push({kind:"any"});continue}n+=e[s]}return a(),o!==1?{error:`the pattern must contain {x} exactly once (it has ${o})`}:{source:e,parts:t}}const _=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/;function L(e,t){const n=_.exec(e.slice(t));if(!n)return[];const o=n[0],a=t+o.length,s=E(e,a);if(s==="ambiguous"){const u=e.slice(t,a+1+(/^\p{L}+/u.exec(e.slice(a+1))?.[0].length??0));return[{value:Number(o),end:a,literalMustFollow:u}]}const l=[];if(s!==null){const[u,r="0"]=o.split(/[eE]/);l.push({value:+`${u}e${Number(r)+s}`,end:a+1})}return l.push({value:Number(o),end:a}),l}export function readXFromName(e,t){const{parts:n}=e;let o;const a=t.toLowerCase(),s=new Set,l=(r,i)=>r*(t.length+1)+i;function u(r,i){if(r===n.length)return NaN;if(s.has(l(r,i)))return;const h=n[r];let f;if(h.kind==="lit")a.startsWith(h.text,i)&&(f=u(r+1,i+h.text.length));else if(h.kind==="any")i<t.length&&(f=u(r+1,i+(t.codePointAt(i)>65535?2:1)));else if(h.kind==="star")for(let d=i;d<=t.length&&f===void 0;d++)f=u(r+1,d);else for(const d of L(t,i)){if(d.literalMustFollow!==void 0){const x=n[r+1];if(x?.kind!=="lit"||!a.startsWith(x.text,d.end)){o??=d.literalMustFollow;continue}}if(u(r+1,d.end)!==void 0){f=d.value;break}}return f===void 0&&s.add(l(r,i)),f}for(let r=0;r<=t.length;r++){const i=u(0,r);if(i!==void 0)return Number.isFinite(i)?i:null}return o!==void 0?{ambiguous:o}:null}
|
|
@@ -12,6 +12,12 @@ export type SynthesisTarget = {
|
|
|
12
12
|
} | {
|
|
13
13
|
kind: 'test';
|
|
14
14
|
testNumber: number;
|
|
15
|
+
}
|
|
16
|
+
/** The wafers' groups on a field (Group by's key): an item about yield, which has no finding or test to show on the map. */
|
|
17
|
+
| {
|
|
18
|
+
kind: 'group';
|
|
19
|
+
field: string; /** Every field that gives the same groups, `field` first. */
|
|
20
|
+
fields: string[];
|
|
15
21
|
};
|
|
16
22
|
/** One part of an item that can be shown on its own: a fail bin in its region, the pattern, a test on the same dies. */
|
|
17
23
|
export interface SynthesisChip {
|
|
@@ -90,6 +96,11 @@ export interface Synthesis {
|
|
|
90
96
|
items: SynthesisItem[];
|
|
91
97
|
more: number;
|
|
92
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* Groups of wafers that differ on two or more measures with no overlap, which the sample is too small to confirm. Kept apart
|
|
101
|
+
* from `items` and not counted as what stands out. Absent when there are none.
|
|
102
|
+
*/
|
|
103
|
+
possible?: SynthesisItem[];
|
|
93
104
|
/** Said instead of the items when none is material, so a good lot reads as one rather than as an empty list. */
|
|
94
105
|
nothing?: string;
|
|
95
106
|
/** What was compared and not repeated above. Required: a short synthesis must not read as "not analysed". */
|
|
@@ -129,7 +140,16 @@ export declare function buildSynthesis(input: StatsSummary | LotStatsSummary, ct
|
|
|
129
140
|
* 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
|
|
130
141
|
* card and a card's Show on map finds its row.
|
|
131
142
|
*/
|
|
132
|
-
export declare const synthesisKey: (it: Pick<SynthesisItem, "target">) => string;
|
|
143
|
+
export declare const synthesisKey: (it: Pick<SynthesisItem, "target" | "chart">) => string;
|
|
144
|
+
/** The lot field an item's chart is drawn by (a test by split), or undefined when it is not about groups of wafers. */
|
|
145
|
+
export declare const groupedByField: (it: Pick<SynthesisItem, "chart">) => string | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Whether an item is about the wafers' yield in each group of a field, not a ring's pass rate in each (whose chart keeps to
|
|
148
|
+
* that ring). Such an item is a row of What divides yield, which reads the same fields the same way, so Insights draws it there.
|
|
149
|
+
*/
|
|
150
|
+
export declare const isGroupYieldItem: (it: Pick<SynthesisItem, "target" | "chart">) => boolean;
|
|
151
|
+
/** The heading over groups that differ with no overlap but that the sample is too small to confirm. */
|
|
152
|
+
export declare const SYNTHESIS_POSSIBLE_HEADING = "Possible, not confirmed";
|
|
133
153
|
/** The heading over the compact list of further items: the floor is the same one that admits an item at all. */
|
|
134
154
|
export declare const SYNTHESIS_ALSO_HEADING: string;
|
|
135
155
|
/** 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. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{maxOf as ge,minOf as be}from"../core/utils.js";import{isPassBin as $e,passBinsLabel as we}from"../core/passBins.js";import{DRIFT_MIN_WAFERS as ye}from"./lotDrift.js";import{isOneBinCluster as ve}from"./filterFindings.js";import{plainBinTerms as Se}from"../renderer/fmt.js";import{benjaminiHochberg as Ne,normalUpperTail as xe}from"./math.js";import{compareGroups as Ie,formatP as ae}from"./groupCompare.js";import{attributeLabel as oe,buildFacetTable as ke,facetValueOf as Me}from"./facets.js";const De=1,Be=2,_e=.5,le=3,fe=5,K=.01,Fe=.02,Oe=.04,ze=.15,Le=.4,X=.5,Ae=.1,Ee=2,ce=new Set(["ring","quadrant","sector","reticle-position","test-site","cluster","edge-arc"]);function ee(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 te(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),T=e=>D(e)*(ee(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 Se(t)},S=e=>Math.round(e).toLocaleString("en-GB"),E=(e,t,s=`${t}s`)=>`${S(e)} ${e===1?t:s}`;function R(e){const t=e.comparison.left;return e.comparison.family==="quadrant"&&!/quadrant/i.test(t)?`${t} quadrant`:t}const de=ve;function Te(e){const t=e.map((f,r)=>r),s=f=>t[f]===f?f:t[f]=s(t[f]),i=e.map(te),d=(f,r)=>{const u=i[f].size<=i[r].size?i[f]:i[r],b=u===i[f]?i[r]:i[f];let m=0;for(const p of u)b.has(p)&&m++;return m},c=e.map((f,r)=>r).filter(f=>de(e[f])),n=e.map((f,r)=>r).filter(f=>!de(e[f]));for(let f=0;f<n.length;f++)for(let r=f+1;r<n.length;r++){const u=Math.min(i[n[f]].size,i[n[r]].size);u>0&&d(n[f],n[r])>=X*u&&(t[s(n[f])]=s(n[r]))}for(const f of c){let r=-1,u=0;for(const b of n){if(se(e[b])&&e[b].variable.bin!==e[f].variable.bin)continue;const m=d(f,b);m>u&&m>=X*i[f].size&&m>=X*T(e[b])&&(r=b,u=m)}r>=0&&(t[f]=s(r))}const h=new Map;return e.forEach((f,r)=>{const u=s(r);(h.get(u)??h.set(u,[]).get(u)).push(r)}),[...h.values()]}const se=e=>e.variable.kind==="hardBin"||e.variable.kind==="softBin",ie=(e,t)=>e.level===t.level&&e.comparison.family===t.comparison.family&&e.comparison.left===t.comparison.left;function We(e,t,s){const i=c=>t.filter(n=>n.variable.kind===c&&ie(n,e)&&n.effect.direction==="higher"&&s(n));return(i("hardBin").length>0?i("hardBin"):i("softBin")).filter(c=>c!==e).sort((c,n)=>D(n)-D(c))}const je={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(R(i))}const s=[];for(const[i,d]of t)d.size<=He?s.push(...d):s.push(`${d.size} ${je[i]??i}`);return s.join(", ")}const Ce=e=>e.charAt(0).toUpperCase()+e.slice(1),P=e=>({kind:"finding",id:e.id}),Re=e=>({label:Ce(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 V(e){const t=e.comparison.family;return{builtin:t==="quadrant"||t==="sector"?"quadrant":t==="reticle-position"?"reticleCell":t==="test-site"?"site":"ring"}}const he=(e,t)=>({chart:"bar",fields:{x:e,y:t,color:{none:!0}},valueLabels:!0,axes:{y:{references:[{stat:"median"}]}}}),J=e=>({test:e}),ne=(e,t=!1)=>({chart:"histogram",fields:{y:J(e),color:{none:!0}},...t?{normalCurve:!0}:{}});function Pe(e,t,s,i){const d=[...e].sort((l,g)=>T(g)-T(l))[0],c=e.find(l=>i.isPassRate(l)&&ie(l,d))??d,n=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`:"",r=!i.isPassRate(c),u=c.comparison.family==="sector"?"the other sectors":"the rest of the wafer";let b=r?`${R(c)}: ${G(c)} ${A(D(c))} points higher than ${u}${f}`:`${R(c)}: pass rate ${A(D(c))} points below ${u}${f}`;const m=`${b} \u2014 about ${S(T(c))} dies lost`,p=We(c,t,i.isFailBin).map(l=>({f:l,share:D(l)/(D(c)||1)})).filter(l=>r||l.share>=Ae).slice(0,Ee);if(r)for(const{f:l}of p)b+=`, ${G(l)} ${A(D(l))} points higher`;else if(p.length>0){const l=p.reduce((N,v)=>N+v.share,0)<=1.000000001,g=l&&p[0].share>.5?"mostly ":"";p.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(T(c))} dies lost`;const k=n.filter(l=>!ie(l,c));k.length>0&&(b+=` (also seen as ${ue(k)})`);const o=r?G(c):"pass rate";return{kind:"loss",impact:"low",shareOfDies:0,diesLost:T(c),affected:T(c),measure:"",severity:c.severity,text:b,reason:m,brief:`${R(c)}: ${o}, ${S(T(c))} dies`,subject:R(c),target:P(c),chips:[...r?[c]:[],...p.map(({f:l})=>l)].map(Re),findingIds:[c.id,...n.map(l=>l.id)],testNumbers:[],chart:r?{chart:"bar",fields:{x:V(c),color:{builtin:c.variable.kind==="softBin"?"sbin":"hbin"}},stack:"percent"}:c.level==="lot"?{chart:"heatmap",fields:{x:{builtin:"wafer"},rows:V(c),y:{builtin:"yield"}}}:he(V(c),{builtin:"yield"})}}function Ke(e,t){return e>=Oe||t>=Le?"high":e>=Fe||t>=ze?"medium":"low"}function qe(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 Ge(e){return e.level==="wafer"?e.stats.analyzedDies:e.perWafer.reduce((t,s)=>t+s.summary.stats.analyzedDies,0)}const me=e=>e.id.startsWith("inter-wafer:yield:");function Ye(e){const t=[];for(const s of e.findings){if(!me(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:{chart:"control",fields:{x:{builtin:"waferOrder"},y:{builtin:"yield"}}}})}return t}function Ue(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 n=c.summary.stats.testFailures?.[t];if(n){d=!0,i+=n.lostDies;for(const h of n.dieKeys)s.add(`${c.waferIndex}:${h}`)}}return d?{keys:s,lost:i}:void 0}function Xe(e,t){const s=e.stats,i=[],d=n=>he({builtin:e.level==="lot"?"wafer":"ring"},{passRate:n}),c=(n,h,f,r,u,b,m=u,p=!1)=>{if(f<=0||r<=0)return;t.add(n);const k=Ue(e,n),o=k?Math.min(k.lost,f):f,l=f-o,g=f/r*100;i.push({testNumber:n,label:h,verb:u,plainVerb:m,failDies:f,passingDies:l,keys:k?.keys,item:{kind:"loss",impact:"low",shareOfDies:0,diesLost:o,affected:o,measure:"",severity:"info",text:`${h} ${u} on ${S(f)} of ${S(r)} 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(r)} dies (${g.toFixed(1)}%)`,brief:l>0?`${h}: ${b}, ${S(o)} dies lost`:`${h}: ${S(f)} dies ${b}`,subject:h,target:{kind:"test",testNumber:n},chips:[],findingIds:[],testNumbers:[n],chart:p||e.level==="lot"?d(n):ne(n)}})};for(const n of s.testSpecYield??[]){const h=n.failHighDies===0?"is below its low limit":n.failLowDies===0?"is above its high limit":`is outside its limits (${S(n.failLowDies)} low, ${S(n.failHighDies)} high)`;c(n.testNumber,n.label,n.failLowDies+n.failHighDies,n.totalDies,h,"outside limits",n.failLowDies>0&&n.failHighDies>0?"is outside its limits":h)}for(const n of s.functionalYield??[])c(n.testNumber,n.label,n.failDies,n.totalDies,"fails","fail","fails",!0);return i}const Ve=.5,Je=2,Qe=2,Y=5;function Ze(e,t,s,i){const d=new Set,c=new Map,n=new Map,h=[...e].sort((f,r)=>r.failDies-f.failDies||f.testNumber-r.testNumber);for(const f of h){const r=f.keys;if(i>0&&f.failDies/i<K){d.add(f);continue}let u;if(r&&r.size>0&&i>0)for(const p of t){const k=s.get(p);if(!k||k.size===0)continue;let o=0;for(const g of r)k.has(g)&&o++;const l=o/r.size;l>=Ve&&l>=Je*(k.size/i)&&(!u||o>u.inside)&&(u={item:p,inside:o})}if(!u){d.add(f);continue}const b=c.get(u.item)??0;if(b<Qe){const p=u.inside===f.failDies?"all":S(u.inside);u.item.text+=`. ${f.label} ${f.verb} on ${E(f.failDies,"die")}, ${p} of them in ${u.item.subject}`,c.set(u.item,b+1)}const m=n.get(u.item)??0;m<Y?(u.item.chips.push({label:f.label,target:f.item.target}),n.set(u.item,m+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 re=e=>Math.abs(e)<_e?0:Math.min(1,(Math.abs(e)/Be)**2),j=e=>`${Math.abs(e).toFixed(1)}\u03C3`,et=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 tt(e,t,s){const i=new Map;for(const n of e)!et(n)||n.variable.index===void 0||(i.get(n.variable.index)??i.set(n.variable.index,[]).get(n.variable.index)).push(n);const d=n=>(ee(n)??n.stats.sampleSizeLeft)*re(n.effect.effectSize??0),c=[];for(const[n,h]of[...i].sort((f,r)=>f[0]-r[0])){const f=[...h].sort((o,l)=>d(l)-d(o)),r=f[0],u=r.effect.effectSize??0;if(d(r)===0)continue;const b=te(r);let m=t.find(o=>o.target.kind==="test"&&o.target.testNumber===n)??t.find(o=>o.testNumbers.includes(n))??t.find(o=>f.some(l=>o.findingIds.includes(l.id))),p=0;for(const o of m?[]: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>p&&(p=g,m=o)}if(m){m.text+=`. ${r.summary}`,m.testNumbers.includes(n)||(m.chips.filter(l=>l.target.kind==="test"||l.shift).length<Y?m.chips.push({label:r.variable.label,target:P(r),shift:!0}):m.moreTests=(m.moreTests??0)+1,m.testNumbers.push(n));for(const o of f)m.findingIds.includes(o.id)||m.findingIds.push(o.id);continue}const k=ee(r)??r.stats.sampleSizeLeft;c.push(U({affected:d(r),measure:j(u),severity:r.severity,text:`${r.summary}: a shift of ${j(u)} over ${E(k,"die")}`+(f.length>1?` (also seen as ${ue(f.slice(1))})`:""),reason:`${r.summary}: a shift of ${j(u)} over ${E(k,"die")}`,brief:`${R(r)}: ${r.variable.label} ${r.effect.direction}`,subject:R(r),target:P(r),findingIds:f.map(o=>o.id),testNumbers:[n],chart:{chart:"box",fields:{x:V(r),y:J(n),color:{none:!0}},axes:{y:{references:[{stat:"median"}]}}}}))}return c}function st(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):re(d)),measure:i?`${A(Math.abs(d))} pts`:j(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"}:J(s.variable.index)}}})})}function it(e,t,s){return(e.stats.capability??[]).filter(i=>i.hasSpec&&i.ppk!==null&&i.ppk!==void 0&&i.ppk<De&&!t.has(i.testNumber)).map(i=>{const d=i.ppk,c=xe(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:ne(i.testNumber,!0)})})}const nt=.05,rt=8;function at(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??[],n=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 n)for(const[l,g]of o)h.has(l)||h.set(l,g.label);const f=i.map(o=>o.summary.stats.analyzedDies),r=[];for(const o of d){const l=i.map(g=>Me(g.summary.wafer,o.key,t));for(const[g,N]of[...h].sort((v,_)=>v[0]-_[0])){const v=new Map,_=[];if(n.forEach((y,x)=>{const I=y.get(g),$=l[x];!I||$===void 0||((v.get($)??v.set($,[]).get($)).push(x),Number.isFinite(I.stddev)&&_.push(I.stddev**2))}),v.size<2)continue;const F=Ie([...v].map(([y,x])=>({key:y,values:x.map(I=>n[I].get(g).mean)}))),z=F.welch?.p??F.kruskal?.p,W=_.length?Math.sqrt(_.reduce((y,x)=>y+x,0)/_.length):NaN;if(z===void 0||!Number.isFinite(z)||!(W>0))continue;let M;for(const[y,x]of v){const I=x.map(a=>n[a].get(g).mean),$=[...v].filter(([a])=>a!==y).flatMap(([,a])=>a.map(w=>n[w].get(g).mean));if(I.length<2||$.length<2)continue;const O=I.reduce((a,w)=>a+w,0)/I.length-$.reduce((a,w)=>a+w,0)/$.length,H=O/W;(!M||Math.abs(H)>Math.abs(M.d)+1e-9||Math.abs(Math.abs(H)-Math.abs(M.d))<=1e-9&&(x.length<M.groupWafers||x.length===M.groupWafers&&O>0))&&(M={testNumber:g,label:N,field:o.key,group:y,groupWafers:x.length,groupDies:x.reduce((a,w)=>a+f[w],0),d:H,higher:O>0,p:z})}if(M&&v.size===2){const[y,x]=[...v].find(([I])=>I!==M.group);M.other={group:y,wafers:x.length}}M&&r.push(M)}}const u=Ne(r.map(o=>o.p)),b=new Map;r.forEach((o,l)=>{const g=o.groupDies*re(o.d);u[l]>=nt||g===0||(b.get(o.field)??b.set(o.field,[]).get(o.field)).push({c:o,q:u[l],weight:g})});const m=r.length?[...new Set(r.map(o=>o.field))].map(o=>oe(o,t)):[],p=(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(($,O)=>Math.abs(O.c.d)-Math.abs($.c.d)||O.weight-$.weight||$.c.testNumber-O.c.testNumber);const g=l.reduce(($,O)=>Math.max($,O.weight),0),N=oe(o,t),[v,..._]=l,F=v.c,z=`${p(F,N)}: a shift of ${j(F.d)}`,W=_.slice(0,2).map(({c:$})=>`${$.label} ${$.higher?"higher":"lower"} on ${$.group} (${j($.d)})`),M=_.length-W.length,y=l.length,x=y===1?`${z}, each wafer one value (q ${ae(v.q)})`:`${y} tests differ by ${N}. Largest: ${z}, each wafer one value (q ${ae(v.q)}); next: ${W.join(", ")}${M>0?`, and ${M} more`:""}`,I=U({affected:g,measure:j(F.d),severity:v.q<.001?"unusual":"notable",text:x,reason:y===1?z:`${y} tests differ by ${N}. Largest: ${z}`,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:y>1?{chart:"heatmap",level:"wafer",aggregate:"mean",normalize:"zscore",fields:{x:{meta:o},y:{tests:l.slice(0,rt).map($=>$.c.testNumber)}}}:{chart:"box",level:"wafer",aggregate:"mean",fields:{x:{meta:o},y:J(F.testNumber),color:{meta:o}}}});return y>1&&(I.chips=l.slice(0,Y).map(({c:$})=>({label:`${$.label} ${j($.d)}`,target:{kind:"test",testNumber:$.testNumber}})),y>Y&&(I.moreTests=y-Y)),I}),compared:m}}export function groupColouredChart(e,t){const s=e.fields?.x,i=e.fields?.color;return!t||e.chart!=="bar"||!s||Array.isArray(s)||!("builtin"in s)||s.builtin!=="wafer"||!i||!("none"in i)?e:{...e,fields:{...e.fields,x:[{slot:"groupBy"},{builtin:"wafer"}],color:{follow:"groupBy"}}}}function ot(e){return e.map(t=>U({affected:t.passingDies,measure:"",severity:"notable",text:`${t.label} ${t.plainVerb} on ${E(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:ne(t.testNumber)}))}function lt(e,t){const s=t.passBins&&t.passBins.length>0?`; pass ${we([t.passBins])}`:"";if(e.level==="wafer"){const r=e.stats.yieldPercent;return r==null?`${S(e.stats.totalDies)} dies, no bin data to judge yield by.`:`Yield ${r.toFixed(1)}% (${S(e.stats.totalDies)} dies${s}).`}const i=e.lotYieldSeries.map(r=>r.yieldPercent).filter(r=>typeof r=="number");if(i.length===0)return`${E(e.stats.waferCount,"wafer")}, no bin data to judge yield by.`;const d=i.reduce((r,u)=>r+u,0)/i.length,c=e.perWafer.reduce((r,u)=>r+u.summary.stats.totalDies,0),[n,h]=[be(i).toFixed(1),ge(i).toFixed(1)],f=n!==h?`, range ${n}\u2013${h}%`:"";return`Yield ${d.toFixed(1)}% (mean of ${E(i.length,"wafer")}, ${S(c)} dies${s})${f}.`}function ft(e,t,s=[]){const i=[],d=e.level==="wafer"?e.stats.testsConsidered.length:new Set(e.perWafer.flatMap(r=>r.summary.stats.testsConsidered)).size,c=e.level==="wafer"?e.stats.hardBinsConsidered.length:new Set(e.perWafer.flatMap(r=>r.summary.stats.hardBinsConsidered)).size,n=e.stats.testValueAnalysis?.state;if(d>0&&n!=="off"&&i.push(E(d,"test")+(n==="skipped"?" (against their limits only)":"")),c>0&&i.push(E(c,"hard bin")),i.push("the ring, quadrant and sector regions"),e.level==="lot"&&e.stats.waferCount>=3){const r=e.findings.filter(me);i.push(r.length===0?"wafer-to-wafer yield (no outlier wafers)":`wafer-to-wafer yield (${E(r.length,"outlier wafer")})`),e.stats.waferCount>=ye&&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(r=>!t.has(r.id)).length,f=h>0?` ${E(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}const pe=new WeakMap;export function buildSynthesis(e,t={}){const s=`${t.passBins?.join(",")??"-"}|${t.attributes?JSON.stringify(t.attributes):"-"}`;let i=pe.get(e);i||pe.set(e,i=new Map);const d=i.get(s),c=e.findings;if(d&&d.findings.length===c.length&&d.findings.every((h,f)=>h===c[f]))return d.synthesis;const n=ct(e,t);return Object.freeze(n.items),n.items.forEach(Object.freeze),n.also&&(Object.freeze(n.also.items),n.also.items.forEach(Object.freeze),Object.freeze(n.also)),i.set(s,{findings:[...c],synthesis:Object.freeze(n)}),n}function ct(e,t){const s=synthesisSource(e),i=s.findings,d=s.level==="lot"?s.stats.waferCount:void 0,c=t.passBins,n=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&&se(a)&&$e(a.variable.kind,a.variable.bin??NaN,c,!h),r={isPassRate:a=>a.variable.kind==="yield"||c?.length===1&&f(a),isFailBin:a=>c!==void 0&&se(a)&&!f(a)},u=i.filter(a=>ce.has(a.comparison.family)&&T(a)>0&&(r.isPassRate(a)&&a.effect.direction==="lower"||r.isFailBin(a)&&a.effect.direction==="higher")),m=u.some(a=>a.variable.kind==="hardBin")?u.filter(a=>a.variable.kind!=="softBin"):u,p=[],k=new Map,o=new Set;for(const a of Te(m)){const w=a.map(L=>m[L]),B=Pe(w,i,d,r);p.push(B);const C=B.target.kind==="finding"?B.target.id:void 0;k.set(B,te(w.find(L=>L.id===C)??w[0]))}for(const a of i.filter(w=>w.variable.kind==="spatialPattern")){const w=new Set((a.relatedIds??[]).filter(q=>n.has(q))),B=p.find(q=>q.findingIds.some(Z=>w.has(Z)));if(!B)continue;const C=a.level==="lot"&&"waferIndices"in a.highlight?a.highlight.waferIndices?.length:void 0,L=C!==void 0&&d?` on ${C}/${d} wafers`:"";B.text=`${a.variable.label} pattern${L}. ${B.text}`,B.reason=`${a.variable.label} pattern${L}. ${B.reason}`,B.chips.unshift({label:`${a.variable.label} pattern`,target:P(a)}),B.findingIds.unshift(a.id,...[...w].filter(q=>!p.some(Z=>Z.findingIds.includes(q))))}const l=Ge(s),g=new Set,N=Xe(s,g),v=[...p],_=Ze(N,v,k,l);s.level==="lot"&&p.push(...Ye(s)),p.push(..._.map(a=>a.item));const F=new Set(_.filter(a=>l>0&&a.item.diesLost/l>=K).map(a=>a.testNumber));p.push(...tt(i,[...v,..._.map(a=>a.item)],k),...st(i,l),...it(s,g,l),...ot(N.filter(a=>a.passingDies>0&&!F.has(a.testNumber))));let z=[];if(s.level==="lot"){const a=at(s,t.attributes);z=a.compared;for(const w of a.items){const B=w.testNumbers[0],C=w.testNumbers.length===1?p.find(L=>L.target.kind==="test"&&L.target.testNumber===B)??p.find(L=>L.testNumbers.includes(B)):void 0;C?C.text+=`. ${w.text}`:p.push(w)}}const W=qe(s),M=p.filter(a=>l>0&&a.affected/l>=K);for(const a of M)a.shareOfDies=a.affected/l,a.impact=Ke(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 x=M.slice(0,le),I=M.slice(le);for(const a of[...x,...I])for(const w of a.findingIds)o.add(w);const $=I.length>0?{items:I.slice(0,fe),more:Math.max(0,I.length-fe)}:void 0,O=s.level==="lot"?"region, fail bin or wafer":"region or fail bin",H=i.filter(a=>a.severity==="unusual"&&!o.has(a.id)).length,Q=x.length===0?H>0?`No ${O} costs as much as ${A(K)} yield points, though ${E(H,"finding")} below ${H===1?"is":"are"} marked unusual.`:`Nothing stands out: no ${O} costs as much as ${A(K)} yield points.`:void 0;return{headline:lt(s,t),items:x,...$?{also:$}:{},...Q?{nothing:Q}:{},checked:ft(s,o,z)}}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(`
|
|
1
|
+
import{maxOf as be,minOf as $e}from"../core/utils.js";import{isPassBin as Pe,passBinsLabel as Te}from"../core/passBins.js";import{DRIFT_MIN_WAFERS as We}from"./lotDrift.js";import{isOneBinCluster as He}from"./filterFindings.js";import{plainBinTerms as Re}from"../renderer/fmt.js";import{benjaminiHochberg as Ce,normalUpperTail as qe}from"./math.js";import{formatP as ye}from"./groupCompare.js";import{adjustedFits as Ke,comparableGrouping as Ye,mergePartitions as Ge,overlapping as Ue}from"./groupEffects.js";import{ringPlotValue as Ve}from"./dieRegions.js";import{parseRegionKey as Xe}from"./regions.js";import{attributeLabel as ie,buildFacetTable as Je,facetValueOf as Me}from"./facets.js";const Qe=1,Ze=2,et=.5,Ie=3,xe=5,Q=.01,tt=.02,st=.04,it=.15,nt=.4,ue=.5,rt=.1,ot=2,_e=new Set(["ring","quadrant","sector","reticle-position","test-site","cluster","edge-arc"]);function we(e){const s=e.highlight;return"dieKeysByWafer"in s&&s.dieKeysByWafer?Object.values(s.dieKeysByWafer).reduce((i,n)=>i+n.length,0):"dieKeys"in s&&s.dieKeys&&s.dieKeys.length>0?s.dieKeys.length:e.level==="lot"?void 0:e.stats.sampleSizeLeft}function Ne(e){const s=e.highlight,i=new Set;if("dieKeysByWafer"in s&&s.dieKeysByWafer)for(const[n,c]of Object.entries(s.dieKeysByWafer))for(const o of c)i.add(`${n}:${o}`);else if("dieKeys"in s&&s.dieKeys)for(const n of s.dieKeys)i.add(n);return i}const z=e=>Math.abs(e.effect.absoluteDelta??0),K=e=>z(e)*(we(e)??0),W=e=>(e*100).toFixed(1),ae=e=>{const s=e.variable.label.replace(/ \(same dies\)$/,"").replace(/^HBin and SBin (\d+)/,"HBin $1").replace(/^(HBin \d+(?: \([^)]*\))?) and SBin .*$/,"$1");return Re(s)},_=e=>Math.round(e).toLocaleString("en-GB"),H=(e,s,i=`${s}s`)=>`${_(e)} ${e===1?s:i}`;function Z(e){const s=e.comparison.left;return e.comparison.family==="quadrant"&&!/quadrant/i.test(s)?`${s} quadrant`:s}const De=He;function at(e){const s=e.map((f,a)=>a),i=f=>s[f]===f?f:s[f]=i(s[f]),n=e.map(Ne),c=(f,a)=>{const h=n[f].size<=n[a].size?n[f]:n[a],v=h===n[f]?n[a]:n[f];let N=0;for(const w of h)v.has(w)&&N++;return N},o=e.map((f,a)=>a).filter(f=>De(e[f])),r=e.map((f,a)=>a).filter(f=>!De(e[f]));for(let f=0;f<r.length;f++)for(let a=f+1;a<r.length;a++){const h=Math.min(n[r[f]].size,n[r[a]].size);h>0&&c(r[f],r[a])>=ue*h&&(s[i(r[f])]=i(r[a]))}for(const f of o){let a=-1,h=0;for(const v of r){if(ve(e[v])&&e[v].variable.bin!==e[f].variable.bin)continue;const N=c(f,v);N>h&&N>=ue*n[f].size&&N>=ue*K(e[v])&&(a=v,h=N)}a>=0&&(s[f]=i(a))}const $=new Map;return e.forEach((f,a)=>{const h=i(a);($.get(h)??$.set(h,[]).get(h)).push(a)}),[...$.values()]}const ve=e=>e.variable.kind==="hardBin"||e.variable.kind==="softBin",ke=(e,s)=>e.level===s.level&&e.comparison.family===s.comparison.family&&e.comparison.left===s.comparison.left;function lt(e,s,i){const n=o=>s.filter(r=>r.variable.kind===o&&ke(r,e)&&r.effect.direction==="higher"&&i(r));return(n("hardBin").length>0?n("hardBin"):n("softBin")).filter(o=>o!==e).sort((o,r)=>z(r)-z(o))}const ft={ring:"rings",quadrant:"quadrants",sector:"sectors","edge-arc":"edge arcs",cluster:"clusters","reticle-position":"reticle positions","test-site":"test sites"},dt=2;function Be(e){const s=new Map;for(const n of e){const c=n.comparison.family;(s.get(c)??s.set(c,new Set).get(c)).add(Z(n))}const i=[];for(const[n,c]of s)c.size<=dt?i.push(...c):i.push(`${c.size} ${ft[n]??n}`);return i.join(", ")}const ct=e=>e.charAt(0).toUpperCase()+e.slice(1),ee=e=>({kind:"finding",id:e.id}),ut=e=>({label:ct(ae(e)),target:ee(e),...e.variable.bin!==void 0&&(e.variable.kind==="hardBin"||e.variable.kind==="softBin")?{bin:{kind:e.variable.kind,bin:e.variable.bin}}:{}});function he(e){const s=e.comparison.family;return{builtin:s==="quadrant"||s==="sector"?"quadrant":s==="reticle-position"?"reticleCell":s==="test-site"?"site":"ring"}}const Oe=(e,s)=>({chart:"bar",fields:{x:e,y:s,color:{none:!0}},valueLabels:!0,axes:{y:{references:[{stat:"median"}]}}}),pe=e=>({test:e}),Se=(e,s=!1)=>({chart:"histogram",fields:{y:pe(e),color:{none:!0}},...s?{normalCurve:!0}:{}});function ht(e,s,i,n){const c=[...e].sort((u,D)=>K(D)-K(u))[0],o=e.find(u=>n.isPassRate(u)&&ke(u,c))??c,r=e.filter(u=>u!==o),$=o.level==="lot"&&"waferIndices"in o.highlight?o.highlight.waferIndices?.length:void 0,f=$!==void 0&&i?` on ${$}/${i} wafers`:"",a=!n.isPassRate(o),h=o.comparison.family==="sector"?"the other sectors":"the rest of the wafer";let v=a?`${Z(o)}: ${ae(o)} ${W(z(o))} points higher than ${h}${f}`:`${Z(o)}: pass rate ${W(z(o))} points below ${h}${f}`;const N=`${v} \u2014 about ${_(K(o))} dies lost`,w=lt(o,s,n.isFailBin).map(u=>({f:u,share:z(u)/(z(o)||1)})).filter(u=>a||u.share>=rt).slice(0,ot);if(a)for(const{f:u}of w)v+=`, ${ae(u)} ${W(z(u))} points higher`;else if(w.length>0){const u=w.reduce((F,R)=>F+R.share,0)<=1.000000001,D=u&&w[0].share>.5?"mostly ":"";w.forEach(({f:F},R)=>{v+=R===0?`; ${u?D:""}`:", ",v+=ae(F)+(R===0?u?` accounts for ${W(z(F))} of those points`:` is ${W(z(F))} points higher`:u?` for ${W(z(F))}`:` ${W(z(F))} points higher`)})}v+=` \u2014 about ${_(K(o))} dies lost`;const B=r.filter(u=>!ke(u,o));B.length>0&&(v+=` (also seen as ${Be(B)})`);const g=a?ae(o):"pass rate";return{kind:"loss",impact:"low",shareOfDies:0,diesLost:K(o),affected:K(o),measure:"",severity:o.severity,text:v,reason:N,brief:`${Z(o)}: ${g}, ${_(K(o))} dies`,subject:Z(o),target:ee(o),chips:[...a?[o]:[],...w.map(({f:u})=>u)].map(ut),findingIds:[o.id,...r.map(u=>u.id)],testNumbers:[],chart:a?{chart:"bar",fields:{x:he(o),color:{builtin:o.variable.kind==="softBin"?"sbin":"hbin"}},stack:"percent"}:o.level==="lot"?{chart:"heatmap",fields:{x:{builtin:"wafer"},rows:he(o),y:{builtin:"yield"}}}:Oe(he(o),{builtin:"yield"})}}function pt(e,s){return e>=st||s>=nt?"high":e>=tt||s>=it?"medium":"low"}function mt(e){const s=i=>i.stats.yieldPercent==null?0:i.stats.analyzedDies*(1-i.stats.yieldPercent/100);return e.level==="wafer"?s(e):e.perWafer.reduce((i,n)=>i+s(n.summary),0)}function gt(e){return e.level==="wafer"?e.stats.analyzedDies:e.perWafer.reduce((s,i)=>s+i.summary.stats.analyzedDies,0)}const Fe=e=>e.id.startsWith("inter-wafer:yield:");function bt(e){const s=[];for(const i of e.findings){if(!Fe(i)||i.effect.direction!=="lower")continue;const n="waferIndices"in i.highlight?i.highlight.waferIndices?.[0]:void 0,c=n===void 0?void 0:e.perWafer.find(o=>o.waferIndex===n)?.summary.stats.analyzedDies;c!==void 0&&s.push({kind:"loss",impact:"low",shareOfDies:0,diesLost:z(i)*c,affected:z(i)*c,measure:"",severity:i.severity,text:`${i.summary.replace(/ percentage points lower than the lot median$/," points below the lot median")} \u2014 about ${_(z(i)*c)} dies lost`,reason:`${i.summary.replace(/ percentage points lower than the lot median$/," points below the lot median")} \u2014 about ${_(z(i)*c)} dies lost`,brief:`${i.comparison.left}: yield, ${_(z(i)*c)} dies`,subject:i.comparison.left,target:ee(i),chips:[],findingIds:[i.id],testNumbers:[],chart:{chart:"control",fields:{x:{builtin:"waferOrder"},y:{builtin:"yield"}}}})}return s}function $t(e,s){if(e.level==="wafer"){const o=e.stats.testFailures?.[s];return o?{keys:new Set(o.dieKeys),lost:o.lostDies}:void 0}const i=new Set;let n=0,c=!1;for(const o of e.perWafer){const r=o.summary.stats.testFailures?.[s];if(r){c=!0,n+=r.lostDies;for(const $ of r.dieKeys)i.add(`${o.waferIndex}:${$}`)}}return c?{keys:i,lost:n}:void 0}function yt(e,s){const i=e.stats,n=[],c=r=>Oe({builtin:e.level==="lot"?"wafer":"ring"},{passRate:r}),o=(r,$,f,a,h,v,N=h,w=!1)=>{if(f<=0||a<=0)return;s.add(r);const B=$t(e,r),g=B?Math.min(B.lost,f):f,u=f-g,D=f/a*100;n.push({testNumber:r,label:$,verb:h,plainVerb:N,failDies:f,passingDies:u,keys:B?.keys,item:{kind:"loss",impact:"low",shareOfDies:0,diesLost:g,affected:g,measure:"",severity:"info",text:`${$} ${h} on ${_(f)} of ${_(a)} dies (${D.toFixed(1)}%)`+(u>0?`; ${_(u)} of them are binned as passing, so about ${_(g)} dies lost`:""),reason:`${$} ${h} on ${_(f)} of ${_(a)} dies (${D.toFixed(1)}%)`,brief:u>0?`${$}: ${v}, ${_(g)} dies lost`:`${$}: ${_(f)} dies ${v}`,subject:$,target:{kind:"test",testNumber:r},chips:[],findingIds:[],testNumbers:[r],chart:w||e.level==="lot"?c(r):Se(r)}})};for(const r of i.testSpecYield??[]){const $=r.failHighDies===0?"is below its low limit":r.failLowDies===0?"is above its high limit":`is outside its limits (${_(r.failLowDies)} low, ${_(r.failHighDies)} high)`;o(r.testNumber,r.label,r.failLowDies+r.failHighDies,r.totalDies,$,"outside limits",r.failLowDies>0&&r.failHighDies>0?"is outside its limits":$)}for(const r of i.functionalYield??[])o(r.testNumber,r.label,r.failDies,r.totalDies,"fails","fail","fails",!0);return n}const wt=.5,Nt=2,vt=2,le=5;function kt(e,s,i,n){const c=new Set,o=new Map,r=new Map,$=[...e].sort((f,a)=>a.failDies-f.failDies||f.testNumber-a.testNumber);for(const f of $){const a=f.keys;if(n>0&&f.failDies/n<Q){c.add(f);continue}let h;if(a&&a.size>0&&n>0)for(const w of s){const B=i.get(w);if(!B||B.size===0)continue;let g=0;for(const D of a)B.has(D)&&g++;const u=g/a.size;u>=wt&&u>=Nt*(B.size/n)&&(!h||g>h.inside)&&(h={item:w,inside:g})}if(!h){c.add(f);continue}const v=o.get(h.item)??0;if(v<vt){const w=h.inside===f.failDies?"all":_(h.inside);h.item.text+=`. ${f.label} ${f.verb} on ${H(f.failDies,"die")}, ${w} of them in ${h.item.subject}`,o.set(h.item,v+1)}const N=r.get(h.item)??0;N<le?(h.item.chips.push({label:f.label,target:f.item.target}),r.set(h.item,N+1)):h.item.moreTests=(h.item.moreTests??0)+1,h.item.testNumbers.push(f.testNumber)}return e.filter(f=>c.has(f))}function te(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 me=e=>Math.abs(e)<et?0:Math.min(1,(Math.abs(e)/Ze)**2),Y=e=>`${Math.abs(e).toFixed(1)}\u03C3`,St=e=>e.variable.kind==="test"&&e.variable.measure!=="limitFailRate"&&_e.has(e.comparison.family)&&Number.isFinite(e.effect.effectSize??NaN)&&!e.id.startsWith("drift:");function Mt(e,s,i){const n=new Map;for(const r of e)!St(r)||r.variable.index===void 0||(n.get(r.variable.index)??n.set(r.variable.index,[]).get(r.variable.index)).push(r);const c=r=>(we(r)??r.stats.sampleSizeLeft)*me(r.effect.effectSize??0),o=[];for(const[r,$]of[...n].sort((f,a)=>f[0]-a[0])){const f=[...$].sort((g,u)=>c(u)-c(g)),a=f[0],h=a.effect.effectSize??0;if(c(a)===0)continue;const v=Ne(a);let N=s.find(g=>g.target.kind==="test"&&g.target.testNumber===r)??s.find(g=>g.testNumbers.includes(r))??s.find(g=>f.some(u=>g.findingIds.includes(u.id))),w=0;for(const g of N?[]:s){const u=i.get(g);if(!u||u.size===0||v.size===0)continue;let D=0;for(const F of v)u.has(F)&&D++;D>=ue*Math.min(u.size,v.size)&&D>w&&(w=D,N=g)}if(N){N.text+=`. ${a.summary}`,N.testNumbers.includes(r)||(N.chips.filter(u=>u.target.kind==="test"||u.shift).length<le?N.chips.push({label:a.variable.label,target:ee(a),shift:!0}):N.moreTests=(N.moreTests??0)+1,N.testNumbers.push(r));for(const g of f)N.findingIds.includes(g.id)||N.findingIds.push(g.id);continue}const B=we(a)??a.stats.sampleSizeLeft;o.push(te({affected:c(a),measure:Y(h),severity:a.severity,text:`${a.summary}: a shift of ${Y(h)} over ${H(B,"die")}`+(f.length>1?` (also seen as ${Be(f.slice(1))})`:""),reason:`${a.summary}: a shift of ${Y(h)} over ${H(B,"die")}`,brief:`${Z(a)}: ${a.variable.label} ${a.effect.direction}`,subject:Z(a),target:ee(a),findingIds:f.map(g=>g.id),testNumbers:[r],chart:{chart:"box",fields:{x:he(a),y:pe(r),color:{none:!0}},axes:{y:{references:[{stat:"median"}]}}}}))}return o}function It(e,s){return e.filter(i=>i.id.startsWith("drift:")).map(i=>{const n=i.variable.kind==="yield",c=i.effect.effectSize??0;return te({affected:s*(n?Math.abs(c):me(c)),measure:n?`${W(Math.abs(c))} pts`:Y(c),severity:i.severity,text:i.summary,brief:`${i.variable.label}: drifts across the wafers`,subject:i.variable.label,target:ee(i),findingIds:[i.id],...i.variable.index!==void 0?{testNumbers:[i.variable.index]}:{},chart:{chart:"control",fields:{x:{builtin:"waferOrder"},y:n||i.variable.index===void 0?{builtin:"yield"}:pe(i.variable.index)}}})})}function xt(e,s,i){return(e.stats.capability??[]).filter(n=>n.hasSpec&&n.ppk!==null&&n.ppk!==void 0&&n.ppk<Qe&&!s.has(n.testNumber)).map(n=>{const c=n.ppk,o=qe(3*c);return te({affected:i*o,measure:`Ppk ${c.toFixed(2)}`,severity:"notable",text:`${n.label} has Ppk ${c.toFixed(2)} against its limits: a spread that would put about ${W(o)}% of the dies outside them`,brief:`${n.label}: Ppk ${c.toFixed(2)}`,subject:n.label,target:{kind:"test",testNumber:n.testNumber},testNumbers:[n.testNumber],chart:Se(n.testNumber,!0)})})}const ge=.05,_t=8,Le=.01,Dt=.05,Bt=.25,Ot=1,Ft=3,je=e=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`;function Lt(e,s,i,n=[]){const c={items:[],compared:[],possible:[]},o=e.perWafer;if(o.length<4)return c;const r=Je(o.map(t=>({metadata:t.summary.wafer,dieCount:t.summary.stats.totalDies})),{facetableOnly:!0,curation:s}).filter(t=>t.splittable).map(t=>({key:t.key,groupOf:o.map(d=>Me(d.summary.wafer,t.key,s))})).filter(t=>Ye(t.groupOf));if(r.length===0)return c;const $=Ge(r),f=t=>e.perWaferTestStats?.find(d=>d.waferIndex===t.waferIndex)?.tests??t.summary.stats.perTestStats??[],a=o.map(t=>new Map(f(t).filter(d=>d.count>=2&&Number.isFinite(d.mean)).map(d=>[d.testNumber,d]))),h=new Map;for(const t of a)for(const[d,p]of t)h.has(d)||h.set(d,p.label);const v=o.map(t=>t.summary.stats.analyzedDies),N=o.map(t=>t.summary.stats.yieldPercent===null?void 0:t.summary.stats.yieldPercent/100),w=o.map(t=>{const d=t.summary.stats.hardBinCounts,p=d?Object.values(d).reduce((m,y)=>m+y,0):0;return d&&p>0?new Map(Object.entries(d).map(([m,y])=>[Number(m),y/p])):void 0}),B=(t,d,p,m)=>{let y;for(const[x,L]of t){const k=L.map(d),j=[...t].filter(([S])=>S!==x).flatMap(([,S])=>S.map(d));if(k.length<2||j.length<2)continue;const P=k.reduce((S,O)=>S+O,0)/k.length-j.reduce((S,O)=>S+O,0)/j.length,b=P/p;(!y||Math.abs(b)>Math.abs(y.d)+1e-9||Math.abs(Math.abs(b)-Math.abs(y.d))<=1e-9&&(L.length<y.groupWafers||L.length===y.groupWafers&&P>0))&&(y=m(x,L,b,P>0))}if(y&&t.size===2){const[x,L]=[...t].find(([k])=>k!==y.group);y.other={group:x,wafers:L.length}}return y},g=[],u=[],D=[];for(const[t,d]of[...h].sort((p,m)=>p[0]-m[0])){const p=a.flatMap(y=>{const x=y.get(t);return x&&Number.isFinite(x.stddev)?[x.stddev**2]:[]}),m=p.length?Math.sqrt(p.reduce((y,x)=>y+x,0)/p.length):NaN;m>0&&D.push({testNumber:t,label:d,values:a.map(y=>y.get(t)?.mean),scale:m})}D.push({testNumber:NaN,label:"Yield",values:N,scale:1,scope:v});const F=[...e.stats.regionYield?.ring??[]].sort((t,d)=>t.yieldPercent-d.yieldPercent)[0];if(F&&o.length>0){const t=o.map(d=>{const p=d.summary.stats.regionYield?.ring?.find(m=>m.key===F.key);return p?p.yieldPercent/100:void 0});if(t.every(d=>d!==void 0)){const d=o.map(p=>p.summary.stats.regionYield?.ring?.find(m=>m.key===F.key)?.n??0);D.push({testNumber:NaN,label:`${F.label} pass rate`,values:t,scale:1,region:F.label,regionValue:Ve(Xe(F.key).ring),scope:d})}}for(const t of D)for(const{partition:d,used:p,fitted:m,allowedFor:y}of Ke(t.values,$)){const x=d.id,L=d.keys;if(!m)continue;const k=B(m.byGroup,b=>p[b],t.scale,(b,A,S,O)=>({part:x,keys:L,testNumber:t.testNumber,label:t.label,group:b,members:A,groupWafers:A.length,groupDies:A.reduce((T,I)=>T+v[I],0),d:S,higher:O,p:m.p,...t.region?{region:t.region,regionValue:t.regionValue}:{},...y?{allowedFor:y}:{}}));if(!k)continue;const j=k.members.map(b=>p[b]),P=[...m.byGroup].filter(([b])=>b!==k.group).flatMap(([,b])=>b.map(A=>p[A]));if(t.scope){const b=S=>S.reduce((O,T)=>O+t.scope[T],0),A=[...m.byGroup].filter(([S])=>S!==k.group).flatMap(([,S])=>S);k.lost=(k.higher?b(A):b(k.members))*Math.abs(k.d)}if(k.separated=$e(j)>be(P)||be(j)<$e(P),Number.isNaN(t.testNumber)){if(i&&!t.region){let b=0;const A=new Set(w.flatMap(O=>O?[...O.keys()]:[])),S=o.map((O,T)=>T).filter(O=>!k.members.includes(O)&&N[O]!==void 0);for(const O of A){if(i.includes(O))continue;const T=U=>U.reduce((ze,Ae)=>ze+(w[Ae]?.get(O)??0),0)/Math.max(1,U.length),I=(T(k.members)-T(S))*(k.higher?-1:1);I>b&&(b=I,k.bin=O)}}u.push(k)}else g.push(k)}const R=Ce([...g,...u].map(t=>t.p)),C=t=>R[t],ne=new Map;g.forEach((t,d)=>{const p=t.groupDies*me(t.d);C(d)>=ge||p===0||(ne.get(t.part)??ne.set(t.part,[]).get(t.part)).push({c:t,q:C(d),weight:p})});const fe=[...new Set([...g,...u].flatMap(t=>t.keys))].map(t=>ie(t,s)),q=t=>je(t.map(d=>ie(d,s))),G=t=>{const d=`${ie(t.keys[0],s)} ${t.group}`;if(t.keys.length===1)return d;const p=o[t.members[0]].summary.wafer,m=t.keys.slice(1).map(y=>`${ie(y,s)} ${Me(p,y,s)??""}`.trim());return`${d} (${je(m)} group${m.length===1?"s":""} the same wafers)`},V=t=>t.allowedFor?`, allowing for ${q(t.allowedFor)}`:"",X=t=>{const d=$.find(m=>m.id===t),p=d?Ue(d,$):[];return p.length===0?"":`. ${p.map(m=>`${q(m.partition.keys.slice(0,1))} puts ${m.agree} of ${m.of} wafers in the same groups`).join("; ")}, so the wafers cannot fully tell ${p.length===1?"the two":"them"} apart`},J=t=>`${ie(t.keys[0],s)} ${t.other.group}`,se=t=>t.other?`${t.label} is ${t.higher?"higher":"lower"} on ${G(t)} than on ${J(t)} (${t.groupWafers} and ${t.other.wafers} wafers)`:`${t.label} is ${t.higher?"higher":"lower"} on ${G(t)} (${t.groupWafers} of ${o.length} wafers) than on the other wafers`,re=[...ne].map(([t,d])=>{d.sort((I,U)=>Math.abs(U.c.d)-Math.abs(I.c.d)||U.weight-I.weight||I.c.testNumber-U.c.testNumber);const p=d.reduce((I,U)=>Math.max(I,U.weight),0),m=d[0].c.keys,y=m[0],x=q(m),[L,...k]=d,j=L.c,P=`${se(j)}: a shift of ${Y(j.d)}${V(j)}`,b=k.slice(0,2).map(({c:I})=>`${I.label} ${I.higher?"higher":"lower"} on ${I.keys.length>1?ie(I.keys[0],s)+" ":""}${I.group} (${Y(I.d)})`),A=k.length-b.length,S=d.length,O=(S===1?`${P}, each wafer one value (q ${ye(L.q)})`:`${S} tests differ by ${x}. Largest: ${P}, each wafer one value (q ${ye(L.q)}); next: ${b.join(", ")}${A>0?`, and ${A} more`:""}`)+X(t),T=te({affected:p,measure:Y(j.d),severity:L.q<.001?"unusual":"notable",text:O,reason:S===1?P:`${S} tests differ by ${x}. Largest: ${P}`,brief:S===1?`${x} ${j.group}: ${j.label} ${j.higher?"higher":"lower"}`:`${x}: ${S} tests differ`,subject:x,target:{kind:"test",testNumber:j.testNumber},testNumbers:d.map(I=>I.c.testNumber),chart:S>1?{chart:"heatmap",level:"wafer",aggregate:"mean",normalize:"zscore",fields:{x:{meta:y},y:{tests:d.slice(0,_t).map(I=>I.c.testNumber)}}}:{chart:"box",level:"wafer",aggregate:"mean",fields:{x:{meta:y},y:pe(j.testNumber),color:{meta:y}}}});return S>1&&(T.chips=d.slice(0,le).map(({c:I})=>({label:`${I.label} ${Y(I.d)}`,target:{kind:"test",testNumber:I.testNumber}})),S>le&&(T.moreTests=S-le)),T});u.forEach((t,d)=>{const p=C(g.length+d),m=t.lost??t.groupDies*Math.abs(t.d);if(p>=ge||Math.abs(t.d)<Le)return;const y=q(t.keys),x=`${(Math.abs(t.d)*100).toFixed(1)} points`,L=`${t.bin!==void 0?`, mostly in hard bin ${t.bin}`:""}${V(t)}`,k=t.other?`${t.label} is ${x} ${t.higher?"higher":"lower"} on ${G(t)} than on ${J(t)} (${t.groupWafers} and ${t.other.wafers} wafers)`:`${t.label} is ${x} ${t.higher?"higher":"lower"} on ${G(t)} (${t.groupWafers} of ${o.length} wafers) than on the other wafers`;re.push(te({affected:m,measure:x,severity:p<.001?"unusual":"notable",text:`${k}${L}, each wafer one value (q ${ye(p)})${X(t.part)}`,reason:`${k}${L}`,brief:`${y} ${t.group}: ${t.region?"ring pass rate":"yield"} ${t.higher?"higher":"lower"}`,subject:y,target:{kind:"group",field:t.keys[0],fields:t.keys},testNumbers:[],chart:{chart:"bar",fields:{x:{meta:t.keys[0]},y:{builtin:"yield"},color:{meta:t.keys[0]}},valueLabels:!0,...t.region?{where:{conditions:[{field:{builtin:"ring"},values:[t.regionValue??t.region]}]}}:{}}}))});const de=v.reduce((t,d)=>t+d,0),oe=new Set([...g.filter((t,d)=>C(d)<ge&&t.groupDies*me(t.d)>0).map(t=>t.part),...u.filter((t,d)=>C(g.length+d)<ge&&Math.abs(t.d)>=Le).map(t=>t.part)]),ce=[...g.filter(t=>Math.abs(t.d)>=Ot),...u.filter(t=>(t.lost??0)>=Math.min(Q*de,...n.map(d=>Bt*d)))].filter(t=>t.separated&&t.p<Dt&&!oe.has(t.part)),l=new Map;for(const t of ce)(l.get(`${t.part}|${t.group}`)??l.set(`${t.part}|${t.group}`,[]).get(`${t.part}|${t.group}`)).push(t);const M=[],E=g.length+u.length;for(const t of l.values()){const d=t.find(b=>Number.isNaN(b.testNumber)),p=t.filter(b=>!Number.isNaN(b.testNumber)||!d||b.higher===d.higher);if(p.length<2)continue;const m=p[0],y=b=>Number.isNaN(b.testNumber)?`${b.label} ${b.higher?"higher":"lower"} by ${(Math.abs(b.d)*100).toFixed(1)} points`:`${b.label} ${b.higher?"higher":"lower"} (${Y(b.d)})`,x=m.other?`than on ${J(m)} (${m.groupWafers} and ${m.other.wafers} wafers)`:`than on the other wafers (${m.groupWafers} of ${o.length})`,L=`${G(m)}: ${p.map(y).join("; ")} ${x}`,k=q(m.keys),j=p.reduce((b,A)=>Math.max(b,A.lost??0),0),P=te({affected:j,measure:`${p.length} measures`,severity:"info",text:`Possibly ${L}. No wafer of the group overlaps the others on ${p.length===2?"either":`any of ${p.length}`}, but the sample is too small to confirm it once ${E} comparisons are allowed for`,reason:`Possibly ${L}`,brief:`${k} ${m.group}: possible, not confirmed`,subject:k,target:{kind:"group",field:m.keys[0],fields:m.keys},testNumbers:p.filter(b=>!Number.isNaN(b.testNumber)).map(b=>b.testNumber),chart:{chart:"bar",fields:{x:{meta:m.keys[0]},y:{builtin:"yield"},color:{meta:m.keys[0]}},valueLabels:!0}});M.push(P)}return M.sort((t,d)=>d.affected-t.affected),{items:re,compared:fe,possible:M.slice(0,Ft)}}export function groupColouredChart(e,s){const i=e.fields?.x,n=e.fields?.color;return!s||e.chart!=="bar"||!i||Array.isArray(i)||!("builtin"in i)||i.builtin!=="wafer"||!n||!("none"in n)?e:{...e,fields:{...e.fields,x:[{slot:"groupBy"},{builtin:"wafer"}],color:{follow:"groupBy"}}}}function jt(e){return e.map(s=>te({affected:s.passingDies,measure:"",severity:"notable",text:`${s.label} ${s.plainVerb} on ${H(s.passingDies,"die")} binned as passing`,brief:`${s.label}: ${_(s.passingDies)} dies out of limits, binned passing`,subject:s.label,target:s.item.target,testNumbers:[s.testNumber],chart:Se(s.testNumber)}))}function Et(e,s){const i=s.passBins&&s.passBins.length>0?`; pass ${Te([s.passBins])}`:"";if(e.level==="wafer"){const a=e.stats.yieldPercent;return a==null?`${_(e.stats.totalDies)} dies, no bin data to judge yield by.`:`Yield ${a.toFixed(1)}% (${_(e.stats.totalDies)} dies${i}).`}const n=e.lotYieldSeries.map(a=>a.yieldPercent).filter(a=>typeof a=="number");if(n.length===0)return`${H(e.stats.waferCount,"wafer")}, no bin data to judge yield by.`;const c=n.reduce((a,h)=>a+h,0)/n.length,o=e.perWafer.reduce((a,h)=>a+h.summary.stats.totalDies,0),[r,$]=[$e(n).toFixed(1),be(n).toFixed(1)],f=r!==$?`, range ${r}\u2013${$}%`:"";return`Yield ${c.toFixed(1)}% (mean of ${H(n.length,"wafer")}, ${_(o)} dies${i})${f}.`}function zt(e,s,i=[]){const n=[],c=e.level==="wafer"?e.stats.testsConsidered.length:new Set(e.perWafer.flatMap(a=>a.summary.stats.testsConsidered)).size,o=e.level==="wafer"?e.stats.hardBinsConsidered.length:new Set(e.perWafer.flatMap(a=>a.summary.stats.hardBinsConsidered)).size,r=e.stats.testValueAnalysis?.state;if(c>0&&r!=="off"&&n.push(H(c,"test")+(r==="skipped"?" (against their limits only)":"")),o>0&&n.push(H(o,"hard bin")),n.push("the ring, quadrant and sector regions"),e.level==="lot"&&e.stats.waferCount>=3){const a=e.findings.filter(Fe);n.push(a.length===0?"wafer-to-wafer yield (no outlier wafers)":`wafer-to-wafer yield (${H(a.length,"outlier wafer")})`),e.stats.waferCount>=We&&n.push("the yield trend across the wafers (input order)"),i.length&&n.push(`the tests between the groups of ${i.join(", ")} (each wafer one value)`)}const $=e.findings.filter(a=>!s.has(a.id)).length,f=$>0?` ${H($,"smaller finding")} not listed above.`:" Nothing else was found.";return`Compared: ${n.join(", ")}.${f}`}export function synthesisSource(e){return e.level==="lot"&&e.perWafer.length===1?e.perWafer[0].summary:e}const Ee=new WeakMap;export function buildSynthesis(e,s={}){const i=`${s.passBins?.join(",")??"-"}|${s.attributes?JSON.stringify(s.attributes):"-"}`;let n=Ee.get(e);n||Ee.set(e,n=new Map);const c=n.get(i),o=e.findings;if(c&&c.findings.length===o.length&&c.findings.every(($,f)=>$===o[f]))return c.synthesis;const r=At(e,s);return Object.freeze(r.items),r.items.forEach(Object.freeze),r.possible&&(r.possible.forEach(Object.freeze),Object.freeze(r.possible)),r.also&&(Object.freeze(r.also.items),r.also.items.forEach(Object.freeze),Object.freeze(r.also)),n.set(i,{findings:[...o],synthesis:Object.freeze(r)}),r}function At(e,s){const i=synthesisSource(e),n=i.findings,c=i.level==="lot"?i.stats.waferCount:void 0,o=s.passBins,r=new Map(n.map(l=>[l.id,l])),$=(i.level==="wafer"?[i]:i.perWafer.map(l=>l.summary)).every(l=>(l.stats.hardBinsConsidered??[]).length===0),f=l=>o!==void 0&&ve(l)&&Pe(l.variable.kind,l.variable.bin??NaN,o,!$),a={isPassRate:l=>l.variable.kind==="yield"||o?.length===1&&f(l),isFailBin:l=>o!==void 0&&ve(l)&&!f(l)},h=n.filter(l=>_e.has(l.comparison.family)&&K(l)>0&&(a.isPassRate(l)&&l.effect.direction==="lower"||a.isFailBin(l)&&l.effect.direction==="higher")),N=h.some(l=>l.variable.kind==="hardBin")?h.filter(l=>l.variable.kind!=="softBin"):h,w=[],B=new Map,g=new Set;for(const l of at(N)){const M=l.map(d=>N[d]),E=ht(M,n,c,a);w.push(E);const t=E.target.kind==="finding"?E.target.id:void 0;B.set(E,Ne(M.find(d=>d.id===t)??M[0]))}for(const l of n.filter(M=>M.variable.kind==="spatialPattern")){const M=new Set((l.relatedIds??[]).filter(p=>r.has(p))),E=w.find(p=>p.findingIds.some(m=>M.has(m)));if(!E)continue;const t=l.level==="lot"&&"waferIndices"in l.highlight?l.highlight.waferIndices?.length:void 0,d=t!==void 0&&c?` on ${t}/${c} wafers`:"";E.text=`${l.variable.label} pattern${d}. ${E.text}`,E.reason=`${l.variable.label} pattern${d}. ${E.reason}`,E.chips.unshift({label:`${l.variable.label} pattern`,target:ee(l)}),E.findingIds.unshift(l.id,...[...M].filter(p=>!w.some(m=>m.findingIds.includes(p))))}const u=gt(i),D=new Set,F=yt(i,D),R=[...w],C=kt(F,R,B,u);i.level==="lot"&&w.push(...bt(i)),w.push(...C.map(l=>l.item));const ne=new Set(C.filter(l=>u>0&&l.item.diesLost/u>=Q).map(l=>l.testNumber));w.push(...Mt(n,[...R,...C.map(l=>l.item)],B),...It(n,u),...xt(i,D,u),...jt(F.filter(l=>l.passingDies>0&&!ne.has(l.testNumber))));let fe=[],q=[];if(i.level==="lot"){const l=Lt(i,s.attributes,s.passBins,w.filter(M=>M.kind==="loss").map(M=>M.diesLost));fe=l.compared,q=l.possible;for(const M of l.items){const E=M.testNumbers[0],t=M.testNumbers.length===1?w.find(d=>d.target.kind==="test"&&d.target.testNumber===E)??w.find(d=>d.testNumbers.includes(E)):void 0;t?t.text+=`. ${M.text}`:w.push(M)}}const G=mt(i),V=w.filter(l=>u>0&&l.affected/u>=Q);for(const l of V)l.shareOfDies=l.affected/u,l.impact=pt(l.shareOfDies,l.kind==="loss"&&G>0?l.diesLost/G:0),l.measure||(l.measure=`${(l.shareOfDies*100).toFixed(1)}%`);const X=l=>`${String(l.testNumbers[0]??"").padStart(10,"0")}${l.findingIds[0]??""}`;V.sort((l,M)=>M.affected-l.affected||(X(l)<X(M)?-1:X(l)>X(M)?1:0));const J=V.slice(0,Ie),se=V.slice(Ie);for(const l of[...J,...se])for(const M of l.findingIds)g.add(M);const re=se.length>0?{items:se.slice(0,xe),more:Math.max(0,se.length-xe)}:void 0,de=i.level==="lot"?"region, fail bin or wafer":"region or fail bin",oe=n.filter(l=>l.severity==="unusual"&&!g.has(l.id)).length,ce=J.length===0?oe>0?`No ${de} costs as much as ${W(Q)} yield points, though ${H(oe,"finding")} below ${oe===1?"is":"are"} marked unusual.`:`Nothing stands out: no ${de} costs as much as ${W(Q)} yield points.`:void 0;return{headline:Et(i,s),items:J,...re?{also:re}:{},...q.length?{possible:q}:{},...ce?{nothing:ce}:{},checked:zt(i,g,fe)}}export const synthesisKey=e=>{if(e.target.kind==="finding")return`finding:${e.target.id}`;if(e.target.kind==="group")return`group:${e.target.field}${isGroupYieldItem(e)?"":":ring"}`;const s=groupedByField(e);return`test:${e.target.testNumber}${s!==void 0?`:by:${s}`:""}`},groupedByField=e=>{const s=e.chart.fields?.x;return s&&!Array.isArray(s)&&"meta"in s?s.meta:void 0},isGroupYieldItem=e=>e.target.kind==="group"&&!e.chart.where,SYNTHESIS_POSSIBLE_HEADING="Possible, not confirmed",SYNTHESIS_ALSO_HEADING=`Also, each affecting at least ${(Q*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((s,i)=>`${i+1}. ${s.text}`),...e.also?[`${SYNTHESIS_ALSO_HEADING}: ${e.also.items.map(s=>`${s.brief} (${synthesisRowShare(s)})`).join("; ")}${e.also.more?`; and ${e.also.more} more`:""}.`]:[],...e.possible?[`${SYNTHESIS_POSSIBLE_HEADING}:`,...e.possible.map(s=>`- ${s.text}`)]:[],e.checked].join(`
|
|
2
2
|
`)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wafertools/wafermap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.1",
|
|
4
4
|
"description": "Interactive wafer map visualization and yield analysis for semiconductor test data. Hard bins, soft bins, test values, retests, edge exclusion, reticle overlays, spatial statistics, failure clustering, and lot-level trend analysis — pure ES modules, no runtime dependencies, no server required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|