@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
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Die } from '../core/dies.js';
|
|
2
|
+
import { type TestDef } from '../renderer/buildWaferMap.js';
|
|
3
|
+
/** Robust sigmas each side of the median. */
|
|
4
|
+
export declare const PAT_K = 6;
|
|
5
|
+
/** The interquartile range of a normal distribution in standard deviations. */
|
|
6
|
+
export declare const PAT_IQR_SIGMA = 1.35;
|
|
7
|
+
/** Passing values a wafer needs on a test before its PAT limits mean anything. */
|
|
8
|
+
export declare const PAT_MIN_DIES = 30;
|
|
9
|
+
/**
|
|
10
|
+
* Quartile skewness, (Q3 + Q1 − 2 × median) / (Q3 − Q1), from which a test's values count as lopsided: 0 for a symmetric
|
|
11
|
+
* distribution, ±1 at the extreme. Symmetric limits fit such a test badly (about 0.17 for a log-normal of shape 0.5,
|
|
12
|
+
* 0.33 for shape 1).
|
|
13
|
+
*/
|
|
14
|
+
export declare const PAT_SKEW_WARN = 0.2;
|
|
15
|
+
export interface PatLimit {
|
|
16
|
+
testNumber: number;
|
|
17
|
+
lo: number;
|
|
18
|
+
hi: number;
|
|
19
|
+
median: number;
|
|
20
|
+
robustSigma: number;
|
|
21
|
+
/** Passing values the limits were set from. */
|
|
22
|
+
n: number;
|
|
23
|
+
/** Which of the test's limits bound them: spec limits when it has both, else test limits. */
|
|
24
|
+
basis: 'spec' | 'test';
|
|
25
|
+
/** The ±6σ band reached past the test's own limit at that end, so the PAT limit is the test's limit there. */
|
|
26
|
+
clippedLo: boolean;
|
|
27
|
+
clippedHi: boolean;
|
|
28
|
+
/** Quartile skewness of the values the limits were set from (see `PAT_SKEW_WARN`). */
|
|
29
|
+
skew: number;
|
|
30
|
+
}
|
|
31
|
+
export interface WaferPat {
|
|
32
|
+
/** PAT limits by test number, for the tests that have them on this wafer. */
|
|
33
|
+
limits: Map<number, PatLimit>;
|
|
34
|
+
/** Tests with limits that got no PAT limits on this wafer, and why. */
|
|
35
|
+
skipped: Array<{
|
|
36
|
+
testNumber: number;
|
|
37
|
+
reason: 'few-values' | 'no-spread';
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export type PatVerdict = 'within' | 'outlier' | 'fails';
|
|
41
|
+
/** A die's verdict and the tests behind it (the outlying ones, or the ones outside their limits; empty otherwise). */
|
|
42
|
+
export interface DiePat {
|
|
43
|
+
verdict?: PatVerdict;
|
|
44
|
+
tests: number[];
|
|
45
|
+
}
|
|
46
|
+
/** The reader's words for each verdict, in the order they are listed. */
|
|
47
|
+
export declare const PAT_VERDICT_LABEL: Readonly<Record<PatVerdict, string>>;
|
|
48
|
+
export declare const PAT_VERDICT_ORDER: readonly string[];
|
|
49
|
+
/** The tests PAT judges: parametric, with both limits. */
|
|
50
|
+
export declare function patTests(testDefs: readonly TestDef[]): TestDef[];
|
|
51
|
+
/**
|
|
52
|
+
* The PAT limits of one wafer, set from its own dies (all of them: pass the wafer's full die list, not a selection,
|
|
53
|
+
* since a part of a wafer is not the population the limits describe). Cached per die list.
|
|
54
|
+
*/
|
|
55
|
+
export declare function waferPatLimits(dies: readonly Die[], testDefs: readonly TestDef[], passBins: readonly number[]): WaferPat;
|
|
56
|
+
/** Each die's PAT verdict on its wafer, index-aligned with `dies`. Cached with the limits. */
|
|
57
|
+
export declare function waferPatVerdicts(dies: readonly Die[], testDefs: readonly TestDef[], passBins: readonly number[]): DiePat[];
|
|
58
|
+
//# sourceMappingURL=pat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{diePassStatus as v}from"../core/dies.js";import{testValuesReader as y}from"../core/dieTable.js";import{isParametricTest as F}from"../renderer/buildWaferMap.js";import{fiveNumberSummary as I}from"./math.js";import{capabilityLimits as x}from"./capability.js";export const PAT_K=6,PAT_IQR_SIGMA=1.35,PAT_MIN_DIES=30,PAT_SKEW_WARN=.2,PAT_VERDICT_LABEL={within:"Within PAT limits",outlier:"PAT outlier",fails:"Fails (bin or limits)"},PAT_VERDICT_ORDER=[PAT_VERDICT_LABEL.within,PAT_VERDICT_LABEL.outlier,PAT_VERDICT_LABEL.fails];export function patTests(r){return r.filter(i=>F(i)&&x(i)!==void 0)}const E=new WeakMap;function q(r,i,m){const A=[...m].sort((t,e)=>t-e).join(","),b=E.get(r);if(b&&b.defs===i&&b.passKey===A)return b;const a=patTests(i),p=a.map(t=>x(t)),P=y(a.map(t=>t.testNumber)),T=new Set(m),d=new Float64Array(a.length),_=a.map(()=>[]);for(const t of r)if(v(t,T)===!0){P(t,d);for(let e=0;e<a.length;e++){const n=d[e];Number.isFinite(n)&&n>=p[e].lsl&&n<=p[e].usl&&_[e].push(n)}}const N=new Map,w=[];a.forEach((t,e)=>{const{lsl:n,usl:f,basis:h}=p[e],c=_[e];if(c.length<PAT_MIN_DIES){w.push({testNumber:t.testNumber,reason:"few-values"});return}const s=I(Float64Array.from(c)),o=(s.q3-s.q1)/PAT_IQR_SIGMA;if(!(o>0)){w.push({testNumber:t.testNumber,reason:"no-spread"});return}const l=s.median-PAT_K*o,u=s.median+PAT_K*o;N.set(t.testNumber,{testNumber:t.testNumber,lo:Math.max(l,n),hi:Math.min(u,f),median:s.median,robustSigma:o,n:c.length,basis:h,clippedLo:l<n,clippedHi:u>f,skew:(s.q3+s.q1-2*s.median)/(s.q3-s.q1)})});const R=a.map(t=>N.get(t.testNumber)),S=r.map(t=>{const e=v(t,T)===!1,n=P(t,d);let f=!1;const h=[],c=[];return a.forEach((s,o)=>{const l=R[o],u=n[o];!l||!Number.isFinite(u)||(f=!0,u<p[o].lsl||u>p[o].usl?h.push(s.testNumber):(u<l.lo||u>l.hi)&&c.push(s.testNumber))}),f?h.length||e?{verdict:"fails",tests:h}:c.length?{verdict:"outlier",tests:c}:{verdict:"within",tests:[]}:{tests:[]}}),g={defs:i,passKey:A,pat:{limits:N,skipped:w},verdicts:S};return E.set(r,g),g}export function waferPatLimits(r,i,m){return q(r,i,m).pat}export function waferPatVerdicts(r,i,m){return q(r,i,m).verdicts}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What part-average testing finds in a population, wafer by wafer and test by test (stats/pat.ts holds the rule): how
|
|
3
|
+
* many dies are within their PAT limits, how many pass every test limit and bin yet sit outside the wafer's PAT limits
|
|
4
|
+
* (the outliers PAT exists to catch), and how many fail anyway; and which tests the outliers are outside on.
|
|
5
|
+
*/
|
|
6
|
+
import type { Die } from '../core/dies.js';
|
|
7
|
+
import type { TestDef } from '../renderer/buildWaferMap.js';
|
|
8
|
+
export interface PatWaferRow {
|
|
9
|
+
label: string;
|
|
10
|
+
/** Dies with a verdict: within, outlier or fails. */
|
|
11
|
+
judged: number;
|
|
12
|
+
within: number;
|
|
13
|
+
outliers: number;
|
|
14
|
+
fails: number;
|
|
15
|
+
}
|
|
16
|
+
export interface PatTestRow {
|
|
17
|
+
testNumber: number;
|
|
18
|
+
name: string; /** Outlier dies outside the PAT limits of this test. */
|
|
19
|
+
outliers: number;
|
|
20
|
+
}
|
|
21
|
+
/** A test whose values are lopsided on some wafers, where symmetric PAT limits fit less well. */
|
|
22
|
+
export interface PatSkewRow {
|
|
23
|
+
testNumber: number;
|
|
24
|
+
name: string; /** Wafers where it is lopsided, of the wafers with PAT limits for it. */
|
|
25
|
+
wafers: number;
|
|
26
|
+
of: number; /** The most lopsided wafer's quartile skewness. */
|
|
27
|
+
worst: number;
|
|
28
|
+
}
|
|
29
|
+
export interface PatSummary {
|
|
30
|
+
/** Tests PAT judged (parametric, with both limits). */
|
|
31
|
+
tests: number;
|
|
32
|
+
wafers: PatWaferRow[];
|
|
33
|
+
/** Tests by the outliers they explain, most first; a die outside on several tests counts for each. */
|
|
34
|
+
byTest: PatTestRow[];
|
|
35
|
+
/** Tests that are lopsided on at least one wafer, most wafers first. */
|
|
36
|
+
skewed: PatSkewRow[];
|
|
37
|
+
total: Omit<PatWaferRow, 'label'>;
|
|
38
|
+
}
|
|
39
|
+
export declare function summarisePat(items: ReadonlyArray<{
|
|
40
|
+
label: string;
|
|
41
|
+
dies: readonly Die[];
|
|
42
|
+
allDies?: readonly Die[];
|
|
43
|
+
passBins: readonly number[];
|
|
44
|
+
}>, testDefs: readonly TestDef[]): PatSummary | undefined;
|
|
45
|
+
//# sourceMappingURL=patSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{patTests as M,waferPatLimits as j,waferPatVerdicts as T,PAT_SKEW_WARN as k}from"./pat.js";export function summarisePat(m,n){const u=M(n);if(u.length===0)return;const a=[],w=new Map,d=new Map;for(const s of m){const t=s.allDies??s.dies,r=T(t,n,s.passBins);for(const[l,o]of j(t,n,s.passBins).limits){const e=d.get(l)??{wafers:0,of:0,worst:0};e.of++,Math.abs(o.skew)>=k&&(e.wafers++,Math.abs(o.skew)>Math.abs(e.worst)&&(e.worst=o.skew)),d.set(l,e)}const i={label:s.label,judged:0,within:0,outliers:0,fails:0},b=new Set(s.dies);t.forEach((l,o)=>{const e=r[o];if(!(!e.verdict||!b.has(l)))if(i.judged++,e.verdict==="within")i.within++;else if(e.verdict==="fails")i.fails++;else{i.outliers++;for(const c of e.tests)w.set(c,(w.get(c)??0)+1)}}),i.judged>0&&a.push(i)}if(a.length===0)return;const f=s=>a.reduce((t,r)=>t+r[s],0),h=[...w].map(([s,t])=>({testNumber:s,name:n.find(r=>r.testNumber===s)?.name||`Test ${s}`,outliers:t})).sort((s,t)=>t.outliers-s.outliers||s.testNumber-t.testNumber),g=s=>n.find(t=>t.testNumber===s)?.name||`Test ${s}`,p=[...d].filter(([,s])=>s.wafers>0).map(([s,t])=>({testNumber:s,name:g(s),...t})).sort((s,t)=>t.wafers/t.of-s.wafers/s.of||Math.abs(t.worst)-Math.abs(s.worst)||s.testNumber-t.testNumber);return{tests:u.length,wafers:a,byTest:h,skewed:p,total:{judged:f("judged"),within:f("within"),outliers:f("outliers"),fails:f("fails")}}}
|
|
@@ -138,9 +138,9 @@ export declare function patternFailVerdict(die: {
|
|
|
138
138
|
* the clusters of a centre cluster or a scratch. One rule for the wafer's
|
|
139
139
|
* pattern and the lot's.
|
|
140
140
|
*
|
|
141
|
-
* `rings` are the ring numbers a ring finding covers
|
|
142
|
-
* edge patterns explain the outer ring, a centre
|
|
143
|
-
* the rings between.
|
|
141
|
+
* `rings` are the ring numbers a ring finding covers, or a cluster's dies lie in
|
|
142
|
+
* (none for other families); edge patterns explain the outer ring, a centre
|
|
143
|
+
* cluster the core ring and a cluster that reaches it, a donut the rings between.
|
|
144
144
|
*/
|
|
145
145
|
export declare function patternExplains(pattern: PatternLabel, family: string, rings: number[], ringCount: number): boolean;
|
|
146
146
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{diePassStatus as fn}from"../core/dies.js";import{findConnectedComponents as pn}from"./connectedComponents.js";import{clamp01 as mn}from"../core/utils.js";import{ringOf as yn}from"../core/classify.js";export const DEFAULT_PATTERN_THRESHOLDS={nearFullGlobalRdd:.6,edgeRingEdgeRdd:.18,edgeRingEdgeRddHigh:.3,edgeRingRadialSpread:.45,edgeRingAngularSpread:.6,edgeLocalEdgeRdd:.1,edgeLocalCentroidDist:.76,centerCentroidDist:.22,centerCentroidDistHigh:.1,centerEdgeRdd:.35,scratchMaxLineWidth:.8,scratchMinLineLength:8,scratchMinLineLengthRadius:.3,scratchMinReach:.35,scratchMaxInnerDist:.7,donutHole:.15,donutRim:.15,donutPeak:.15,minimumFailingDies:5};function B(n,t,o){return yn(n.physX-t.center.x,n.physY-t.center.y,t.radius,o)===o}function Mn(n,t,o){if(n.length<3)return 0;let s=0,a=0,c=0;for(const M of n){const u=M.physX-t,g=M.physY-o;s+=u*u,a+=g*g,c+=u*g}s/=n.length,a/=n.length,c/=n.length;const d=s+a,i=s*a-c*c,p=Math.max(0,(d/2)**2-i),f=d/2+Math.sqrt(p),y=d/2-Math.sqrt(p);if(f<=0)return 0;const R=mn(y/f);return Math.sqrt(1-R)}function xn(n,t){if(t===0)return 0;const o=new Map,s=new Map,a=new Map,c=new Map;for(const i of n)o.set(i.y,(o.get(i.y)??0)+1),s.set(i.x,(s.get(i.x)??0)+1),a.set(i.x-i.y,(a.get(i.x-i.y)??0)+1),c.set(i.x+i.y,(c.get(i.x+i.y)??0)+1);let d=0;for(const i of o.values())i>d&&(d=i);for(const i of s.values())i>d&&(d=i);for(const i of a.values())i>d&&(d=i);for(const i of c.values())i>d&&(d=i);return d/t}function Rn(n,t,o,s){if(n.length<2)return{width:0,length:0};let a=0,c=0,d=0;for(const u of n){const g=u.physX-t,x=u.physY-o;a+=g*g,c+=x*x,d+=g*x}const i=.5*Math.atan2(2*d,a-c),p=Math.cos(i),f=Math.sin(i);let y=1/0,R=-1/0,M=0;for(const u of n){const g=u.physX-t,x=u.physY-o,D=g*p+x*f,m=x*p-g*f;M+=m*m,D<y&&(y=D),D>R&&(R=D)}return{width:Math.sqrt(M/n.length)/s,length:(R-y)/s}}function K(n){let t=0,o=0;for(const s of n)t+=s.physX,o+=s.physY;return[t/n.length,o/n.length]}const Dn=1.5,Sn=3;function Ln(n,t,o){const s=[...n];if(n.length<2)return s;const a=t.filter(c=>c.length>0);for(;;){const[c,d]=K(s);let i=0,p=0,f=0;for(const l of s){const h=l.physX-c,S=l.physY-d;i+=h*h,p+=S*S,f+=h*S}const y=.5*Math.atan2(2*f,i-p),R=Math.cos(y),M=Math.sin(y),u=l=>(l.physX-c)*R+(l.physY-d)*M;let g=1/0,x=-1/0;for(const l of s){const h=u(l);h<g&&(g=h),h>x&&(x=h)}let D=-1,m=1/0;for(let l=0;l<a.length;l++){let h=1/0,S=-1/0,I=!1;for(const E of a[l]){if(Math.abs((E.physY-d)*R-(E.physX-c)*M)>Dn*o){I=!0;break}const b=u(E);b<h&&(h=b),b>S&&(S=b)}if(I)continue;const L=Math.max(h-x,g-S,0);L<=Sn*o&&L<m&&(D=l,m=L)}if(D<0)return s;s.push(...a[D]),a.splice(D,1)}}function En(n,t,o,s){const a=t.length,c=n.length,d=a>0?c/a:0,i=t.filter(e=>B(e,o,s)),p=n.filter(e=>B(e,o,s)),f=i.length>0?p.length/i.length:0,y=pn(n),R=e=>{let r=1/0,A=1/0,_=0,v=0;for(const N of e)_+=N.physX,v+=N.physY,(N.y<r||N.y===r&&N.x<A)&&(r=N.y,A=N.x);const un=Math.hypot(_/e.length-o.center.x,v/e.length-o.center.y);return[Math.round(un*1e6),r,A]},M=y.length>0?y.map(e=>({c:e,k:R(e)})).sort((e,r)=>r.c.length-e.c.length||e.k[0]-r.k[0]||e.k[1]-r.k[1]||e.k[2]-r.k[2]).map(({c:e})=>e):[n],u=M[0],g=M.slice(0,5).flat(),x=u.length,D=c>0?x/c:0,m=o.center.x,l=o.center.y,h=o.radius;let S=0,I=0,L=1/0,E=0;for(const e of u){S+=e.physX,I+=e.physY;const r=Math.sqrt((e.physX-m)**2+(e.physY-l)**2);r<L&&(L=r),r>E&&(E=r)}const b=S/u.length,U=I/u.length,V=Math.sqrt((b-m)**2+(U-l)**2)/h,j=L===1/0?0:L/h,J=Math.min(E/h,1),k=n.map(e=>Math.sqrt((e.physX-m)**2+(e.physY-l)**2)/h).sort((e,r)=>e-r),Q=k[Math.floor(k.length*.25)]??0,P=t.filter(e=>Math.sqrt((e.physX-m)**2+(e.physY-l)**2)/h<.5).length,H=t.filter(e=>Math.sqrt((e.physX-m)**2+(e.physY-l)**2)/h>=.5).length,Z=n.filter(e=>Math.sqrt((e.physX-m)**2+(e.physY-l)**2)/h<.5).length,$=n.filter(e=>Math.sqrt((e.physX-m)**2+(e.physY-l)**2)/h>=.5).length,O=P>0?Z/P:0,w=H>0?$/H:0,nn=w>0?O/w:O>0?2:1,tn=g.reduce((e,r)=>e+r.physX,0)/g.length,en=g.reduce((e,r)=>e+r.physY,0)/g.length,on=Mn(g,tn,en),sn=xn(g,g.length),F=16,G=new Set;for(const e of p){const r=(Math.atan2(e.physY-l,e.physX-m)+2*Math.PI)%(2*Math.PI);G.add(Math.floor(r/(2*Math.PI)*F)%F)}const rn=p.length>0?G.size/F:0,T=Math.max(u[0]?.width??1,u[0]?.height??1),X=Ln(u,M.slice(1,12),T),{width:cn,length:dn}=Rn(X,...K(X),T);let Y=1/0,q=0;for(const e of X){const r=Math.sqrt((e.physX-m)**2+(e.physY-l)**2)/h;r<Y&&(Y=r),r>q&&(q=r)}const an=Y===1/0?0:Y,ln=Math.min(q,1),C=5,W=new Array(C).fill(0),z=new Array(C).fill(0),hn=new Set(n);for(const e of t){const r=Math.min(C-1,Math.floor(Math.sqrt((e.physX-m)**2+(e.physY-l)**2)/h*C));W[r]++,hn.has(e)&&z[r]++}const gn=W.map((e,r)=>e>0?z[r]/e:0);return{globalRdd:d,edgeRdd:f,centroidDistNorm:V,minDistNorm:j,maxDistNorm:J,p25DistNorm:Q,eccentricity:on,linearScore:sn,salienceSize:x,salienceFraction:D,edgeAngularSpread:rn,innerOuterRatio:nn,lineWidth:cn,lineLength:dn,lineSize:X.length,lineMinDistNorm:an,lineMaxDistNorm:ln,radialFailRates:gn}}function Nn(n,t,o){const s=Math.max(5,Math.round(o*.003)),a=n.salienceSize>=s;if(n.globalRdd<t.nearFullGlobalRdd&&n.p25DistNorm>=t.edgeLocalCentroidDist&&n.edgeAngularSpread>=t.edgeRingAngularSpread&&n.edgeRdd>=t.edgeLocalEdgeRdd)return{pattern:"edge-ring",confidence:n.edgeRdd>=t.edgeRingEdgeRddHigh?"high":"medium"};const[c,d,i,,p]=n.radialFailRates,f=Math.max(d,i);if(n.globalRdd<t.nearFullGlobalRdd&&f>=t.donutPeak&&f-c>=t.donutHole&&f-p>=t.donutRim)return{pattern:"donut",confidence:f-c>=2*t.donutHole?"high":"medium"};if(n.globalRdd<t.nearFullGlobalRdd&&n.lineSize>=s&&n.lineWidth<=t.scratchMaxLineWidth&&n.lineLength>=t.scratchMinLineLength&&n.lineLength>=t.scratchMinLineLengthRadius*Math.sqrt(o/Math.PI)&&n.lineMaxDistNorm>=t.scratchMinReach&&n.lineMinDistNorm<t.scratchMaxInnerDist)return{pattern:"scratch",confidence:n.lineWidth<=t.scratchMaxLineWidth/2?"high":"medium"};if(n.globalRdd<t.nearFullGlobalRdd&&n.salienceFraction<.1)return{pattern:"random",confidence:"low"};if(n.globalRdd>=t.nearFullGlobalRdd)return{pattern:"near-full",confidence:n.globalRdd>=.8?"high":"medium"};const y=a&&n.edgeRdd>=t.edgeLocalEdgeRdd&&n.maxDistNorm>=.7;return y&&n.p25DistNorm>=t.edgeLocalCentroidDist&&n.maxDistNorm-n.minDistNorm<=t.edgeRingRadialSpread?{pattern:"edge-ring",confidence:n.edgeRdd>=t.edgeRingEdgeRddHigh?"high":"medium"}:y&&n.p25DistNorm>=.55&&n.p25DistNorm<t.edgeLocalCentroidDist?{pattern:"edge-local",confidence:n.edgeRdd>=t.edgeRingEdgeRdd?"medium":"low"}:a&&n.centroidDistNorm<=t.centerCentroidDist&&n.edgeRdd<=t.centerEdgeRdd?{pattern:"center",confidence:n.centroidDistNorm<=t.centerCentroidDistHigh?"high":"medium"}:{pattern:"random",confidence:"low"}}export const PATTERN_LABELS={center:"Center cluster",donut:"Donut","edge-ring":"Edge-ring","edge-local":"Edge-local",scratch:"Scratch","near-full":"Near-full",random:"Random",none:"None"};export function patternFailVerdict(n,t){const o=fn(n,t);return o===void 0?void 0:!o}export function patternExplains(n,t,o,s){if(!{"edge-ring":["ring","edge-arc"],"edge-local":["edge-arc","sector","quadrant"],center:["ring","cluster"],donut:["ring"],scratch:["cluster","sector","quadrant"],"near-full":["ring"]}[n]?.includes(t))return!1;if(t==="cluster")return n!=="center"||o.length===0||o.includes(1);if(t!=="ring"||o.length===0)return!0;const c=o.includes(s),d=o.includes(1);return n==="edge-ring"||n==="edge-local"?c:n==="center"?d:n==="donut"?!c&&!d:!0}export function classifyPattern(n,t,o){const s=new Set(o.passBins),a=n.filter(c=>patternFailVerdict(c,s)===!0);return classifyFailingDies(a,n,t,o.ringCount)}export function classifyFailingDies(n,t,o,s){const a={...DEFAULT_PATTERN_THRESHOLDS},c=Math.max(a.minimumFailingDies,Math.round(t.length*.003));if(n.length<c)return null;const d=En(n,t,o,s),{pattern:i,confidence:p,note:f}=Nn(d,a,t.length);return{pattern:i,confidence:p,features:d,...f?{note:f}:{}}}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { type GuideSection } from './guideSections.js';
|
|
1
2
|
import type { Die } from '../core/dies.js';
|
|
2
3
|
import type { Wafer } from '../core/wafer.js';
|
|
3
4
|
import type { WaferMetadata } from '../core/metadata.js';
|
|
4
5
|
import { type TestDef } from '../renderer/buildWaferMap.js';
|
|
5
6
|
import type { FacetCuration } from './facets.js';
|
|
6
|
-
import type { PlotSpec, PlotField, PlotAggregate } from './plotSpec.js';
|
|
7
|
+
import type { PlotSpec, PlotCondition, PlotField, PlotValueReference, PlotAggregate, PlotTestSet, PlotJudge } from './plotSpec.js';
|
|
8
|
+
import { type GroupComparison } from './groupCompare.js';
|
|
9
|
+
import { type TestPassKind } from './testPassRate.js';
|
|
10
|
+
import { type ControlLimits, type ControlViolation } from './control.js';
|
|
7
11
|
/** One wafer of the population. The same shape a drilldown source's items have. */
|
|
8
12
|
export interface PlotItem {
|
|
9
13
|
label: string;
|
|
@@ -16,6 +20,8 @@ export interface PlotItem {
|
|
|
16
20
|
ringCount: number;
|
|
17
21
|
/** Needed for ring and quadrant. */
|
|
18
22
|
wafer?: Wafer;
|
|
23
|
+
/** @internal The wafer's whole die list when `dies` is part of it (a panel's ring): PAT limits are the wafer's. */
|
|
24
|
+
allDies?: readonly Die[];
|
|
19
25
|
}
|
|
20
26
|
export interface PlotContext {
|
|
21
27
|
/** The population's reconciled test list (`mergeTestDefs`). */
|
|
@@ -23,14 +29,40 @@ export interface PlotContext {
|
|
|
23
29
|
/** The Insights tab's Group by key, which "follow Group by" resolves to. Absent outside the tab. */
|
|
24
30
|
groupBy?: string;
|
|
25
31
|
curation?: Record<string, FacetCuration>;
|
|
32
|
+
/** @internal The dies a rescaling is measured over: a panel's values are scaled as the whole plot's are. */
|
|
33
|
+
scaleDies?: readonly Die[];
|
|
34
|
+
/** @internal The panels divide a set of tests by test, so neither X nor the colour has to. */
|
|
35
|
+
facetByTest?: boolean;
|
|
36
|
+
/** @internal Partial and edge-excluded dies are already left out (`resolveEligible`). */
|
|
37
|
+
eligibleOnly?: boolean;
|
|
38
|
+
/** @internal The plot's `where` is already applied: these are the dies it keeps. */
|
|
39
|
+
whereApplied?: boolean;
|
|
40
|
+
/** @internal A heatmap resolved as the bar of its two category levels, before it is laid out as a grid. */
|
|
41
|
+
asHeatmap?: boolean;
|
|
42
|
+
/** @internal Resolving one panel (or the whole) of a faceted plot: its facet is already applied. */
|
|
43
|
+
inFacet?: boolean;
|
|
44
|
+
/** @internal The wafers of the whole plot, when this is a panel of it: a followed colour is per wafer when the whole
|
|
45
|
+
* has several, though a panel may hold one. */
|
|
46
|
+
wholeWafers?: number;
|
|
47
|
+
/** @internal The whole population, when this is a panel of it: a binned field's ranges are cut over all of it. */
|
|
48
|
+
wholeItems?: readonly PlotItem[];
|
|
49
|
+
/** @internal The ranges a binned field was cut into, by field, so every panel shares them. */
|
|
50
|
+
binEdges?: Map<string, number[]>;
|
|
26
51
|
}
|
|
27
52
|
export type FieldKind = 'numeric' | 'categorical';
|
|
28
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* A test's limits: the tester's (`limitLow`/`limitHigh`), the specification's (`specLow`/`specHigh`), on a plot of one
|
|
55
|
+
* wafer that wafer's PAT limits (`patLow`/`patHigh`), and proposed what-if limits (`whatIfLow`/`whatIfHigh`). Any may be absent.
|
|
56
|
+
*/
|
|
29
57
|
export interface TestLimits {
|
|
30
58
|
limitLow?: number;
|
|
31
59
|
limitHigh?: number;
|
|
32
60
|
specLow?: number;
|
|
33
61
|
specHigh?: number;
|
|
62
|
+
patLow?: number;
|
|
63
|
+
patHigh?: number;
|
|
64
|
+
whatIfLow?: number;
|
|
65
|
+
whatIfHigh?: number;
|
|
34
66
|
}
|
|
35
67
|
/** A field resolved over the population, one value per die (`level: 'die'`) or per wafer (`'wafer'`). */
|
|
36
68
|
export interface FieldColumn {
|
|
@@ -50,9 +82,38 @@ export interface FieldColumn {
|
|
|
50
82
|
limits?: TestLimits;
|
|
51
83
|
/** Set on a yield taken per die (100 for a passing die, 0 for a failing one): its mean over any set of dies is their yield. */
|
|
52
84
|
perDie?: true;
|
|
85
|
+
/** For a pass rate judged by test limits: per die, −1 failed below the low limit, 1 above the high, 0 otherwise. */
|
|
86
|
+
failSide?: Int8Array;
|
|
53
87
|
/** Why this field cannot be used on this population. */
|
|
54
88
|
issue?: string;
|
|
89
|
+
/** For a set of tests: the test each row's value belongs to, by name, so a missing value is reported against its test. */
|
|
90
|
+
labelOf?: (row: number) => string;
|
|
55
91
|
}
|
|
92
|
+
/** One test of a goal plot: `x` (mean − centre of the window) / window, `y` standard deviation / window, Ppk = (½ − |x|) / 3y. */
|
|
93
|
+
export interface GoalPoint {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
group: number;
|
|
97
|
+
testNumber: number;
|
|
98
|
+
label: string;
|
|
99
|
+
ppk: number;
|
|
100
|
+
n: number;
|
|
101
|
+
basis: 'spec' | 'test';
|
|
102
|
+
}
|
|
103
|
+
/** A line fitted to one colour's points: y = intercept + slope · x. `r2` is the squared Pearson correlation of the points. */
|
|
104
|
+
export interface PlotFit {
|
|
105
|
+
group: number;
|
|
106
|
+
slope: number;
|
|
107
|
+
intercept: number;
|
|
108
|
+
r2: number;
|
|
109
|
+
n: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The line through points `xs`, `ys`: least squares of y on x (`linear`), or the line closest to the points at right
|
|
113
|
+
* angles (`orthogonal`, Deming regression with equal error variances), which does not tilt towards horizontal when x
|
|
114
|
+
* is as noisy as y. Undefined with fewer than three points or no spread in x.
|
|
115
|
+
*/
|
|
116
|
+
export declare function fitLine(xs: readonly number[], ys: readonly number[], how: 'linear' | 'orthogonal'): Omit<PlotFit, 'group'> | undefined;
|
|
56
117
|
export interface PlotPoint {
|
|
57
118
|
x: number;
|
|
58
119
|
y: number;
|
|
@@ -66,9 +127,20 @@ export interface PlotUnit {
|
|
|
66
127
|
item: number;
|
|
67
128
|
die?: Die;
|
|
68
129
|
}
|
|
69
|
-
|
|
130
|
+
/**
|
|
131
|
+
* A bar of die pass rates or a yield per die: its cells' values are 100 (pass) and 0 (fail), and, judged by test limits,
|
|
132
|
+
* `failSide[u]` is −1 for a unit that failed below the low limit, 1 above the high, 0 otherwise.
|
|
133
|
+
*/
|
|
134
|
+
export interface PassFailCells {
|
|
135
|
+
failSide?: Int8Array;
|
|
136
|
+
}
|
|
137
|
+
export type PlotMarks =
|
|
138
|
+
/** `fits`: a fitted line per colour, when the plot asks for one (`PlotSpec.fit`); `identity`: draw y = x. */
|
|
139
|
+
{
|
|
70
140
|
type: 'scatter';
|
|
71
141
|
points: PlotPoint[];
|
|
142
|
+
fits?: PlotFit[];
|
|
143
|
+
identity?: true;
|
|
72
144
|
}
|
|
73
145
|
/** `units[g][k]` is the unit behind `values[g][k]`, so a bar can say which dies (or wafers) it counts. */
|
|
74
146
|
| {
|
|
@@ -76,20 +148,72 @@ export type PlotMarks = {
|
|
|
76
148
|
values: number[][];
|
|
77
149
|
units: number[][];
|
|
78
150
|
unit: (u: number) => PlotUnit;
|
|
79
|
-
}
|
|
151
|
+
}
|
|
152
|
+
/** Each group's values ascending, `units[g][k]` the unit behind `values[g][k]`; the k-th of n sits at `probabilityPosition(k, n)`. */
|
|
153
|
+
| {
|
|
154
|
+
type: 'probability';
|
|
155
|
+
values: number[][];
|
|
156
|
+
units: number[][];
|
|
157
|
+
unit: (u: number) => PlotUnit;
|
|
158
|
+
}
|
|
159
|
+
/** `nest`, set when X has several levels: each category's value at each level, outer first, with the levels' names. */
|
|
160
|
+
/**
|
|
161
|
+
* `stack`: a bar's colours drawn one on another (`values` then the colours' counts or sums, or their shares in percent);
|
|
162
|
+
* `cumulative`: each category's running share of the whole, in percent, for a pareto line.
|
|
163
|
+
*/
|
|
164
|
+
| {
|
|
80
165
|
type: 'box' | 'bar';
|
|
81
166
|
categories: string[];
|
|
82
167
|
cells: number[][][];
|
|
83
168
|
cellUnits: number[][][];
|
|
84
169
|
values: number[][];
|
|
85
170
|
categoryItems?: number[];
|
|
171
|
+
nest?: {
|
|
172
|
+
levels: string[];
|
|
173
|
+
parts: string[][];
|
|
174
|
+
};
|
|
175
|
+
stack?: 'stack' | 'percent';
|
|
176
|
+
cumulative?: number[];
|
|
86
177
|
unit: (u: number) => PlotUnit;
|
|
87
|
-
|
|
178
|
+
passFail?: PassFailCells;
|
|
179
|
+
}
|
|
180
|
+
/** An individuals chart: one value per wafer (`items[k]` is the wafer of `values[k]`) in X order, its limits and the points breaking a rule. */
|
|
181
|
+
| {
|
|
182
|
+
type: 'control';
|
|
183
|
+
xs: number[];
|
|
184
|
+
values: number[];
|
|
185
|
+
items: number[];
|
|
186
|
+
limits: ControlLimits;
|
|
187
|
+
violations: ControlViolation[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A heatmap: `values[r][c]` the combined value of the cell at row r and column c (NaN where it holds nothing),
|
|
191
|
+
* `cellUnits[r][c]` the units behind it.
|
|
192
|
+
*/
|
|
193
|
+
| {
|
|
194
|
+
type: 'heatmap';
|
|
195
|
+
rows: string[];
|
|
196
|
+
cols: string[];
|
|
197
|
+
values: number[][];
|
|
198
|
+
cellUnits: number[][][];
|
|
199
|
+
unit: (u: number) => PlotUnit;
|
|
200
|
+
}
|
|
201
|
+
/** A goal plot: one point per test (and colour), its mean offset and spread as shares of its limit window. */
|
|
202
|
+
| {
|
|
203
|
+
type: 'goal';
|
|
204
|
+
points: GoalPoint[];
|
|
205
|
+
}
|
|
206
|
+
/** `band`: the spread round each value, per group and X, when the plot asks for one (`PlotSpec.spread`). */
|
|
207
|
+
| {
|
|
88
208
|
type: 'line';
|
|
89
209
|
xs: number[];
|
|
90
210
|
values: number[][];
|
|
91
211
|
counts: number[][];
|
|
92
212
|
cellUnits: number[][][];
|
|
213
|
+
band?: {
|
|
214
|
+
lo: number[][];
|
|
215
|
+
hi: number[][];
|
|
216
|
+
};
|
|
93
217
|
unit: (u: number) => PlotUnit;
|
|
94
218
|
};
|
|
95
219
|
/** `label` is the axis title WITHOUT its unit: the chart appends the unit, scaled to the ticks ("µA" for 0.000861 A). */
|
|
@@ -102,6 +226,16 @@ export interface ResolvedAxis {
|
|
|
102
226
|
reverse?: boolean;
|
|
103
227
|
/** The limits of the test this axis measures, when it measures one: the chart draws them as lines. */
|
|
104
228
|
limits?: TestLimits;
|
|
229
|
+
/** A panel of a faceted plot: the data range of every panel, so each panel's axis spans the same range. */
|
|
230
|
+
extent?: [number, number];
|
|
231
|
+
/** The axis's reference lines and bands as values: a median or mean worked out over what the whole plot draws. */
|
|
232
|
+
references?: PlotValueReference[];
|
|
233
|
+
/** The range a clipped axis (`PlotAxis.clip`) draws, over the whole plot's values, and how many lie outside it. */
|
|
234
|
+
clip?: {
|
|
235
|
+
lo: number;
|
|
236
|
+
hi: number;
|
|
237
|
+
outside: number;
|
|
238
|
+
};
|
|
105
239
|
}
|
|
106
240
|
export interface ResolvedPlot {
|
|
107
241
|
spec: PlotSpec;
|
|
@@ -122,11 +256,66 @@ export interface ResolvedPlot {
|
|
|
122
256
|
label: string;
|
|
123
257
|
unit?: string;
|
|
124
258
|
lo: number;
|
|
125
|
-
hi: number;
|
|
259
|
+
hi: number; /** Every value is a whole number (a count): shown without decimals. */
|
|
260
|
+
integer?: true;
|
|
126
261
|
};
|
|
127
262
|
colorLabel?: string;
|
|
263
|
+
/** Set when the colour is a hard or soft bin: each group takes that bin's colour on the maps (`BinColors`). */
|
|
264
|
+
colorBins?: 'hard' | 'soft';
|
|
265
|
+
/** Set when the colour is one of the X fields: the axis already names every colour, so no legend is needed. */
|
|
266
|
+
colorRepeatsX?: true;
|
|
128
267
|
/** How values were combined, in words ("mean of Vth per wafer"), when they were. */
|
|
129
268
|
aggregation?: string;
|
|
269
|
+
/** How the values were rescaled, in words, when they were (`PlotSpec.normalize`). */
|
|
270
|
+
normalization?: string;
|
|
271
|
+
/**
|
|
272
|
+
* For a box or bar of one measured test divided by a wafer field (split, lot): the groups compared with each wafer
|
|
273
|
+
* as one value (the mean of its dies), so n is wafers. `by` names the field.
|
|
274
|
+
*/
|
|
275
|
+
comparison?: {
|
|
276
|
+
by: string;
|
|
277
|
+
result: GroupComparison;
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* A faceted plot: one plot per value of the facet field, in order, each on the whole plot's colours (`groups`) and
|
|
281
|
+
* axis ranges, with its units naming wafers of the population handed in. The fields above describe the whole.
|
|
282
|
+
*/
|
|
283
|
+
facets?: Array<{
|
|
284
|
+
label: string;
|
|
285
|
+
plot: ResolvedPlot;
|
|
286
|
+
}>;
|
|
287
|
+
/** The facet field's name, when there are panels. */
|
|
288
|
+
facetLabel?: string;
|
|
289
|
+
/** The plot shows PAT verdicts or PAT limits: its statement says how they are set. */
|
|
290
|
+
usesPat?: true;
|
|
291
|
+
/** A scatter's Pearson r over every point drawn (null when it is undefined: too few points, no spread) and n. */
|
|
292
|
+
correlation?: {
|
|
293
|
+
r: number | null;
|
|
294
|
+
n: number;
|
|
295
|
+
};
|
|
296
|
+
/** What `where` kept, in words ("only dies with Hard bin Bin 1"). */
|
|
297
|
+
filterNote?: string;
|
|
298
|
+
/** Dies left out because a yield does not judge them: partial dies and dies inside the edge exclusion. */
|
|
299
|
+
leftOut?: {
|
|
300
|
+
partial: number;
|
|
301
|
+
edge: number;
|
|
302
|
+
};
|
|
303
|
+
/** Each fitted line as an equation with its R² and n, one per colour. */
|
|
304
|
+
fitNotes?: string[];
|
|
305
|
+
/** The plotted test's pass rate under its own limits and under the proposed ones (`PlotSpec.whatIf`), over the dies it judges. */
|
|
306
|
+
whatIf?: {
|
|
307
|
+
lo?: number;
|
|
308
|
+
hi?: number;
|
|
309
|
+
judged: number;
|
|
310
|
+
passNow: number;
|
|
311
|
+
passThen: number;
|
|
312
|
+
sentence: string;
|
|
313
|
+
};
|
|
314
|
+
/** @internal The tests a set resolved to, and their labels, in order. */
|
|
315
|
+
setTests?: {
|
|
316
|
+
tests: number[];
|
|
317
|
+
labels: string[];
|
|
318
|
+
};
|
|
130
319
|
/** The scope: every wafer and die handed in. */
|
|
131
320
|
population: {
|
|
132
321
|
wafers: number;
|
|
@@ -152,7 +341,50 @@ export interface ResolvedPlot {
|
|
|
152
341
|
};
|
|
153
342
|
}
|
|
154
343
|
/** The reader's name for a field, whether or not the population has it. */
|
|
155
|
-
export declare function fieldLabel(field: PlotField, testDefs?: readonly TestDef[]): string;
|
|
344
|
+
export declare function fieldLabel(field: PlotField, testDefs?: readonly TestDef[], curation?: Record<string, FacetCuration>): string;
|
|
345
|
+
/**
|
|
346
|
+
* The order a wafer field's values (a split, a lot) are listed in: by number when every value is one, else naturally
|
|
347
|
+
* (W2 before W10). A plot places and colours them in this order, and Insights' Group by lists its groups in it, so a
|
|
348
|
+
* group has one colour on every card.
|
|
349
|
+
*/
|
|
350
|
+
export declare function orderFieldValues(values: readonly string[]): string[];
|
|
351
|
+
/** The bin a category or colour named by `binLabel` stands for; `undefined` for any other label. */
|
|
352
|
+
export declare function binOfLabel(label: string): number | undefined;
|
|
353
|
+
/**
|
|
354
|
+
* How a pass rate judges a die of `def`: a functional test by its recorded verdict, a parametric one by its test limits
|
|
355
|
+
* or (`judge: 'flag'`) by the tester's recorded flag. The Overview pass-rate card's three modes, as one rule.
|
|
356
|
+
*/
|
|
357
|
+
export declare function passKindOf(def: TestDef, judge: PlotJudge | undefined): TestPassKind;
|
|
358
|
+
/**
|
|
359
|
+
* The test numbers a set names, in the order written, ranges expanded to the declared tests inside them by the parser a
|
|
360
|
+
* sweep and a derived test use, so the same text names the same tests everywhere. A test named twice is kept once.
|
|
361
|
+
*/
|
|
362
|
+
export declare function expandTestSet(set: PlotTestSet, testDefs: readonly TestDef[]): {
|
|
363
|
+
tests: number[];
|
|
364
|
+
problems: string[];
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* `set` with `names` holding the name each of its tests has in `testDefs`, for the check that the plot is read against
|
|
368
|
+
* the same tests in another lot. A test the definitions do not hold is left out of `names`.
|
|
369
|
+
*/
|
|
370
|
+
export declare function withTestSetNames(set: PlotTestSet, testDefs: readonly TestDef[]): PlotTestSet;
|
|
371
|
+
/**
|
|
372
|
+
* The most values a set of tests reads at once (dies × tests). Every value is held by the box or bar that draws it, so a
|
|
373
|
+
* set over a large lot is refused with the numbers rather than stalling the tab.
|
|
374
|
+
*/
|
|
375
|
+
export declare const TEST_SET_VALUE_LIMIT = 4000000;
|
|
376
|
+
/**
|
|
377
|
+
* The edges between a binned field's ranges, ascending, interior only (`bins - 1` of them at most; fewer where values
|
|
378
|
+
* repeat so that two ranges would hold the same cut). `count`: each range holds about the same number of values;
|
|
379
|
+
* `width`: each spans the same width between the smallest and largest.
|
|
380
|
+
*/
|
|
381
|
+
export declare function binEdges(values: ArrayLike<number>, bins: number, by: 'count' | 'width'): number[];
|
|
382
|
+
/**
|
|
383
|
+
* The cumulative share a probability plot puts the k-th smallest of n values at (k from 0): (k + ½) / n, Hazen's
|
|
384
|
+
* plotting position. It never reaches 0 or 1, so the smallest and largest values have a place on a normal-probability
|
|
385
|
+
* axis, and it puts the median of an odd count at exactly 50%.
|
|
386
|
+
*/
|
|
387
|
+
export declare const probabilityPosition: (k: number, n: number) => number;
|
|
156
388
|
/** One value for a set of numbers. `count` ignores missing values; the rest of an empty set is NaN. */
|
|
157
389
|
export declare function combine(values: readonly number[], how: PlotAggregate): number;
|
|
158
390
|
/** What the cross-field rules need to know of a field: its level, whether it is a number, and whether it is a yield. */
|
|
@@ -183,13 +415,56 @@ export declare function combinationIssue(mark: PlotSpec['chart'], f: {
|
|
|
183
415
|
long: string;
|
|
184
416
|
short: string;
|
|
185
417
|
} | undefined;
|
|
418
|
+
/** The values a resolved plot draws along one axis (`markValues`): what a host compares its limits against. */
|
|
419
|
+
export declare const axisValues: (r: ResolvedPlot, role: "x" | "y") => number[];
|
|
420
|
+
/** The unit a condition's numbers are in, for stating its range: a test's own, or a percentage. */
|
|
421
|
+
export declare function conditionUnit(field: PlotField, testDefs?: readonly TestDef[]): string | undefined;
|
|
422
|
+
/**
|
|
423
|
+
* One condition in words, as the card footnote, the filter band and the editor's summary state it: "Ring is Edge or
|
|
424
|
+
* Middle", "Hard bin is not Bin 1", "Vth from 0.4 V to 0.6 V", "Yield below 90%".
|
|
425
|
+
*/
|
|
426
|
+
export declare function conditionText(c: PlotCondition, testDefs?: readonly TestDef[], curation?: Record<string, FacetCuration>): string;
|
|
427
|
+
/** What `applyConditions` kept: the items (each with only its kept dies), their places in the input, and counts. */
|
|
428
|
+
export interface ConditionsApplied {
|
|
429
|
+
items: PlotItem[];
|
|
430
|
+
/** For each kept item, its index in the items given. */
|
|
431
|
+
index: number[];
|
|
432
|
+
/** The kept dies over all dies, and the kept wafers over all wafers. */
|
|
433
|
+
dies: {
|
|
434
|
+
kept: number;
|
|
435
|
+
total: number;
|
|
436
|
+
};
|
|
437
|
+
wafers: {
|
|
438
|
+
kept: number;
|
|
439
|
+
total: number;
|
|
440
|
+
};
|
|
441
|
+
/** The filter in words: "only wafers where Split is A; only dies where Ring is Edge". Empty with no conditions. */
|
|
442
|
+
said: string;
|
|
443
|
+
/** Why the conditions cannot be applied (a field the lot lacks, a range on a category); nothing is filtered then. */
|
|
444
|
+
issue?: string;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Keep the wafers and dies that meet every condition: the one filter rule, for a plot's own filter and the Insights
|
|
448
|
+
* population filter alike. Every condition is judged on the population as given, so a wafer condition (yield below
|
|
449
|
+
* 90%) reads the whole wafer, and die conditions then keep dies inside the wafers kept. A unit with no value for a
|
|
450
|
+
* condition's field meets no condition, negated or not. A kept wafer keeps `allDies` (its whole wafer), so a PAT
|
|
451
|
+
* verdict or a whole-wafer figure is still judged on all of it.
|
|
452
|
+
*/
|
|
453
|
+
export declare function applyConditions(conditions: readonly PlotCondition[], items: readonly PlotItem[], ctx?: PlotContext): ConditionsApplied;
|
|
186
454
|
/** Resolves `spec` over `items`. Never throws for a plot that cannot be drawn: it returns the reasons. */
|
|
187
455
|
export declare function resolvePlot(spec: PlotSpec, items: readonly PlotItem[], ctx?: PlotContext): ResolvedPlot;
|
|
188
456
|
/** The plot's title: the one the user typed, else the automatic one. */
|
|
189
457
|
export declare function plotTitle(resolved: ResolvedPlot): string;
|
|
190
458
|
/** The statement every plot carries about what it shows ("6 wafers · 3,966 dies · 12 dies without Ioff not plotted"). */
|
|
191
459
|
export declare function plotFootnote(resolved: ResolvedPlot): string;
|
|
192
|
-
|
|
460
|
+
/**
|
|
461
|
+
* The user-guide sections that explain what a plot shows, a card linking each after its footnote: its chart type's
|
|
462
|
+
* statistics, and each of these only while the plot uses it: groups compared wafer by wafer, a fit line or the y = x
|
|
463
|
+
* line, a band, rescaled values, ranges of a number, panels, what-if limits. None for a plain chart (its About line
|
|
464
|
+
* says all there is).
|
|
465
|
+
*/
|
|
466
|
+
export declare function plotGuideSections(resolved: ResolvedPlot): GuideSection[];
|
|
467
|
+
export type FieldGroup = 'Tests' | 'Verdicts' | 'Pass rates' | 'Die' | 'Wafer';
|
|
193
468
|
/** One entry of the editor's field list. */
|
|
194
469
|
export interface FieldOption {
|
|
195
470
|
field: PlotField;
|
|
@@ -213,6 +488,13 @@ export declare function fieldKey(f: PlotField): string;
|
|
|
213
488
|
* soft-bin entry for a lot with no soft bins), so the list is the lot's, not the library's.
|
|
214
489
|
*/
|
|
215
490
|
export declare function fieldCatalogue(items: readonly PlotItem[], ctx?: PlotContext): FieldOption[];
|
|
491
|
+
/**
|
|
492
|
+
* The values a category field takes on this population, in the order every list of them uses (`categoryOrder`): what
|
|
493
|
+
* the editor offers for a plot's `where`. Empty for a field with no categories here.
|
|
494
|
+
*/
|
|
495
|
+
/** The smallest and largest value a numeric field takes on the population, or undefined when it has none (or is a category). */
|
|
496
|
+
export declare function fieldExtent(field: PlotField, items: readonly PlotItem[], ctx?: PlotContext): [number, number] | undefined;
|
|
497
|
+
export declare function fieldValues(field: PlotField, items: readonly PlotItem[], ctx?: PlotContext): string[];
|
|
216
498
|
export type PlotRole = 'x' | 'y' | 'color';
|
|
217
499
|
/**
|
|
218
500
|
* The fields that make sense for a role of a mark, so the editor never offers a choice that can only fail:
|
|
@@ -245,15 +527,10 @@ export interface TitleDrift {
|
|
|
245
527
|
export declare function titleDrift(spec: PlotSpec, catalogue: readonly FieldOption[]): TitleDrift;
|
|
246
528
|
/** `titleDrift` in a sentence for the reader, or null when the title is fine. */
|
|
247
529
|
export declare function describeTitleDrift(d: TitleDrift): string | null;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
* order as a line, and a sweep of the first few tests in test order. A type is left out when the population cannot
|
|
253
|
-
* support it (a line needs two wafers, a sweep two tests). Untitled, so each one is named by what it plots; the sweep,
|
|
254
|
-
* which has no fields to name it by, is titled "Example sweep".
|
|
255
|
-
*/
|
|
256
|
-
export declare function examplePlots(catalogue: readonly FieldOption[], waferCount: number, newId: () => string): PlotSpec[];
|
|
530
|
+
export declare function examplePlots(catalogue: readonly FieldOption[], waferCount: number, newId: () => string, data?: {
|
|
531
|
+
items: readonly PlotItem[];
|
|
532
|
+
ctx?: PlotContext;
|
|
533
|
+
}): PlotSpec[];
|
|
257
534
|
/**
|
|
258
535
|
* The test a click on this plot should open a wafer on: the plot's own measurement, so the map shows the values the
|
|
259
536
|
* plot is about rather than the bins. A scatter takes its X (as the Insights scatter does), then its Y, then its
|