@wafertools/wafermap 0.35.1 → 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 +13 -10
- package/CHANGELOG.md +474 -0
- package/README.md +7 -7
- package/dist/packages/canvas-adapter/chartPrefs.d.ts +16 -0
- package/dist/packages/canvas-adapter/chartPrefs.js +1 -0
- 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/index.d.ts +1 -0
- package/dist/packages/canvas-adapter/index.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +57 -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.d.ts +20 -5
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.d.ts +71 -37
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +22 -9
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/testValueOffer.d.ts +14 -0
- package/dist/packages/canvas-adapter/testValueOffer.js +1 -0
- package/dist/packages/canvas-adapter/toCanvas.js +1 -1
- package/dist/packages/canvas-adapter/toolbar.d.ts +12 -6
- 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 +607 -117
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/warnings.js +1 -1
- package/dist/packages/core/aggregates.d.ts +10 -0
- package/dist/packages/core/aggregates.js +1 -1
- package/dist/packages/core/classify.d.ts +11 -0
- package/dist/packages/core/classify.js +1 -1
- package/dist/packages/core/dieTable.d.ts +5 -0
- package/dist/packages/core/dieTable.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 +10 -1
- package/dist/packages/core/wafer.js +1 -1
- package/dist/packages/renderer/buildView.d.ts +5 -0
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/buildWaferMap.d.ts +21 -4
- 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/derivedTests/parser.js +1 -1
- package/dist/packages/renderer/fmt.d.ts +10 -0
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/renderer/index.d.ts +1 -0
- package/dist/packages/renderer/index.js +1 -1
- package/dist/packages/renderer/testLabel.d.ts +0 -11
- package/dist/packages/renderer/testLabel.js +1 -1
- package/dist/packages/renderer/valueFilter.d.ts +1 -1
- package/dist/packages/renderer/valueFilter.js +1 -1
- package/dist/packages/stats/analyzeWaferLot.d.ts +22 -0
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.d.ts +26 -1
- 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/connectedComponents.js +1 -1
- package/dist/packages/stats/control.d.ts +21 -0
- package/dist/packages/stats/control.js +1 -0
- package/dist/packages/stats/correlation.d.ts +42 -4
- 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 +21 -6
- package/dist/packages/stats/filterFindings.js +1 -1
- package/dist/packages/stats/findingText.d.ts +8 -0
- package/dist/packages/stats/findingText.js +2 -2
- 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 +5 -2
- package/dist/packages/stats/index.js +1 -1
- package/dist/packages/stats/lotDrift.js +1 -1
- package/dist/packages/stats/math.d.ts +29 -4
- package/dist/packages/stats/math.js +1 -1
- package/dist/packages/stats/mergeTestDefs.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 +33 -33
- package/dist/packages/stats/reportHtml.d.ts +5 -12
- package/dist/packages/stats/reportHtml.js +98 -40
- package/dist/packages/stats/synthesis.d.ts +48 -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/testValueBudget.d.ts +15 -0
- package/dist/packages/stats/testValueBudget.js +1 -0
- package/dist/packages/stats/types.d.ts +90 -30
- 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
|
@@ -31,27 +31,42 @@ export declare function visibleFindings<T extends {
|
|
|
31
31
|
export declare function findingPatternKey(f: StatsFinding): string;
|
|
32
32
|
/** A findings list as the reader sees it: patterns with the findings they explain, then the rest grouped by region. */
|
|
33
33
|
export interface ArrangedFindings {
|
|
34
|
-
/** Spatial-pattern findings, each with the findings in the list it names as supporting detail. */
|
|
34
|
+
/** Spatial-pattern findings, each with the findings in the list it names as supporting detail, most severe first. */
|
|
35
35
|
patterns: Array<{
|
|
36
36
|
finding: StatsFinding;
|
|
37
37
|
children: StatsFinding[];
|
|
38
38
|
}>;
|
|
39
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Everything else grouped by region (`family` and `left`), the most severe group first and within it too. A cluster
|
|
41
|
+
* of one bin leads a group of its own with the region findings of that bin it explains after it. `key` tells the
|
|
42
|
+
* groups apart: a cluster of one bin is keyed by its bin too, since another bin's cluster, or one over every fail
|
|
43
|
+
* bin, can have the same `left`.
|
|
44
|
+
*/
|
|
40
45
|
groups: Array<{
|
|
46
|
+
key: string;
|
|
41
47
|
family: string;
|
|
42
48
|
left: string;
|
|
43
49
|
worst: StatsSeverity;
|
|
44
50
|
findings: StatsFinding[];
|
|
45
51
|
}>;
|
|
46
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* A cluster of one hard bin, found in that fail bin alone (`analyzeWaferMap`'s per-bin run). It lists the region
|
|
55
|
+
* rises of its bin it explains (`relatedIds`), leads its own group, and in the results summary joins one item at
|
|
56
|
+
* most. The one test for it, read by the analysis, the arrangement and the summary alike.
|
|
57
|
+
*/
|
|
58
|
+
export declare function isOneBinCluster(f: Pick<StatsFinding, 'comparison' | 'variable'>): boolean;
|
|
59
|
+
/** Most severe first: the order every findings list is arranged in, and how two findings' severities compare. */
|
|
60
|
+
export declare const SEVERITY_ORDER: Record<StatsSeverity, number>;
|
|
47
61
|
/**
|
|
48
62
|
* The one arrangement of a findings list, read by the Summary panel and both HTML reports, so a
|
|
49
63
|
* finding sits under the same heading and in the same order on every surface.
|
|
50
64
|
*
|
|
51
|
-
* A finding a pattern lists as supporting detail
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
65
|
+
* A finding a pattern lists as supporting detail is shown under its pattern, and one a cluster lists
|
|
66
|
+
* (its bin's rise in a region it makes up) in the cluster's group; neither is repeated among the
|
|
67
|
+
* region groups. A finding another absorbed as an exact restatement is not shown anywhere (it stays in
|
|
68
|
+
* `summary.findings` for a host reading them programmatically). Not every finding's `relatedIds`: a
|
|
69
|
+
* run-merge records the constituents it replaced there, and those are gone.
|
|
55
70
|
*/
|
|
56
71
|
export declare function arrangeFindings(findings: readonly StatsFinding[]): ArrangedFindings;
|
|
57
72
|
//# sourceMappingURL=filterFindings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function c(n){return Array.isArray(n)?n:[n]}export function filterFindings(n,s){let t=n.findings;if(s.severity!==void 0){const r=new Set(c(s.severity));t=t.filter(o=>r.has(o.severity))}if(s.kind!==void 0){const r=new Set(c(s.kind));t=t.filter(o=>r.has(o.variable.kind))}if(s.family!==void 0){const r=new Set(c(s.family));t=t.filter(o=>r.has(o.comparison.family))}if(s.level!==void 0){const r=new Set(c(s.level));t=t.filter(o=>r.has(o.level))}return t}export function visibleFindings(n){const s=new Set(n.flatMap(t=>t.absorbedIds??[]));return n.filter(t=>!s.has(t.id))}export function findingPatternKey(n){return[n.variable.kind,n.variable.index??"",n.variable.bin??"",n.comparison.family,n.comparison.left,n.effect.direction].join("|")}export function isOneBinCluster(n){return n.comparison.family==="cluster"&&n.variable.kind==="hardBin"}export const SEVERITY_ORDER={unusual:0,notable:1,info:2};export function arrangeFindings(n){const s=new Set(n.flatMap(e=>e.absorbedIds??[])),t=n.filter(e=>!s.has(e.id)),r=t.filter(e=>e.comparison.family==="spatial-pattern"),o=new Set(r.flatMap(e=>e.relatedIds??[])),a=new Map;for(const e of t)if(isOneBinCluster(e))for(const i of e.relatedIds??[])!o.has(i)&&!a.has(i)&&a.set(i,e);const f=(e,i)=>SEVERITY_ORDER[e.severity]-SEVERITY_ORDER[i.severity],b=r.map(e=>{const i=t.filter(l=>e.relatedIds?.includes(l.id)),d=t.filter(l=>i.includes(a.get(l.id)));return{finding:e,children:[...i,...d].sort(f)}}),u=new Map,w=e=>`${e.comparison.family}\0${e.comparison.left}${isOneBinCluster(e)?`\0${e.variable.bin}`:""}`;for(const e of t){if(e.comparison.family==="spatial-pattern"||o.has(e.id))continue;const i=a.get(e.id);if(i&&o.has(i.id))continue;const d=w(i??e);u.set(d,[...u.get(d)??[],e])}const p=[...u.entries()].map(([e,i])=>{const d=[...i].sort((y,m)=>Number(a.has(y.id))-Number(a.has(m.id))||f(y,m)),[l,h]=e.split("\0");return{key:e,family:l,left:h,worst:[...i].sort(f)[0].severity,findings:d}});return p.sort((e,i)=>SEVERITY_ORDER[e.worst]-SEVERITY_ORDER[i.worst]),{patterns:b,groups:p}}
|
|
@@ -6,4 +6,12 @@ import type { StatsFinding } from './types.js';
|
|
|
6
6
|
* line of their own.
|
|
7
7
|
*/
|
|
8
8
|
export declare function formatFindingTooltip(finding: StatsFinding): string;
|
|
9
|
+
/**
|
|
10
|
+
* What a finding measured, for a column headed "Metric": the variable's label,
|
|
11
|
+
* and for a test which statistic of it. A test's mean and its limit fail rate
|
|
12
|
+
* share a label, and without the word a rate reads as a shift in the values.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findingMetricLabel(finding: Pick<StatsFinding, 'variable'>): string;
|
|
15
|
+
/** True when the finding compares a proportion (a fraction of dies), so its `absoluteDelta` is a fraction. */
|
|
16
|
+
export declare function isProportionFinding(finding: Pick<StatsFinding, 'variable'>): boolean;
|
|
9
17
|
//# sourceMappingURL=findingText.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{derivedTestNote as
|
|
2
|
-
${
|
|
1
|
+
import{derivedTestNote as n}from"../renderer/testLabel.js";export function formatFindingTooltip(e){const t=n(e.variable);return t?`${e.summary}
|
|
2
|
+
${t}`:e.summary}export function findingMetricLabel(e){const{kind:t,label:i,measure:r}=e.variable;return t!=="test"?i:r==="limitFailRate"?`${i} limit fail rate`:`${i} mean`}export function isProportionFinding(e){const{kind:t,measure:i}=e.variable;return t==="yield"||t==="hardBin"||t==="softBin"||t==="functionalTest"||t==="test"&&i==="limitFailRate"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Die } from '../core/dies.js';
|
|
2
|
+
import { type TestDef } from '../renderer/buildWaferMap.js';
|
|
3
|
+
/** One group's wafer values, summarised. */
|
|
4
|
+
export interface GroupSummary {
|
|
5
|
+
key: string;
|
|
6
|
+
/** Wafers with a value. */
|
|
7
|
+
n: number;
|
|
8
|
+
mean: number;
|
|
9
|
+
/** Sample standard deviation of the wafer values; NaN with fewer than two. */
|
|
10
|
+
sd: number;
|
|
11
|
+
median: number;
|
|
12
|
+
}
|
|
13
|
+
/** A group set against the control group. */
|
|
14
|
+
export interface ControlContrast {
|
|
15
|
+
key: string;
|
|
16
|
+
/** Group mean minus control mean, in the test's unit. */
|
|
17
|
+
delta: number;
|
|
18
|
+
/** `delta` over the pooled wafer-to-wafer standard deviation of the two groups. */
|
|
19
|
+
deltaSd: number;
|
|
20
|
+
t: number;
|
|
21
|
+
df: number;
|
|
22
|
+
p: number;
|
|
23
|
+
/** Holm-adjusted over every group's comparison with the control. */
|
|
24
|
+
pAdjusted: number;
|
|
25
|
+
}
|
|
26
|
+
export interface GroupComparison {
|
|
27
|
+
groups: GroupSummary[];
|
|
28
|
+
/** Groups left out of the tests, each with fewer than two wafers. */
|
|
29
|
+
tooSmall: string[];
|
|
30
|
+
/** Welch's ANOVA, or Welch's t for two groups. Absent when it cannot be computed (see `issue`). */
|
|
31
|
+
welch?: {
|
|
32
|
+
method: 'welch-t' | 'welch-anova';
|
|
33
|
+
statistic: number;
|
|
34
|
+
df1: number;
|
|
35
|
+
df2: number;
|
|
36
|
+
p: number;
|
|
37
|
+
};
|
|
38
|
+
/** Kruskal–Wallis on the wafer values. `approximate` when a group has fewer than five wafers: its chi-square p is then rough. */
|
|
39
|
+
kruskal?: {
|
|
40
|
+
h: number;
|
|
41
|
+
df: number;
|
|
42
|
+
p: number;
|
|
43
|
+
approximate: boolean;
|
|
44
|
+
};
|
|
45
|
+
control?: string;
|
|
46
|
+
contrasts?: ControlContrast[];
|
|
47
|
+
/** Why a test could not be computed, in the reader's words. */
|
|
48
|
+
issue?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Compares groups of wafer values. Groups keep the order given (the caller's legend order). A group with fewer than
|
|
52
|
+
* two wafers is summarised but left out of the tests, and named in `tooSmall`; `control`, when it names a group that
|
|
53
|
+
* is tested, gets each other group set against it.
|
|
54
|
+
*/
|
|
55
|
+
export declare function compareGroups(groups: ReadonlyArray<{
|
|
56
|
+
key: string;
|
|
57
|
+
values: readonly number[];
|
|
58
|
+
}>, control?: string): GroupComparison;
|
|
59
|
+
/** The p-value a comparison is read and ranked by: Welch's when it could be computed, else Kruskal–Wallis's. */
|
|
60
|
+
export declare const comparisonP: (c: GroupComparison) => number;
|
|
61
|
+
/** A wafer of the comparison: its dies, and the group it is in (undefined: in no group, left out). */
|
|
62
|
+
export interface CompareWafer {
|
|
63
|
+
dies: readonly Die[];
|
|
64
|
+
group: string | undefined;
|
|
65
|
+
}
|
|
66
|
+
/** One test's comparison, for the ranked table. */
|
|
67
|
+
export interface TestComparison {
|
|
68
|
+
test: TestDef;
|
|
69
|
+
comparison: GroupComparison;
|
|
70
|
+
/** Benjamini–Hochberg-adjusted `comparisonP` over the tests compared. */
|
|
71
|
+
pAdjusted: number;
|
|
72
|
+
/** The largest group-mean difference from the control (or between groups, without one), in wafer-to-wafer SDs. */
|
|
73
|
+
effect: number;
|
|
74
|
+
/** The largest difference as a share of the limit window, when the test has both limits (spec first). */
|
|
75
|
+
windowShare?: number;
|
|
76
|
+
}
|
|
77
|
+
/** The group keys in order: natural order, as the legend sorts them. */
|
|
78
|
+
export declare function groupKeys(wafers: readonly CompareWafer[]): string[];
|
|
79
|
+
/**
|
|
80
|
+
* Every parametric test of `testDefs` compared across the groups of `wafers`, each wafer reduced to the mean of its
|
|
81
|
+
* dies' values, ranked: by adjusted p, then by effect. Tests no wafer has a value for are left out; a test whose
|
|
82
|
+
* comparison could not be computed ranks after those that could. One pass over the dies reads every test.
|
|
83
|
+
*/
|
|
84
|
+
export declare function compareTestsByGroup(wafers: readonly CompareWafer[], testDefs: readonly TestDef[], control?: string): TestComparison[];
|
|
85
|
+
/** A p-value as a reader is shown one: three decimals, "< 0.001" below that, "—" when there is none. */
|
|
86
|
+
export declare function formatP(p: number): string;
|
|
87
|
+
//# sourceMappingURL=groupCompare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{testValuesReader as j}from"../core/dieTable.js";import{isParametricTest as q}from"../renderer/buildWaferMap.js";import{benjaminiHochberg as T,chiSquareUpperTail as L,fUpperTail as O,holm as P,sampleVariance as U,tTwoSided as x}from"./math.js";import{capabilityLimits as K}from"./capability.js";import{compareNatural as V,maxOf as W,median as G,minOf as R}from"../core/utils.js";const B=5,E=(n,s)=>{const i=s.length,f=i?s.reduce((u,k)=>u+k,0)/i:NaN;return{key:n,n:i,mean:f,sd:i>=2?Math.sqrt(U(s,f)):NaN,median:i?G([...s]):NaN}};function H(n){const s=n.length;if(n.some(e=>!(e.sd>0)))return;if(s===2){const[e,r]=n,d=e.sd**2/e.n,o=r.sd**2/r.n,y=(e.mean-r.mean)/Math.sqrt(d+o),w=(d+o)**2/(d**2/(e.n-1)+o**2/(r.n-1));return{method:"welch-t",statistic:y,df1:1,df2:w,p:x(y,w)}}const i=n.map(e=>e.n/e.sd**2),f=i.reduce((e,r)=>e+r,0),u=n.reduce((e,r,d)=>e+i[d]*r.mean,0)/f,k=n.reduce((e,r,d)=>e+i[d]*(r.mean-u)**2,0)/(s-1),c=n.reduce((e,r,d)=>e+(1-i[d]/f)**2/(r.n-1),0),m=k/(1+2*(s-2)*c/(s*s-1)),t=(s*s-1)/(3*c);return{method:"welch-anova",statistic:m,df1:s-1,df2:t,p:O(m,s-1,t)}}function I(n){const s=n.flatMap((t,e)=>t.map(r=>({v:r,g:e}))),i=s.length;if(n.length<2||i<3)return;s.sort((t,e)=>t.v-e.v);const f=new Array(n.length).fill(0);let u=0;for(let t=0;t<i;){let e=t;for(;e+1<i&&s[e+1].v===s[t].v;)e++;const r=(t+e)/2+1;for(let o=t;o<=e;o++)f[s[o].g]+=r;const d=e-t+1;u+=d**3-d,t=e+1}const k=1-u/(i**3-i);if(!(k>0))return;const c=(12/(i*(i+1))*n.reduce((t,e,r)=>t+f[r]**2/e.length,0)-3*(i+1))/k,m=n.length-1;return{h:c,df:m,p:L(c,m),approximate:n.some(t=>t.length<B)}}export function compareGroups(n,s){const i=n.map(e=>({key:e.key,values:e.values.filter(Number.isFinite)})),f=i.map(e=>E(e.key,e.values)),u=i.filter(e=>e.values.length>=2),k=i.filter(e=>e.values.length<2).map(e=>e.key),c={groups:f,tooSmall:k};if(u.length<2)return c.issue="Needs at least two groups with two or more wafers each",c;const m=f.filter(e=>u.some(r=>r.key===e.key));c.welch=H(m),c.kruskal=I(u.map(e=>e.values)),!c.welch&&!c.kruskal?c.issue="The wafer values do not vary, so there is nothing to compare":c.welch||(c.issue="A group\u2019s wafers all have the same value, so Welch\u2019s test cannot be computed; the rank test stands");const t=s!==void 0?m.find(e=>e.key===s):void 0;if(t){const e=m.filter(o=>o.key!==t.key).map(o=>{const y=o.sd**2/o.n,w=t.sd**2/t.n,a=Math.sqrt(y+w),p=o.mean-t.mean,l=a>0?p/a:NaN,h=a>0?(y+w)**2/(y**2/(o.n-1)+w**2/(t.n-1)):NaN,b=Math.sqrt(((o.n-1)*o.sd**2+(t.n-1)*t.sd**2)/(o.n+t.n-2));return{key:o.key,delta:p,deltaSd:b>0?p/b:NaN,t:l,df:h,p:Number.isFinite(l)?x(l,h):NaN}}),r=e.filter(o=>Number.isFinite(o.p)),d=P(r.map(o=>o.p));c.control=t.key,c.contrasts=e.map(o=>({...o,pAdjusted:Number.isFinite(o.p)?d[r.indexOf(o)]:NaN}))}return c}export const comparisonP=n=>n.welch?.p??n.kruskal?.p??NaN;export function groupKeys(n){return[...new Set(n.map(s=>s.group).filter(s=>s!==void 0))].sort(V)}export function compareTestsByGroup(n,s,i){const f=s.filter(q);if(f.length===0)return[];const u=f.map(a=>a.testNumber),k=j(u),c=new Float64Array(u.length),m=groupKeys(n),t=f.map(()=>m.map(()=>[])),e=new Float64Array(u.length),r=new Uint32Array(u.length);for(const a of n){if(a.group===void 0)continue;const p=m.indexOf(a.group);e.fill(0),r.fill(0);for(const l of a.dies){k(l,c);for(let h=0;h<c.length;h++){const b=c[h];Number.isFinite(b)&&(e[h]+=b,r[h]++)}}for(let l=0;l<u.length;l++)r[l]>0&&t[l][p].push(e[l]/r[l])}const d=f.map((a,p)=>{if(t[p].every(N=>N.length===0))return;const l=compareGroups(m.map((N,g)=>({key:N,values:t[p][g]})),i),h=K(a),b=h?h.usl-h.lsl:void 0,A=l.groups.filter(N=>!l.tooSmall.includes(N.key));let M=NaN,S=NaN;if(l.contrasts?.length){const N=l.contrasts.reduce((g,v)=>Math.abs(v.deltaSd)>Math.abs(g.deltaSd)?v:g);M=N.deltaSd,S=N.delta}else if(A.length>=2){const N=A.map(v=>v.mean);S=W(N)-R(N);const g=A.reduce((v,F)=>v+(F.n-1)*F.sd**2,0)/A.reduce((v,F)=>v+F.n-1,0);M=g>0?S/Math.sqrt(g):NaN}return{test:a,comparison:l,pAdjusted:NaN,effect:M,...b&&Number.isFinite(S)?{windowShare:S/b}:{}}}).filter(a=>a!==void 0),o=d.filter(a=>Number.isFinite(comparisonP(a.comparison))),y=T(o.map(a=>comparisonP(a.comparison)));o.forEach((a,p)=>{a.pAdjusted=y[p]});const w=a=>Number.isFinite(a.pAdjusted)?a.pAdjusted:1/0;return d.sort((a,p)=>w(a)-w(p)||(Math.abs(p.effect)||0)-(Math.abs(a.effect)||0))}export function formatP(n){return Number.isFinite(n)?n<.001?"< 0.001":n.toFixed(3):"\u2014"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface GuideSection {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const GUIDE_SECTIONS: {
|
|
6
|
+
readonly groups: {
|
|
7
|
+
readonly id: "wmap-comparing-groups-of-wafers";
|
|
8
|
+
readonly title: "Comparing groups of wafers";
|
|
9
|
+
};
|
|
10
|
+
readonly dividesYield: {
|
|
11
|
+
readonly id: "wmap-what-divides-yield";
|
|
12
|
+
readonly title: "What divides yield";
|
|
13
|
+
};
|
|
14
|
+
readonly probability: {
|
|
15
|
+
readonly id: "wmap-the-cumulative-probability-plot";
|
|
16
|
+
readonly title: "The cumulative probability plot";
|
|
17
|
+
};
|
|
18
|
+
readonly control: {
|
|
19
|
+
readonly id: "wmap-control-charts";
|
|
20
|
+
readonly title: "Control charts";
|
|
21
|
+
};
|
|
22
|
+
readonly goal: {
|
|
23
|
+
readonly id: "wmap-capability-ppk-and-the-goal-plot";
|
|
24
|
+
readonly title: "Capability, Ppk and the goal plot";
|
|
25
|
+
};
|
|
26
|
+
readonly heatmap: {
|
|
27
|
+
readonly id: "wmap-heatmaps-and-the-difference-map";
|
|
28
|
+
readonly title: "Heatmaps and the difference map";
|
|
29
|
+
};
|
|
30
|
+
readonly pat: {
|
|
31
|
+
readonly id: "wmap-part-average-testing-pat";
|
|
32
|
+
readonly title: "Part average testing (PAT)";
|
|
33
|
+
};
|
|
34
|
+
readonly fit: {
|
|
35
|
+
readonly id: "wmap-fit-lines-r-and-y-x";
|
|
36
|
+
readonly title: "Fit lines, R² and y = x";
|
|
37
|
+
};
|
|
38
|
+
readonly bands: {
|
|
39
|
+
readonly id: "wmap-bands-on-a-line";
|
|
40
|
+
readonly title: "Bands on a line";
|
|
41
|
+
};
|
|
42
|
+
readonly rescaling: {
|
|
43
|
+
readonly id: "wmap-rescaling-values";
|
|
44
|
+
readonly title: "Rescaling values";
|
|
45
|
+
};
|
|
46
|
+
readonly ranges: {
|
|
47
|
+
readonly id: "wmap-ranges-panels-and-what-if-limits";
|
|
48
|
+
readonly title: "Ranges, panels and what-if limits";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/** Several cites as plain text, one sentence: `How to read this: “Control charts” and “Bands on a line” in the user guide.` */
|
|
52
|
+
export declare function guideCitesText(sections: readonly GuideSection[]): string[];
|
|
53
|
+
/** A cite as plain text, for a saved image or print: `How to read this: “Control charts” in the user guide` (no full stop). */
|
|
54
|
+
export declare function guideCiteText(section: GuideSection, lead?: string): string;
|
|
55
|
+
//# sourceMappingURL=guideSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const GUIDE_SECTIONS={groups:{id:"wmap-comparing-groups-of-wafers",title:"Comparing groups of wafers"},dividesYield:{id:"wmap-what-divides-yield",title:"What divides yield"},probability:{id:"wmap-the-cumulative-probability-plot",title:"The cumulative probability plot"},control:{id:"wmap-control-charts",title:"Control charts"},goal:{id:"wmap-capability-ppk-and-the-goal-plot",title:"Capability, Ppk and the goal plot"},heatmap:{id:"wmap-heatmaps-and-the-difference-map",title:"Heatmaps and the difference map"},pat:{id:"wmap-part-average-testing-pat",title:"Part average testing (PAT)"},fit:{id:"wmap-fit-lines-r-and-y-x",title:"Fit lines, R\xB2 and y = x"},bands:{id:"wmap-bands-on-a-line",title:"Bands on a line"},rescaling:{id:"wmap-rescaling-values",title:"Rescaling values"},ranges:{id:"wmap-ranges-panels-and-what-if-limits",title:"Ranges, panels and what-if limits"}};export function guideCitesText(t){return t.length===0?[]:[`How to read this: ${t.map(i=>`\u201C${i.title}\u201D`).join(t.length===2?" and ":", ")} in the user guide.`]}export function guideCiteText(t,i="How to read this"){return`${i}: \u201C${t.title}\u201D in the user guide`}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
export { analyzeWaferMap } from './analyzeWaferMap.js';
|
|
3
|
-
export { analyzeWaferLot } from './analyzeWaferLot.js';
|
|
3
|
+
export { analyzeWaferLot, analyzeWaferLotAsync } from './analyzeWaferLot.js';
|
|
4
|
+
export type { AnalyzeWaferLotAsyncOptions } from './analyzeWaferLot.js';
|
|
4
5
|
export { filterFindings, visibleFindings } from './filterFindings.js';
|
|
5
6
|
export type { FindingsFilter } from './filterFindings.js';
|
|
6
7
|
export type { PatternLabel, PatternClassification, PatternFeatures } from './patternClassification.js';
|
|
@@ -15,5 +16,7 @@ export type { MetadataKeySelection } from './metadataColumns.js';
|
|
|
15
16
|
export { mergeTestDefs } from './mergeTestDefs.js';
|
|
16
17
|
export type { MergedTestDefs, TestDefConflict, TestDefConflictKind } from './mergeTestDefs.js';
|
|
17
18
|
export { readPlotsFile, writePlotsFile } from './plotSpec.js';
|
|
18
|
-
export
|
|
19
|
+
export { readFiltersFile, writeFiltersFile } from './filterFile.js';
|
|
20
|
+
export type { SavedFilter } from './filterFile.js';
|
|
21
|
+
export type { PlotSpec, PlotFilter, PlotCondition, ReadPlotsResult } from './plotSpec.js';
|
|
19
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./types.js";export{analyzeWaferMap}from"./analyzeWaferMap.js";export{analyzeWaferLot}from"./analyzeWaferLot.js";export{filterFindings,visibleFindings}from"./filterFindings.js";export{setReportOpener}from"./renderFindingsReport.js";export{renderWaferReportHtml,renderLotReportHtml}from"./renderSummaryReport.js";export{buildFacetTable,facetValueOf,attributeLabel,FACET_NONE_VALUE}from"./facets.js";export{mergeTestDefs}from"./mergeTestDefs.js";export{readPlotsFile,writePlotsFile}from"./plotSpec.js";
|
|
1
|
+
export*from"./types.js";export{analyzeWaferMap}from"./analyzeWaferMap.js";export{analyzeWaferLot,analyzeWaferLotAsync}from"./analyzeWaferLot.js";export{filterFindings,visibleFindings}from"./filterFindings.js";export{setReportOpener}from"./renderFindingsReport.js";export{renderWaferReportHtml,renderLotReportHtml}from"./renderSummaryReport.js";export{buildFacetTable,facetValueOf,attributeLabel,FACET_NONE_VALUE}from"./facets.js";export{mergeTestDefs}from"./mergeTestDefs.js";export{readPlotsFile,writePlotsFile}from"./plotSpec.js";export{readFiltersFile,writeFiltersFile}from"./filterFile.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{benjaminiHochberg as v,mannKendall as b}from"./math.js";import{fmt as y}from"../renderer/fmt.js";export const DRIFT_MIN_WAFERS=5;const M=2,N=.5,x=5,S=1;function _(m){const d=[],i=m.map(n=>({waferIndex:n.waferIndex,y:n.summary.stats.yieldPercent})).filter(n=>n.y!==null&&n.y!==void 0);if(i.length>=DRIFT_MIN_WAFERS){const n=b(i.map(e=>e.y));n&&d.push({kind:"yield",label:"Yield",values:i.map(e=>e.y),waferIndices:i.map(e=>e.waferIndex),mk:n})}const r=new Map;for(const{waferIndex:n,summary:e}of m)for(const t of e.stats.perTestStats??[]){if(!Number.isFinite(t.mean)||!(t.count>0))continue;const l=r.get(t.testNumber)??{label:t.label,rows:[]};l.rows.push({waferIndex:n,mean:t.mean,n:t.count,sd:t.stddev}),r.set(t.testNumber,l)}for(const[n,{label:e,rows:t}]of r){if(t.length<DRIFT_MIN_WAFERS)continue;const l=b(t.map(s=>s.mean));if(!l)continue;const o=t.reduce((s,u)=>s+Math.max(0,u.n-1),0),f=o>0?Math.sqrt(t.reduce((s,u)=>s+Math.max(0,u.n-1)*u.sd**2,0)/o):0;d.push({kind:"test",testNumber:n,label:e,values:t.map(s=>s.mean),waferIndices:t.map(s=>s.waferIndex),sigma:f,mk:l})}return d}export function buildDriftFindings(m,d){const i=_(m);if(!i.length)return[];const r=v(i.map(e=>e.mk.pValue)),n=[];return i.forEach((e,t)=>{if(r[t]>d)return;const{slope:l,intercept:o,n:f}=e.mk,s=o,a=o+l*(f-1)-s,p=a>0,h=e.kind==="test"&&e.sigma&&e.sigma>0?Math.abs(a)/e.sigma:void 0;if(e.kind==="yield"?Math.abs(a)<M:h===void 0||h<N)return;const g=(e.kind==="yield"?Math.abs(a)>=x:(h??0)>=S)&&r[t]<=.01?"unusual":"notable",k=p?"rises":"falls",c={first:e.values[0],last:e.values[e.values.length-1]},I=e.kind==="yield"?`${c.first.toFixed(1)}% \u2192 ${c.last.toFixed(1)}%`:`${y(c.first)} \u2192 ${y(c.last)}`,w=e.kind==="yield"?"on successive wafers":"across the wafers";n.push({id:e.kind==="yield"?"drift:yield":`drift:test:${e.testNumber}`,level:"inter-wafer",severity:g,variable:e.kind==="yield"?{kind:"yield",label:"Yield"}:{kind:"test",index:e.testNumber,label:e.label},comparison:{family:"wafer",left:"Wafers in input order",right:"a constant level"},effect:{direction:p?"higher":"lower",absoluteDelta:e.kind==="yield"?a/100:a,...e.kind==="yield"?{}:{relativeDelta:s!==0?a/Math.abs(s):void 0},effectSize:e.kind==="yield"?a/100:a/(e.sigma||1)},stats:{method:"mann-kendall",pValue:e.mk.pValue,adjustedPValue:r[t],sampleSizeLeft:f,sampleSizeRight:0},summary:`${e.label} ${k} ${w}: ${I} over ${f} wafers (input order)`,highlight:{kind:"wafer",waferIndices:e.waferIndices}})}),n}
|
|
1
|
+
import{benjaminiHochberg as v,mannKendall as b}from"./math.js";import{fmt as y}from"../renderer/fmt.js";export const DRIFT_MIN_WAFERS=5;const M=2,N=.5,x=5,S=1;function _(m){const d=[],i=m.map(n=>({waferIndex:n.waferIndex,y:n.summary.stats.yieldPercent})).filter(n=>n.y!==null&&n.y!==void 0);if(i.length>=DRIFT_MIN_WAFERS){const n=b(i.map(e=>e.y));n&&d.push({kind:"yield",label:"Yield",values:i.map(e=>e.y),waferIndices:i.map(e=>e.waferIndex),mk:n})}const r=new Map;for(const{waferIndex:n,summary:e}of m)for(const t of e.stats.perTestStats??[]){if(!Number.isFinite(t.mean)||!(t.count>0))continue;const l=r.get(t.testNumber)??{label:t.label,rows:[]};l.rows.push({waferIndex:n,mean:t.mean,n:t.count,sd:t.stddev}),r.set(t.testNumber,l)}for(const[n,{label:e,rows:t}]of r){if(t.length<DRIFT_MIN_WAFERS)continue;const l=b(t.map(s=>s.mean));if(!l)continue;const o=t.reduce((s,u)=>s+Math.max(0,u.n-1),0),f=o>0?Math.sqrt(t.reduce((s,u)=>s+Math.max(0,u.n-1)*u.sd**2,0)/o):0;d.push({kind:"test",testNumber:n,label:e,values:t.map(s=>s.mean),waferIndices:t.map(s=>s.waferIndex),sigma:f,mk:l})}return d}export function buildDriftFindings(m,d){const i=_(m);if(!i.length)return[];const r=v(i.map(e=>e.mk.pValue)),n=[];return i.forEach((e,t)=>{if(r[t]>d)return;const{slope:l,intercept:o,n:f}=e.mk,s=o,a=o+l*(f-1)-s,p=a>0,h=e.kind==="test"&&e.sigma&&e.sigma>0?Math.abs(a)/e.sigma:void 0;if(e.kind==="yield"?Math.abs(a)<M:h===void 0||h<N)return;const g=(e.kind==="yield"?Math.abs(a)>=x:(h??0)>=S)&&r[t]<=.01?"unusual":"notable",k=p?"rises":"falls",c={first:e.values[0],last:e.values[e.values.length-1]},I=e.kind==="yield"?`${c.first.toFixed(1)}% \u2192 ${c.last.toFixed(1)}%`:`${y(c.first)} \u2192 ${y(c.last)}`,w=e.kind==="yield"?"on successive wafers":"across the wafers";n.push({id:e.kind==="yield"?"drift:yield":`drift:test:${e.testNumber}`,level:"inter-wafer",severity:g,variable:e.kind==="yield"?{kind:"yield",label:"Yield"}:{kind:"test",measure:"mean",index:e.testNumber,label:e.label},comparison:{family:"wafer",left:"Wafers in input order",right:"a constant level"},effect:{direction:p?"higher":"lower",absoluteDelta:e.kind==="yield"?a/100:a,...e.kind==="yield"?{}:{relativeDelta:s!==0?a/Math.abs(s):void 0},effectSize:e.kind==="yield"?a/100:a/(e.sigma||1)},stats:{method:"mann-kendall",pValue:e.mk.pValue,adjustedPValue:r[t],sampleSizeLeft:f,sampleSizeRight:0},summary:`${e.label} ${k} ${w}: ${I} over ${f} wafers (input order)`,highlight:{kind:"wafer",waferIndices:e.waferIndices}})}),n}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** The error function erf(x), from {@link complementaryErrorFunction}. */
|
|
2
|
-
export declare function errorFunction(value: number): number;
|
|
3
1
|
/**
|
|
4
2
|
* The complementary error function erfc(x) = 1 − erf(x), accurate to about 1e-15 relative across the whole
|
|
5
3
|
* range, the far tail included: W. J. Cody's rational approximations (Math. Comp. 23, 1969; the CALERF
|
|
@@ -7,10 +5,14 @@ export declare function errorFunction(value: number): number;
|
|
|
7
5
|
* about 1e-7 and becomes 0.
|
|
8
6
|
*/
|
|
9
7
|
export declare function complementaryErrorFunction(value: number): number;
|
|
10
|
-
/** Standard normal cumulative distribution function Φ(value). */
|
|
11
|
-
export declare function normalCdf(value: number): number;
|
|
12
8
|
/** The standard normal upper tail 1 − Φ(value), accurate where it is small. */
|
|
13
9
|
export declare function normalUpperTail(value: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* The standard normal quantile Φ⁻¹(p) for 0 < p < 1 (±Infinity at 0 and 1, NaN outside): Acklam's rational
|
|
12
|
+
* approximation, then one Halley step against `normalUpperTail`, which brings it to near machine precision in the
|
|
13
|
+
* tails a probability plot reads.
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalQuantile(p: number): number;
|
|
14
16
|
/** Two-sided p-value of a z statistic: the one rule every z-based test in the library reads its p from. */
|
|
15
17
|
export declare function zPValue(z: number): number;
|
|
16
18
|
/**
|
|
@@ -39,6 +41,29 @@ export declare function seededRandom(seed: number): () => number;
|
|
|
39
41
|
* die positions a lot's failures recur at (`findLotPattern`) both go through it.
|
|
40
42
|
*/
|
|
41
43
|
export declare function benjaminiHochberg(pValues: readonly number[]): number[];
|
|
44
|
+
/**
|
|
45
|
+
* Holm's step-down adjustment of a family of p-values: the family-wise error rule for a few comparisons against one
|
|
46
|
+
* control, where every one of them is read as a claim (BH, above, is for ranking many). Order of the input is kept.
|
|
47
|
+
*/
|
|
48
|
+
export declare function holm(pValues: readonly number[]): number[];
|
|
49
|
+
/**
|
|
50
|
+
* The regularised incomplete beta function I_x(a, b), by Lentz's continued fraction on whichever side of the mean it
|
|
51
|
+
* converges fast. The one source of the t and F tails below.
|
|
52
|
+
*/
|
|
53
|
+
export declare function incompleteBeta(x: number, a: number, b: number): number;
|
|
54
|
+
/**
|
|
55
|
+
* The regularised upper incomplete gamma Q(a, x) = Γ(a, x) / Γ(a): a series below a + 1, a continued fraction above.
|
|
56
|
+
* The chi-square tail below reads it.
|
|
57
|
+
*/
|
|
58
|
+
export declare function upperIncompleteGamma(a: number, x: number): number;
|
|
59
|
+
/** Two-sided p-value of Student's t with `df` degrees of freedom (fractional, as Welch's are, is fine). */
|
|
60
|
+
export declare function tTwoSided(t: number, df: number): number;
|
|
61
|
+
/** The t with two-sided tail `p` on `df` degrees of freedom (2.776 for p 0.05, df 4): bisection on `tTwoSided`. */
|
|
62
|
+
export declare function tQuantileTwoSided(p: number, df: number): number;
|
|
63
|
+
/** Upper tail P(F ≥ f) of the F distribution with (df1, df2) degrees of freedom. */
|
|
64
|
+
export declare function fUpperTail(f: number, df1: number, df2: number): number;
|
|
65
|
+
/** Upper tail P(X ≥ x) of the chi-square distribution with `df` degrees of freedom. */
|
|
66
|
+
export declare function chiSquareUpperTail(x: number, df: number): number;
|
|
42
67
|
/** Linear-interpolation quantile of a pre-sorted array (`q` in [0, 1]).
|
|
43
68
|
*
|
|
44
69
|
* `ArrayLike<number>`, not `number[]`, so a caller holding its values in a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function complementaryErrorFunction(t){const e=Math.abs(t);let n;if(e<=.46875){const r=e>111e-18?e*e:0;let o=q[4]*r,f=r;for(let l=0;l<3;l++)o=(o+q[l])*r,f=(f+y[l])*r;return 1-t*(o+q[3])/(f+y[3])}if(e<=4){let r=x[8]*e,o=e;for(let f=0;f<7;f++)r=(r+x[f])*e,o=(o+w[f])*e;n=(r+x[7])/(o+w[7])}else{if(e>=26.543)return t>0?0:2;const r=1/(e*e);let o=b[5]*r,f=r;for(let s=0;s<4;s++)o=(o+b[s])*r,f=(f+I[s])*r;n=(1/Math.sqrt(Math.PI)-r*(o+b[4])/(f+I[4]))/e}const c=Math.trunc(e*16)/16,i=(e-c)*(e+c);return n*=Math.exp(-c*c)*Math.exp(-i),t<0?2-n:n}const q=[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],y=[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],x=[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],w=[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],b=[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097],I=[2.568520192289822,1.8729528499234673,.5279051029514285,.06051834131244132,.0023352049762686918];export function normalUpperTail(t){return .5*complementaryErrorFunction(t/Math.SQRT2)}export function normalQuantile(t){if(!(t>=0&&t<=1))return NaN;if(t===0)return-1/0;if(t===1)return 1/0;const e=[-39.69683028665376,220.9460984245205,-275.9285104469687,138.357751867269,-30.66479806614716,2.506628277459239],n=[-54.47609879822406,161.5858368580409,-155.6989798598866,66.80131188771972,-13.28068155288572],c=[-.007784894002430293,-.3223964580411365,-2.400758277161838,-2.549732539343734,4.374664141464968,2.938163982698783],i=[.007784695709041462,.3224671290700398,2.445134137142996,3.754408661907416],r=.02425;let o;if(t<r||t>1-r){const l=Math.sqrt(-2*Math.log(t<r?t:1-t));o=(((((c[0]*l+c[1])*l+c[2])*l+c[3])*l+c[4])*l+c[5])/((((i[0]*l+i[1])*l+i[2])*l+i[3])*l+1),t>1-r&&(o=-o)}else{const l=t-.5,u=l*l;o=(((((e[0]*u+e[1])*u+e[2])*u+e[3])*u+e[4])*u+e[5])*l/(((((n[0]*u+n[1])*u+n[2])*u+n[3])*u+n[4])*u+1)}const s=(t<.5?normalUpperTail(-o)-t:1-t-normalUpperTail(o))*Math.sqrt(2*Math.PI)*Math.exp(o*o/2);return o-s/(1+o*s/2)}export function zPValue(t){return Math.min(1,2*normalUpperTail(Math.abs(t)))}export function binomialUpperTail(t,e,n){if(t<=0)return 1;if(t>e||n<=0)return 0;if(n>=1)return 1;let c=t*Math.log(n)+(e-t)*Math.log1p(-n);for(let f=0;f<t;f++)c+=Math.log(e-f)-Math.log(f+1);let i=Math.exp(c),r=0;const o=n/(1-n);for(let f=t;f<=e;f++)r+=i,i*=(e-f)/(f+1)*o;return Math.min(1,r)}export function logGamma(t){if(t<.5)return Math.log(Math.PI/Math.sin(Math.PI*t))-logGamma(1-t);const e=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,15056327351493116e-23],n=t-1;let c=e[0];for(let r=1;r<9;r++)c+=e[r]/(n+r);const i=n+7.5;return .5*Math.log(2*Math.PI)+(n+.5)*Math.log(i)-i+Math.log(c)}export function fisherExact(t,e,n,c){const i=t+e,r=n+c,o=t+n,f=i+r,s=Math.max(0,o-r),l=Math.min(i,o);if(l<=s)return 1;const u=h=>logGamma(i+1)+logGamma(r+1)+logGamma(o+1)+logGamma(f-o+1)-logGamma(f+1)-logGamma(h+1)-logGamma(i-h+1)-logGamma(o-h+1)-logGamma(r-o+h+1),g=Math.exp(u(t));let m=Math.exp(u(s)),a=0;const M=g*(1+1e-7);for(let h=s;h<=l;h++)m<=M&&(a+=m),m*=(i-h)*(o-h)/((h+1)*(r-o+h+1));return Math.min(1,a)}export function seededRandom(t){let e=t>>>0;return()=>{e=e+1831565813>>>0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}export function benjaminiHochberg(t){const e=t.length,n=t.map((r,o)=>o).sort((r,o)=>t[r]-t[o]),c=new Array(e);let i=1;for(let r=e-1;r>=0;r--){const o=n[r];i=Math.min(i,t[o]*e/(r+1),1),c[o]=i}return c}export function holm(t){const e=t.length,n=t.map((r,o)=>o).sort((r,o)=>t[r]-t[o]),c=new Array(e);let i=0;return n.forEach((r,o)=>{i=Math.max(i,Math.min(1,(e-o)*t[r])),c[r]=i}),c}export function incompleteBeta(t,e,n){if(!(t>0))return 0;if(!(t<1))return 1;const c=Math.exp(logGamma(e+n)-logGamma(e)-logGamma(n)+e*Math.log(t)+n*Math.log1p(-t));if(t>(e+1)/(e+n+2))return 1-incompleteBeta(1-t,n,e);const i=1e-300;let r=1,o=1-(e+n)*t/(e+1);Math.abs(o)<i&&(o=i),o=1/o;let f=o;for(let s=1;s<=300;s++){for(const l of[!0,!1]){const u=l?s*(n-s)*t/((e+2*s-1)*(e+2*s)):-((e+s)*(e+n+s)*t)/((e+2*s)*(e+2*s+1));o=1+u*o,Math.abs(o)<i&&(o=i),o=1/o,r=1+u/r,Math.abs(r)<i&&(r=i),f*=r*o}if(Math.abs(r*o-1)<1e-15)break}return c*f/e}export function upperIncompleteGamma(t,e){if(!(e>0))return 1;const n=-e+t*Math.log(e)-logGamma(t);if(e<t+1){let s=1/t,l=s;for(let u=1;u<500&&(l*=e/(t+u),s+=l,!(Math.abs(l)<Math.abs(s)*1e-16));u++);return Math.max(0,1-s*Math.exp(n))}const c=1e-300;let i=e+1-t,r=1/c,o=1/i,f=o;for(let s=1;s<500;s++){const l=-s*(s-t);i+=2,o=l*o+i,Math.abs(o)<c&&(o=c),r=i+l/r,Math.abs(r)<c&&(r=c),o=1/o;const u=o*r;if(f*=u,Math.abs(u-1)<1e-16)break}return Math.exp(n)*f}export function tTwoSided(t,e){return Number.isFinite(t)?incompleteBeta(e/(e+t*t),e/2,.5):Number.isNaN(t)?NaN:0}export function tQuantileTwoSided(t,e){if(!(t>0&&t<1)||!(e>0))return NaN;let n=0,c=1;for(;tTwoSided(c,e)>t;)c*=2;for(let i=0;i<100;i++){const r=(n+c)/2;tTwoSided(r,e)>t?n=r:c=r}return(n+c)/2}export function fUpperTail(t,e,n){return t>0?incompleteBeta(n/(n+e*t),n/2,e/2):1}export function chiSquareUpperTail(t,e){return upperIncompleteGamma(e/2,t/2)}export function quantile(t,e){if(t.length===0)return NaN;const n=e*(t.length-1),c=Math.floor(n),i=Math.ceil(n);return t[c]+(t[i]-t[c])*(n-c)}export function robustFence(t,e=1.5,n=8){const c=Float64Array.from(Array.from(t).filter(f=>Number.isFinite(f)));if(c.length<n)return null;const{q1:i,q3:r}=fiveNumberSummary(c),o=r-i;return o===0?null:{lo:i-e*o,hi:r+e*o}}export function sampleVariance(t,e){const n=t.length;if(n<2)return 0;if(e===void 0){let i=0;for(let r=0;r<n;r++)i+=t[r];e=i/n}let c=0;for(let i=0;i<n;i++)c+=(t[i]-e)**2;return c/(n-1)}export function describeValues(t){const e=t.length;let n=0;for(let u=0;u<e;u++)n+=t[u];const c=n/e,i=Math.sqrt(sampleVariance(t,c)),{min:r,q1:o,median:f,q3:s,max:l}=fiveNumberSummary(t);return{min:r,max:l,mean:c,count:e,stddev:i,median:f,q1:o,q3:s}}export function fiveNumberSummary(t){let e=1/0,n=-1/0;for(let o=0;o<t.length;o++){const f=t[o];f<e&&(e=f),f>n&&(n=f)}t.length===0&&(e=NaN,n=NaN);const{q1:c,median:i,q3:r}=T(t);return{min:e,q1:c,median:i,q3:r,max:n}}function T(t){const e=t.length;if(e===0)return{q1:NaN,median:NaN,q3:NaN};const n=e-1,c=(g,m,a)=>{const M=g*n,h=Math.floor(M),d=F(t,h,m,a);if(M===h)return d;let p=1/0;for(let N=h+1;N<=a;N++)t[N]<p&&(p=t[N]);return d+(p-d)*(M-h)},i=Math.floor(.5*n),r=c(.5,0,n),o=Math.floor(.25*n),f=o===i?c(.25,i,n):u(.25,o,i),l=Math.floor(.75*n)===i?c(.75,i,n):c(.75,i+1,n);return{q1:f,median:r,q3:l};function u(g,m,a){const M=g*n,h=F(t,m,0,a-1);if(M===m)return h;let d=t[a];for(let p=m+1;p<a;p++)t[p]<d&&(d=t[p]);return h+(d-h)*(M-m)}}function F(t,e,n,c){for(;n<c;){const i=t[n],r=t[n+c>>>1],o=t[c],f=i<r?r<o?r:i<o?o:i:i<o?i:r<o?o:r;let s=n,l=c;for(;s<=l;){for(;t[s]<f;)s++;for(;t[l]>f;)l--;if(s<=l){const u=t[s];t[s]=t[l],t[l]=u,s++,l--}}if(e<=l)c=l;else if(e>=s)n=s;else break}return t[e]}export function mannKendall(t){const e=t.length;if(e<3)return null;let n=0;const c=[];for(let a=0;a<e-1;a++)for(let M=a+1;M<e;M++){const h=t[M]-t[a];n+=h>0?1:h<0?-1:0,c.push(h/(M-a))}const i=new Map;for(const a of t)i.set(a,(i.get(a)??0)+1);let r=e*(e-1)*(2*e+5)/18;for(const a of i.values())a>1&&(r-=a*(a-1)*(2*a+5)/18);if(r<=0)return null;const o=n===0?0:(n-Math.sign(n))/Math.sqrt(r),f=zPValue(o);c.sort((a,M)=>a-M);const s=c.length>>1,l=c.length%2?c[s]:(c[s-1]+c[s])/2,u=t.map((a,M)=>a-l*M).sort((a,M)=>a-M),g=u.length>>1,m=u.length%2?u[g]:(u[g-1]+u[g])/2;return{n:e,s:n,z:o,pValue:f,slope:l,intercept:m}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{fmtExact as h}from"../renderer/fmt.js";const T=1e-6;function k(n,t){if(n===t)return!0;if(!Number.isFinite(n)||!Number.isFinite(t))return!1;const i=Math.max(Math.abs(n),Math.abs(t));return Math.abs(n-t)<=T*i}function H(n){const t=n.name?.trim();return t||void 0}function I(n){const t=n.unit?.trim();return t||void 0}function N(n){return n.toLowerCase()}function p(n,t){const i=new Set,r=[];for(const l of n){const s=t(l);i.has(s)||(i.add(s),r.push(l))}return r}function b(n){const t=[];for(const i of n)t.some(r=>k(r,i))||t.push(i);return t}function M(n){return`${n.testNumber} (${n.values.join(" vs ")})`}function x(n,t=5){const i=n.slice(0,t).map(M).join(", "),r=n.length-Math.min(t,n.length);return r>0?`${i}, and ${r} more`:i}export function mergeTestDefs(n){const t=new Map,i=[];for(const s of n)for(const o of s?.testDefs??[]){const f=o.testNumber;let d=t.get(f);d||(d=[],t.set(f,d),i.push(f)),d.push(o)}const r=[],l=[];for(const s of i){const o=t.get(s),f=p(o.map(H).filter(e=>e!==void 0),N),d=p(o.map(I).filter(e=>e!==void 0),e=>e),g=p(o.map(e=>e.testType).filter(e=>e!==void 0),e=>e),$=f.length>1?{testNumber:s,kind:"name",excluded:!0,values:f}:d.length>1?{testNumber:s,kind:"unit",excluded:!0,values:d}:g.length>1?{testNumber:s,kind:"testType",excluded:!0,values:g}:void 0;if($){l.push($);continue}const u=b(o.map(e=>e.limitLow).filter(e=>e!==void 0)),a=b(o.map(e=>e.limitHigh).filter(e=>e!==void 0)),w=p(o.filter(e=>e.limitLow!==void 0).map(e=>e.limitLowInclusive!==!1),e=>String(e)),L=p(o.filter(e=>e.limitHigh!==void 0).map(e=>e.limitHighInclusive!==!1),e=>String(e)),c=u.length>1||a.length>1||w.length>1||L.length>1;c&&l.push({testNumber:s,kind:"limits",excluded:!1,values:u.length>1?u.map(h):a.length>1?a.map(h):w.length>1?w.map(e=>`${e?"\u2265":">"} ${h(u[0])}`):L.map(e=>`${e?"\u2264":"<"} ${h(a[0])}`)});const m=b(o.map(e=>e.specLow).filter(e=>e!==void 0)),v=b(o.map(e=>e.specHigh).filter(e=>e!==void 0)),y=m.length>1||v.length>1;y&&l.push({testNumber:s,kind:"specLimits",excluded:!1,values:(m.length>1?m:v).map(h)}),r.push({testNumber:s,name:f[0]??"",...d[0]!==void 0?{unit:d[0]}:{},...g[0]!==void 0?{testType:g[0]}:{},...o.find(e=>e.logScale!==void 0)?{logScale:o.find(e=>e.logScale!==void 0).logScale}:{},...!c&&u[0]!==void 0?{limitLow:u[0]}:{},...!c&&a[0]!==void 0?{limitHigh:a[0]}:{},...!c&&w[0]===!1?{limitLowInclusive:!1}:{},...!c&&L[0]===!1?{limitHighInclusive:!1}:{},...!y&&m[0]!==void 0?{specLow:m[0]}:{},...!y&&v[0]!==void 0?{specHigh:v[0]}:{},...o.some(e=>e.derived)?{derived:!0}:{},...o.find(e=>e.expression!==void 0)?{expression:o.find(e=>e.expression!==void 0).expression}:{}})}return{defs:r,conflicts:l,warnings:S(l)}}function S(n){const t=[],i=n.filter(s=>s.excluded),r=n.filter(s=>s.kind==="limits"),l=n.filter(s=>s.kind==="specLimits");return i.length>0&&t.push({code:"test-def-collision",severity:"error",message:`${i.length} test ${i.length===1?"number describes":"numbers describe"} a different measurement in different wafers, so the same number cannot identify one test across this population. Affected: `+x(i)+". These tests are withheld from every cross-wafer chart, report and map mode \u2014 pooling them would mix unrelated measurements into one distribution. Each wafer's own view is unaffected. Load one test program at a time to see them."}),r.length>0&&t.push({code:"test-limit-conflict",severity:"warning",message:`${r.length} ${r.length===1?"test is":"tests are"} held to different test limits in different wafers. Affected: `+x(r)+". The measured values are still comparable, so distributions include them, but the limit yield, the limit lines, and capability measured against the test limits are withheld for these tests \u2014 there is no single pair of limits to judge the merged population against."}),l.length>0&&t.push({code:"test-limit-conflict",severity:"warning",message:`${l.length} ${l.length===1?"test has":"tests have"} different spec limits in different wafers. Affected: `+x(l)+". Their spec limits are withheld for the merged population, so capability uses the test limits where they agree."}),t}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Die } from '../core/dies.js';
|
|
2
2
|
import type { WaferMetadata } from '../core/metadata.js';
|
|
3
3
|
import type { MetadataFieldDef } from '../renderer/buildWaferMap.js';
|
|
4
|
+
import { type FacetCuration } from './facets.js';
|
|
4
5
|
/** Where a column's value comes from. A `'wafer'` column is constant down
|
|
5
6
|
* every row; a `'die'` column genuinely varies die to die. */
|
|
6
7
|
export type MetadataColumnScope = 'die' | 'wafer';
|
|
@@ -47,6 +48,8 @@ export interface ResolveMetadataColumnsOptions {
|
|
|
47
48
|
waferPlacement?: 'csv' | 'both' | 'none';
|
|
48
49
|
/** Headers already taken by built-in columns, for collision resolution. */
|
|
49
50
|
reservedLabels?: string[];
|
|
51
|
+
/** The host's own names for wafer attributes (`attributes` on the render options), over the defaults. */
|
|
52
|
+
curation?: Record<string, FacetCuration>;
|
|
50
53
|
/**
|
|
51
54
|
* Cap on auto-discovered die keys. Default 64. Exceeding it is a data shape
|
|
52
55
|
* no table can usefully show; the excess is reported in `truncatedKeys` so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{metadataDisplayValue as w}from"../core/metadata.js";import{compareNatural as K,prettyKey as A}from"../core/utils.js";import{DEFAULT_FACET_CURATION as b,attributeLabel as v}from"./facets.js";const k=64;export function discoverDieMetadataKeys(e,n,s=k){const d=new Set;for(const c of e)if(c.metadata)for(const i of Object.keys(c.metadata))d.add(i);const r=[];for(const c of n??[])d.has(c.key)&&!r.includes(c.key)&&r.push(c.key);const y=[...d].filter(c=>!r.includes(c)).sort(K),a=[...r,...y];return{keys:a.slice(0,s),truncated:a.slice(s)}}function D(e){const n=Object.keys(e).filter(r=>w(e[r])!==void 0),s=Object.keys(b).filter(r=>n.includes(r)),d=n.filter(r=>!s.includes(r)).sort(K);return[...s,...d]}const h=(e,n)=>e==="none"?[]:Array.isArray(e)?e.filter(s=>n.includes(s)):e==="identity"?n.filter(s=>s in b):n;export function resolveMetadataColumns(e){const n=e.waferMetadata??{},s=e.waferPlacement??"csv",d=discoverDieMetadataKeys(e.dies??[],e.metadataFields,e.maxDieKeys??k),r=h(e.dieKeys,d.keys),y=s==="none"?[]:h(e.waferKeys,D(n)).filter(t=>!r.includes(t)),a=new Set(e.reservedLabels??[]),c=(t,o)=>{const f=e.metadataFields?.find(
|
|
1
|
+
import{metadataDisplayValue as w}from"../core/metadata.js";import{compareNatural as K,prettyKey as A}from"../core/utils.js";import{DEFAULT_FACET_CURATION as b,attributeLabel as v}from"./facets.js";const k=64;export function discoverDieMetadataKeys(e,n,s=k){const d=new Set;for(const c of e)if(c.metadata)for(const i of Object.keys(c.metadata))d.add(i);const r=[];for(const c of n??[])d.has(c.key)&&!r.includes(c.key)&&r.push(c.key);const y=[...d].filter(c=>!r.includes(c)).sort(K),a=[...r,...y];return{keys:a.slice(0,s),truncated:a.slice(s)}}function D(e){const n=Object.keys(e).filter(r=>w(e[r])!==void 0),s=Object.keys(b).filter(r=>n.includes(r)),d=n.filter(r=>!s.includes(r)).sort(K);return[...s,...d]}const h=(e,n)=>e==="none"?[]:Array.isArray(e)?e.filter(s=>n.includes(s)):e==="identity"?n.filter(s=>s in b):n;export function resolveMetadataColumns(e){const n=e.waferMetadata??{},s=e.waferPlacement??"csv",d=discoverDieMetadataKeys(e.dies??[],e.metadataFields,e.maxDieKeys??k),r=h(e.dieKeys,d.keys),y=s==="none"?[]:h(e.waferKeys,D(n)).filter(t=>!r.includes(t)),a=new Set(e.reservedLabels??[]),c=(t,o)=>{const f=e.metadataFields?.find(l=>l.key===t)?.label??(o==="wafer"?v(t,e.curation):A(t));if(!a.has(f))return a.add(f),f;const m=o==="die"?`${f} (metadata)`:`${f} (wafer metadata)`;if(!a.has(m))return a.add(m),m;const u=`${f} (${t})`;if(!a.has(u))return a.add(u),u;for(let l=2;;l++){const p=`${u} (${l})`;if(!a.has(p))return a.add(p),p}},i=[];for(const t of r)i.push({key:t,label:c(t,"die"),scope:"die",get:o=>w(o.metadata?.[t])??"",csvOnly:!1});for(const t of y){const o=w(n[t])??"";i.push({key:t,label:c(t,"wafer"),scope:"wafer",get:()=>o,constant:o,csvOnly:s==="csv"})}return{columns:i,truncatedKeys:d.truncated}}
|
|
@@ -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
|
/**
|