@wafertools/wafermap 0.37.1 → 0.39.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/CHANGELOG.md +107 -0
- package/README.md +21 -13
- package/dist/packages/canvas-adapter/cellShade.d.ts +21 -0
- package/dist/packages/canvas-adapter/cellShade.js +1 -0
- package/dist/packages/canvas-adapter/chartPopulation.d.ts +8 -3
- package/dist/packages/canvas-adapter/chartPopulation.js +1 -1
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +45 -19
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/commonality.js +1 -1
- package/dist/packages/canvas-adapter/charts/correlation.d.ts +11 -0
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/divergingScale.d.ts +23 -0
- package/dist/packages/canvas-adapter/charts/divergingScale.js +1 -0
- package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -1
- package/dist/packages/canvas-adapter/charts/palette.d.ts +10 -3
- package/dist/packages/canvas-adapter/charts/palette.js +1 -1
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +3 -7
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +1 -0
- package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -1
- package/dist/packages/canvas-adapter/drilldown.d.ts +5 -0
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/filterJson.d.ts +25 -0
- package/dist/packages/canvas-adapter/filterJson.js +5 -0
- 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.js +1 -1
- package/dist/packages/canvas-adapter/pageFilter.js +2 -2
- package/dist/packages/canvas-adapter/pinnedTests.d.ts +10 -0
- package/dist/packages/canvas-adapter/pinnedTests.js +1 -0
- package/dist/packages/canvas-adapter/plotCard.d.ts +1 -1
- package/dist/packages/canvas-adapter/plotCard.js +1 -1
- package/dist/packages/canvas-adapter/plotEditor.js +10 -1
- package/dist/packages/canvas-adapter/plotJsonComplete.d.ts +46 -0
- package/dist/packages/canvas-adapter/plotJsonComplete.js +4 -0
- package/dist/packages/canvas-adapter/plotJsonHistory.d.ts +12 -0
- package/dist/packages/canvas-adapter/plotJsonHistory.js +1 -0
- package/dist/packages/canvas-adapter/plotJsonSuggest.d.ts +16 -0
- package/dist/packages/canvas-adapter/plotJsonSuggest.js +1 -0
- package/dist/packages/canvas-adapter/plotModal.js +1 -1
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +3 -3
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +68 -33
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/viewSwitch.js +1 -1
- package/dist/packages/canvas-adapter/virtualTable.d.ts +2 -0
- package/dist/packages/canvas-adapter/virtualTable.js +1 -1
- package/dist/packages/core/utils.d.ts +6 -0
- package/dist/packages/core/utils.js +1 -1
- package/dist/packages/renderer/buildWaferMap.js +1 -1
- package/dist/packages/renderer/derivedTests/apply.d.ts +10 -0
- package/dist/packages/renderer/derivedTests/apply.js +1 -1
- package/dist/packages/renderer/derivedTests/check.d.ts +35 -0
- package/dist/packages/renderer/derivedTests/check.js +1 -0
- package/dist/packages/renderer/fmt.d.ts +5 -0
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/renderer/index.d.ts +2 -0
- package/dist/packages/renderer/index.js +1 -1
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/chartCatalogue.js +1 -1
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/coFailure.d.ts +11 -0
- package/dist/packages/stats/coFailure.js +1 -0
- package/dist/packages/stats/correlation.d.ts +7 -0
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/differenceMap.d.ts +2 -0
- package/dist/packages/stats/differenceMap.js +1 -1
- package/dist/packages/stats/plotData.d.ts +18 -2
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/plotSpec.d.ts +31 -2
- package/dist/packages/stats/plotSpec.js +4 -4
- package/dist/packages/stats/plotTable.d.ts +18 -0
- package/dist/packages/stats/plotTable.js +1 -0
- package/dist/packages/stats/reportHtml.js +33 -29
- package/dist/packages/stats/synthesis.d.ts +7 -1
- package/dist/packages/stats/synthesis.js +1 -1
- package/dist/packages/stats/testsByWafer.d.ts +11 -0
- package/dist/packages/stats/testsByWafer.js +1 -0
- package/package.json +8 -4
|
@@ -72,7 +72,7 @@ export const USER_GUIDE_HTML=`<div class="wmap-guide">
|
|
|
72
72
|
.wmap-guide-toc{display:none!important}
|
|
73
73
|
}
|
|
74
74
|
</style>
|
|
75
|
-
<h1 id="wmap-wafer-map-user-guide">Wafer Map \u2014 User Guide<span class="wmap-guide-version" title="Built 2026-10-
|
|
75
|
+
<h1 id="wmap-wafer-map-user-guide">Wafer Map \u2014 User Guide<span class="wmap-guide-version" title="Built 2026-10-31T09:06:32.439Z">v0.39.0</span></h1>
|
|
76
76
|
<p class="wmap-guide-online-link">This is a quick reference. <a href="https://wafertools.github.io/wafermap/user-guide/" target="_blank" rel="noopener">View the full illustrated guide online \u2197</a></p>
|
|
77
77
|
<p>This guide describes the display and analysis features of the wafer map viewer.
|
|
78
78
|
It is written for users who may be semiconductor test engineers, device engineers, and yield engineers
|
|
@@ -130,26 +130,26 @@ there; <strong>Reset orientation</strong> leaves it as it is.</p>
|
|
|
130
130
|
<p>A no-data die is not a fail; it simply has no result recorded. Edge-excluded dies are shown dimmed and are
|
|
131
131
|
not counted in yield calculations. Dies the filter drops are drawn faded and are counted nowhere: not in the legend, the
|
|
132
132
|
yield, the Summary panel or the findings.</p>
|
|
133
|
-
<h3 id="wmap-legend-and-
|
|
133
|
+
<h3 id="wmap-legend-and-colour-bar">1.4 Legend and colour bar</h3>
|
|
134
134
|
<p><strong>Bin modes</strong> show a discrete colour legend: one swatch per bin, with bin number
|
|
135
135
|
and name if the application has supplied bin names. Passing bins are listed first,
|
|
136
136
|
then failing bins from the most dies to the fewest \u2014 the same order as the Summary
|
|
137
137
|
panel and reports.</p>
|
|
138
|
-
<p><strong>Value mode</strong> shows a continuous
|
|
139
|
-
to maximum value, with units when available. The
|
|
138
|
+
<p><strong>Value mode</strong> shows a continuous colour bar: the colour scale runs from the minimum
|
|
139
|
+
to maximum value, with units when available. The colour bar is informational only \u2014
|
|
140
140
|
clicking it has no effect. To switch to a pass/fail view, use the <strong>Limit pass/fail</strong>
|
|
141
141
|
or <strong>Test pass/fail</strong> option in the Overlays menu (available when test limits are
|
|
142
142
|
defined, or a recorded verdict exists, for the active test).</p>
|
|
143
|
-
<p><strong>Limit pass/fail mode</strong> replaces the
|
|
143
|
+
<p><strong>Limit pass/fail mode</strong> replaces the colour bar with a small legend: Pass,
|
|
144
144
|
Fail high, and Fail low swatches (only the categories that apply to the test's
|
|
145
145
|
limits) with a die count beside each. This judges dies against the test's lower
|
|
146
146
|
and upper test limits.</p>
|
|
147
|
-
<p><strong>Test pass/fail mode</strong> replaces the
|
|
147
|
+
<p><strong>Test pass/fail mode</strong> replaces the colour bar with a <strong>Pass / Fail legend</strong> and die
|
|
148
148
|
counts, coloured by the tester's own <strong>recorded</strong> verdict for that test \u2014 not a
|
|
149
149
|
limit judgement. A test with no measured value (a functional, go/no-go test)
|
|
150
150
|
always displays this way; selecting it switches the map into Test pass/fail
|
|
151
151
|
automatically, since there is nothing to plot on a gradient.</p>
|
|
152
|
-
<p>Every map also shows a short <strong>title</strong> by the
|
|
152
|
+
<p>Every map also shows a short <strong>title</strong> by the colour bar or legend naming what is
|
|
153
153
|
displayed \u2014 the test name (and number, in limit pass/fail mode), the bin type, or the stacked
|
|
154
154
|
wafer count.</p>
|
|
155
155
|
<p>Clicking a bin swatch in the legend filters the display to that bin: every other bin is
|
|
@@ -230,12 +230,12 @@ application has loaded.</p>
|
|
|
230
230
|
<p>Stacked modes are only available on lot-stack maps (multiple wafers combined into
|
|
231
231
|
one display). The panel identifies how many wafers were stacked and which
|
|
232
232
|
aggregation method is active.</p>
|
|
233
|
-
<h3 id="wmap-test-value-mode-
|
|
233
|
+
<h3 id="wmap-test-value-mode-colour-bar-range-and-test-limits">Test Value mode \u2014 colour bar range and test limits</h3>
|
|
234
234
|
<p>When test limits are defined for the active test, two additional display options
|
|
235
235
|
become available:</p>
|
|
236
236
|
<ul>
|
|
237
|
-
<li><strong>
|
|
238
|
-
actual data extent and the test limits. This affects only the
|
|
237
|
+
<li><strong>Colour bar range \u2014 Data / Limits</strong>: switches the colour bar scale between the
|
|
238
|
+
actual data extent and the test limits. This affects only the colour bar's
|
|
239
239
|
range, never how failing dies are shown. In <strong>both</strong> ranges every die is
|
|
240
240
|
coloured by the gradient so you can read the value distribution, and dies
|
|
241
241
|
outside the test limits are marked with a triangle \u2014 pointing <strong>down (\u25BD) for below the low limit</strong>, <strong>up (\u25B3)
|
|
@@ -249,7 +249,7 @@ in</strong>; zoom in and they appear.</li>
|
|
|
249
249
|
a pass colour and dies outside them are highlighted \u2014 <strong>blue for below the
|
|
250
250
|
low limit</strong>, <strong>red for above the high limit</strong>. Both flags apply
|
|
251
251
|
independently; a die can be flagged on either or both limits. A Pass/Fail legend
|
|
252
|
-
replaces the
|
|
252
|
+
replaces the colour bar, listing each applicable category with its die count.</li>
|
|
253
253
|
</ul>
|
|
254
254
|
<p>Some tests have no measured value at all \u2014 a continuity check or any other
|
|
255
255
|
go/no-go test, where the only result is a recorded pass or fail. Selecting one
|
|
@@ -320,8 +320,8 @@ shows die tooltips \u2014 a separate thing from the toolbar, which is always pre
|
|
|
320
320
|
</tr>
|
|
321
321
|
<tr>
|
|
322
322
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik01IDQgTDUgMjAiLz48cGF0aCBkPSJNNSA0IEw4IDQiLz48cGF0aCBkPSJNNSAyMCBMOCAyMCIvPjxwYXRoIGQ9Ik0xOSA0IEwxOSAyMCIvPjxwYXRoIGQ9Ik0xOSA0IEwxNiA0Ii8+PHBhdGggZD0iTTE5IDIwIEwxNiAyMCIvPjxwYXRoIGQ9Ik01IDEyIEwxOSAxMiIgc3Ryb2tlLWRhc2hhcnJheT0iMyAyIi8+PC9zdmc+Cg==" width="20" height="20"></td>
|
|
323
|
-
<td>
|
|
324
|
-
<td>Test Value mode with test limits only. Toggles the
|
|
323
|
+
<td>Colour bar range</td>
|
|
324
|
+
<td>Test Value mode with test limits only. Toggles the colour bar between the <strong>limit range</strong> (default \u2014 the colours mean the same thing on every wafer, so maps are comparable) and the <strong>data range</strong> (stretches the scale to the values actually present, which shows more contrast but is not comparable between wafers).</td>
|
|
325
325
|
</tr>
|
|
326
326
|
<tr>
|
|
327
327
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjciIHg9IjMiIHk9IjMiIHJ4PSIxIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iNyIgeD0iMyIgeT0iMTQiIHJ4PSIxIi8+PHBhdGggZD0iTTE0IDRoNyIvPjxwYXRoIGQ9Ik0xNCA5aDciLz48cGF0aCBkPSJNMTQgMTVoNyIvPjxwYXRoIGQ9Ik0xNCAyMGg3Ii8+PC9zdmc+Cg==" width="20" height="20"></td>
|
|
@@ -500,6 +500,10 @@ it as a file and send it to whoever supports this software.</p>
|
|
|
500
500
|
<td><strong>Space (hold) + drag</strong></td>
|
|
501
501
|
<td>Temporarily pan without leaving the current tool</td>
|
|
502
502
|
</tr>
|
|
503
|
+
<tr>
|
|
504
|
+
<td><strong>1</strong> to <strong>5</strong>, <strong>0</strong></td>
|
|
505
|
+
<td>Over a gallery (or with focus in it) or on the Insights tab: set that many columns of cards; over a plot of panels: that plot's columns. <strong>0</strong> is Auto (same as the Columns control)</td>
|
|
506
|
+
</tr>
|
|
503
507
|
</tbody></table>
|
|
504
508
|
<h3 id="wmap-gallery">Gallery</h3>
|
|
505
509
|
<p>The gallery control bar applies to all cards simultaneously.</p>
|
|
@@ -534,7 +538,7 @@ it as a file and send it to whoever supports this software.</p>
|
|
|
534
538
|
<tr>
|
|
535
539
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPgogIDxyZWN0IHg9IjMiIHk9IjMiIHdpZHRoPSI0IiBoZWlnaHQ9IjE4IiByeD0iMSIvPgogIDxyZWN0IHg9IjEwIiB5PSIzIiB3aWR0aD0iNCIgaGVpZ2h0PSIxOCIgcng9IjEiLz4KICA8cmVjdCB4PSIxNyIgeT0iMyIgd2lkdGg9IjQiIGhlaWdodD0iMTgiIHJ4PSIxIi8+Cjwvc3ZnPgo=" width="20" height="20"></td>
|
|
536
540
|
<td>Columns</td>
|
|
537
|
-
<td>Sets the number of columns. <strong>Auto</strong> fits as many cards as
|
|
541
|
+
<td>Sets the number of columns, or press <strong>1</strong> to <strong>5</strong>, or <strong>0</strong> for Auto, while the pointer is over the gallery or focus is in it; it offers no more columns than there are cards. <strong>Auto</strong> fits as many cards as keep each die at least 6 px across, so a dense wafer gets a wider card and a window that cannot hold another column at that width keeps the columns it has; a number divides the full width between that many columns.</td>
|
|
538
542
|
</tr>
|
|
539
543
|
<tr>
|
|
540
544
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik01IDNhMiAyIDAgMCAwLTIgMiIvPjxwYXRoIGQ9Ik0xOSAzYTIgMiAwIDAgMSAyIDIiLz48cGF0aCBkPSJNMjEgMTlhMiAyIDAgMCAxLTIgMiIvPjxwYXRoIGQ9Ik01IDIxYTIgMiAwIDAgMS0yLTIiLz48cGF0aCBkPSJNOSAzaDEiLz48cGF0aCBkPSJNOSAyMWgxIi8+PHBhdGggZD0iTTE0IDNoMSIvPjxwYXRoIGQ9Ik0xNCAyMWgxIi8+PHBhdGggZD0iTTMgOXYxIi8+PHBhdGggZD0iTTIxIDl2MSIvPjxwYXRoIGQ9Ik0zIDE0djEiLz48cGF0aCBkPSJNMjEgMTR2MSIvPjwvc3ZnPgo=" width="20" height="20"></td>
|
|
@@ -563,7 +567,7 @@ it as a file and send it to whoever supports this software.</p>
|
|
|
563
567
|
</tr>
|
|
564
568
|
<tr>
|
|
565
569
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik01IDQgTDUgMjAiLz48cGF0aCBkPSJNNSA0IEw4IDQiLz48cGF0aCBkPSJNNSAyMCBMOCAyMCIvPjxwYXRoIGQ9Ik0xOSA0IEwxOSAyMCIvPjxwYXRoIGQ9Ik0xOSA0IEwxNiA0Ii8+PHBhdGggZD0iTTE5IDIwIEwxNiAyMCIvPjxwYXRoIGQ9Ik01IDEyIEwxOSAxMiIgc3Ryb2tlLWRhc2hhcnJheT0iMyAyIi8+PC9zdmc+Cg==" width="20" height="20"></td>
|
|
566
|
-
<td>
|
|
570
|
+
<td>Colour bar range</td>
|
|
567
571
|
<td>Test Value mode with test limits only. Toggles all cards between the limit range and the data range. Leave it on the test limits when comparing wafers \u2014 the data range rescales per view.</td>
|
|
568
572
|
</tr>
|
|
569
573
|
<tr>
|
|
@@ -614,6 +618,13 @@ losing it, and the line stays, saying the filter is off, until you remove it. A
|
|
|
614
618
|
not have (a test this lot lacks) filters nothing, and the line says so.</p>
|
|
615
619
|
<p>The filter is view state, like <strong>Group by</strong>: it is not part of any plot or plots file, and a host application can remember
|
|
616
620
|
it for the next lot.</p>
|
|
621
|
+
<h4 id="wmap-filter-as-json">Filter as JSON</h4>
|
|
622
|
+
<p>The Filter window has a <strong>Conditions | JSON</strong> switch. JSON shows the same filter as text, which you can edit, paste into or
|
|
623
|
+
copy out of. The text is read as you type: the preview follows it, and <strong>Apply</strong> is held, with the reason under the text,
|
|
624
|
+
while it cannot be read. Suggestions list the filter's keys, the lot's own wafer fields and tests, and the values a field
|
|
625
|
+
takes (<strong>Suggest</strong> or Ctrl/Cmd+Space opens them by hand), and Ctrl/Cmd+Z steps back through the text. Pasting a saved
|
|
626
|
+
filters file with several filters offers each to choose from; anything the reader leaves out is named under the text.
|
|
627
|
+
Switching back to <strong>Conditions</strong> drops text that could not be read.</p>
|
|
617
628
|
<h4 id="wmap-saved-filters">Saved filters</h4>
|
|
618
629
|
<p>Conditions you use again can be saved. In the Filter window, type a name and press <strong>Save</strong> to keep the conditions you
|
|
619
630
|
have set; saving under a name already used updates that filter. <strong>Load</strong> puts a saved filter's conditions in the window
|
|
@@ -704,7 +715,11 @@ cluster, a scratch or an edge region on its own, or at one wafer out of a lot.</
|
|
|
704
715
|
<ul>
|
|
705
716
|
<li><strong>Selected dies</strong> \u2014 select some dies, then right-click on the map. Right-
|
|
706
717
|
clicking a die that is <strong>not</strong> selected selects that die alone first;
|
|
707
|
-
right-clicking a selected die, or empty space, keeps the selection
|
|
718
|
+
right-clicking a selected die, or empty space, keeps the selection. On a single map the menu's first row, <strong>Invert
|
|
719
|
+
selection</strong>, selects the dies that were not selected and deselects those that were. Below the charts of the selection,
|
|
720
|
+
<strong>Selection vs the rest of the wafer</strong> offers a <strong>Value histogram</strong> (one colour for each side, overlaid) and a <strong>Box plot</strong>
|
|
721
|
+
of the selected dies against the wafer's other dies, each side labelled with its die count. Partial and edge-excluded dies are
|
|
722
|
+
left out of both, and with fewer than 10 dies on a side the window says to read the spread rather than small differences.</li>
|
|
708
723
|
<li><strong>Dies selected on several wafers of a gallery</strong> \u2014 by clicking a finding, or by selecting on more than one card.
|
|
709
724
|
Right-click a selected die on any of those cards and the menu opens on every selected die, with a first row,
|
|
710
725
|
<strong>Only this wafer</strong>, that narrows it to the dies selected on the card you clicked (and <strong>All selected</strong> to go back).</li>
|
|
@@ -872,7 +887,7 @@ field Group by offers (a process split, a lot, a test program). A group is judge
|
|
|
872
887
|
one value, the way Insights compares groups, adjusted over every field and test compared, and its size
|
|
873
888
|
is the shift in the test's within-wafer standard deviations, the scale a region's shift is measured on.
|
|
874
889
|
A field is one item however many tests it moves ("34 tests differ by Split. Largest: \u2026; next: \u2026"), with the tests
|
|
875
|
-
that moved most as its chips, so a corner lot does not fill the list with one split. Both are ranked on one scale, the share of the dies an item
|
|
890
|
+
that moved most as its chips, so a corner lot does not fill the list with one split. Its chart is a grid of the field's values by those tests, in z-scores (and a card that shows a bar per wafer draws the wafers under their group, in the group's colour, when Group by is on): blue where a group sits below the lot's average on a test, red where it sits above, so a process corner reads as a pattern of cells. Both are ranked on one scale, the share of the dies an item
|
|
876
891
|
affects: a loss by the dies it cost; a shift by its dies, counted in full from two standard deviations
|
|
877
892
|
and by the square of its size below that (a one-sigma shift counts a quarter of its dies); a trend by
|
|
878
893
|
how far it moved; a group's shift by the dies of the wafers that moved, weighted as a shift is; a Ppk under 1.0 by
|
|
@@ -1045,6 +1060,10 @@ hides the other's toolbar button, since Findings has nothing to highlight
|
|
|
1045
1060
|
against once the map is replaced.</p>
|
|
1046
1061
|
<p>The <a href="https://wafertools.github.io/wafermap/charts/">Chart reference</a> describes every chart, plot and table: what it
|
|
1047
1062
|
shows, how to read it, when to reach for it and where to find it. This section covers how the tab works.</p>
|
|
1063
|
+
<p>The <strong>Columns</strong> control beside <strong>Group by</strong> and <strong>Show</strong>, or the keys <strong>1</strong> to <strong>5</strong> (and <strong>0</strong> for Auto), sets how many columns of
|
|
1064
|
+
cards every section of the tab uses. <strong>Auto</strong> fits as many as the width holds at 420 px or more; a number is the most columns a section uses, dividing the width that many ways,
|
|
1065
|
+
and the choice stays while you move between the tabs. A tab uses the smaller of that number and the cards in its fullest section, so a tab
|
|
1066
|
+
of two cards is two columns even with 4 chosen.</p>
|
|
1048
1067
|
<p>Any chart mark that stands for one wafer \u2014 a bar in <em>Yield by wafer</em>, a box in
|
|
1049
1068
|
<em>Test value distribution</em>, a point in <em>Wafer-to-wafer trend</em> \u2014 can be
|
|
1050
1069
|
right-clicked to chart that wafer on its own (see
|
|
@@ -1080,7 +1099,8 @@ filter or <strong>Show</strong> narrows the population it says so instead of dra
|
|
|
1080
1099
|
in the physical sequence, so there is no sort control to destroy it, and it needs at least two wafers; drag across it to pick a
|
|
1081
1100
|
run of wafers. The box plot, histogram and trend are plots: each has the test picker and the axis settings (<em>Axis includes
|
|
1082
1101
|
limits</em>, <em>Clip outliers</em>, and which limits to draw), and a change in one reaches the others. Clicking a capability box drives
|
|
1083
|
-
them onto that same test
|
|
1102
|
+
them onto that same test. In a lot with hundreds of tests, click the \u2606 at the end of a row in any test picker (or press <strong>P</strong> on
|
|
1103
|
+
the focused row) to <strong>pin</strong> that test: pinned tests are listed first, under a "Pinned" heading, in every picker.</p>
|
|
1084
1104
|
<p>With <strong>Group by</strong> on (a split, a lot), the cards that compare the groups come first, under <strong>Comparing \u2026</strong>: the
|
|
1085
1105
|
<a href="https://wafertools.github.io/wafermap/charts/#comparison-by-group">Comparison by</a> table and the <a href="https://wafertools.github.io/wafermap/charts/#difference-map">difference map</a> (pick the two groups and a test or <em>Yield</em>; it follows
|
|
1086
1106
|
the test the other panels show until you pick one), then the cards for each test under <strong>Test by test</strong>. In the table,
|
|
@@ -1147,8 +1167,8 @@ yield/box-plot rows.</em></p>
|
|
|
1147
1167
|
orange marginal, red poor; tests without limits are muted and dashed), a
|
|
1148
1168
|
per-wafer test-value box plot, and a value histogram. Clicking a capability
|
|
1149
1169
|
box drives the box plot and histogram onto that test.</em></p>
|
|
1150
|
-
<p><em>Correlation sub-tab: test-to-test Pearson correlation matrix (
|
|
1151
|
-
positive,
|
|
1170
|
+
<p><em>Correlation sub-tab: test-to-test Pearson correlation matrix (orange =
|
|
1171
|
+
positive, blue = negative; intensity = strength) and a die-level scatter
|
|
1152
1172
|
plot coloured by hard bin. Clicking a matrix cell drives the scatter plot
|
|
1153
1173
|
onto that pair.</em></p>
|
|
1154
1174
|
<h3 id="wmap-what-a-click-does">What a click does</h3>
|
|
@@ -1174,7 +1194,7 @@ onto that pair.</em></p>
|
|
|
1174
1194
|
</tr>
|
|
1175
1195
|
<tr>
|
|
1176
1196
|
<td>A bar of the <strong>value histogram</strong> (with Group by on, a column of it)</td>
|
|
1177
|
-
<td>the menu on the dies whose values fall in that bar, across the groups, or in the one group the legend has
|
|
1197
|
+
<td>the menu on the dies whose values fall in that bar, across the groups, or in the one group <strong>Show</strong> has narrowed to (or the one a legend click has left showing)</td>
|
|
1178
1198
|
</tr>
|
|
1179
1199
|
<tr>
|
|
1180
1200
|
<td>A level of a <strong>sweep</strong> curve</td>
|
|
@@ -1216,15 +1236,24 @@ same "Group by" and "Show" scope as the charts.</p>
|
|
|
1216
1236
|
<li><strong>Statistics</strong> \u2014 the <strong>Test Values</strong> table (count, min, quartiles, mean, \u03C3,
|
|
1217
1237
|
Ppk, limits and the limit yield for each test, with its N stated) and the
|
|
1218
1238
|
<strong>Functional Tests</strong> pass-rate table. With "Group by" active there is one set
|
|
1219
|
-
per group
|
|
1239
|
+
per group, below one table that compares every test across the groups (a
|
|
1240
|
+
test's groups side by side, with its own CSV).</li>
|
|
1220
1241
|
<li><strong>Dies</strong> \u2014 one row per die: wafer, X, Y, ring, quadrant (and reticle cell and shot when a reticle is set), site, bins, a column
|
|
1221
1242
|
for each test, and the wafer's metadata. Only the rows in view are drawn, so a
|
|
1222
1243
|
lot of hundreds of thousands of dies scrolls smoothly. Click a column heading
|
|
1223
1244
|
to sort by it (again to reverse; a die with no value sorts last).</li>
|
|
1224
|
-
<li><strong>Wafers</strong> \u2014 one row per wafer:
|
|
1225
|
-
counts, the yield (the same figure as the yield chart),
|
|
1226
|
-
|
|
1245
|
+
<li><strong>Wafers</strong> \u2014 one row per wafer: the wafer, the field Group by divides it by, the die
|
|
1246
|
+
counts, the yield (the same figure as the yield chart), the mean of each test (the first
|
|
1247
|
+
50), then the other attributes that differ between wafers. Attributes the same on every
|
|
1248
|
+
wafer (lot, part type, tester\u2026) are named in a line above the table and kept in the export.</li>
|
|
1227
1249
|
</ul>
|
|
1250
|
+
<p><strong>Shading.</strong> Where a table compares values, a pale colour sits behind the number and the number is always
|
|
1251
|
+
printed: a group's or wafer's mean is blue below the average of its peers and warm above (the same two hues as the
|
|
1252
|
+
correlation matrix), a yield (or a share inside limits) is tinted red only when it falls a point or more short of its reference, as in the
|
|
1253
|
+
summary report: a wafer short of the lot's mean per-wafer yield, a group short of the best group's share inside limits, and
|
|
1254
|
+
nothing at all on a lot with nothing wrong. A Ppk is capable, marginal or poor, and in the Dies table a reading outside its
|
|
1255
|
+
test's limits is tinted warm. The <strong>Comparison by</strong>
|
|
1256
|
+
table in Distributions shades each group's mean among the groups the same way.</p>
|
|
1228
1257
|
<p>In the Dies table, <strong>click a row</strong> to show that die on its map: the table steps
|
|
1229
1258
|
aside (or Insights closes) and the die is ringed, on its own card in a gallery. The
|
|
1230
1259
|
ring goes with the next click on the map, or Esc.</p>
|
|
@@ -1241,18 +1270,18 @@ warns when that is more than a spreadsheet can open (1,048,576).</p>
|
|
|
1241
1270
|
<p>The <strong>My plots</strong> sub-tab is where you build your own charts. <strong>+ New plot</strong> starts one,
|
|
1242
1271
|
already filled in with the first two tests of the lot, and opens it beside a large
|
|
1243
1272
|
copy of the chart. <strong>Edit as plot</strong>, in the \u22EF menu of an Insights chart, opens that chart as a plot of your own (see
|
|
1244
|
-
<em>A chart's buttons</em> below). <strong>
|
|
1245
|
-
setting is for. They are chosen from the lot in view: the <em>lead</em> test is the one that varies most from wafer to
|
|
1273
|
+
<em>A chart's buttons</em> below). The <strong>My plots | Examples</strong> switch above the list shows one or the other, never both: <strong>Examples</strong> shows plots to start from, or to see what each chart and
|
|
1274
|
+
setting is for, each marked as an example; none is saved until you add it. They are chosen from the lot in view: the <em>lead</em> test is the one that varies most from wafer to
|
|
1246
1275
|
wafer (for a single wafer, the one that follows distance from the centre most), its partner the test that tracks it
|
|
1247
1276
|
best, and the split is the lot field that best explains the lead test. The examples are a scatter of the lead
|
|
1248
1277
|
test against its partner with a fitted line, a histogram with its
|
|
1249
|
-
normal curve, a box of the lead test by wafer, a bar of yield by the split, a line over wafer order with a \xB11 SD band, and a probability plot. It
|
|
1278
|
+
normal curve, a box of the lead test by wafer, a bar of yield by the split, a line over wafer order with a \xB11 SD band, and a probability plot. It shows one of each newer
|
|
1250
1279
|
feature the lot can show: the most telling tests as one set rescaled to z-scores (a box per test, and a heatmap of
|
|
1251
1280
|
tests by wafer), the lead test by split and by wafer nested in split, panels by ring, the lead test by ranges of its
|
|
1252
1281
|
partner and of the distance from the centre, a pareto of the hard bins and each wafer's bin mix, the
|
|
1253
1282
|
lead test by PAT verdict, an individuals control chart (five or more wafers), a capability goal plot and a
|
|
1254
1283
|
pass-rate bar when tests have limits, and a sweep of the first
|
|
1255
|
-
tests in test order.
|
|
1284
|
+
tests in test order. Each example has <strong>Add to my plots</strong>, and <strong>Add all</strong> adds the ones you do not have yet and shows My plots, with an <strong>Undo</strong>; edit a plot to see how it is set. Every change you make there is drawn at once; there is no Apply
|
|
1256
1285
|
button, and the plot is kept as you go.</p>
|
|
1257
1286
|
<p>In <strong>Setup</strong>, choose the <strong>chart type</strong>, then the field for each role:</p>
|
|
1258
1287
|
<table>
|
|
@@ -1447,7 +1476,8 @@ die field (ring, site, bin) the dies with that value from every wafer; <strong>T
|
|
|
1447
1476
|
one test a panel. So "one scatter per split" or "a histogram per ring" is one plot. Rescaled values are measured over
|
|
1448
1477
|
the whole population, so a panel is not re-centred on itself and panels compare. Each panel has its own expand button, and
|
|
1449
1478
|
the plot's Save as PNG saves the whole grid. At most 24 panels; a field on the X axis or the colour cannot also make
|
|
1450
|
-
the panels
|
|
1479
|
+
the panels. The <strong>Columns</strong> control above the panels, or the keys <strong>1</strong> to <strong>5</strong> (and <strong>0</strong> for Auto) while the pointer is
|
|
1480
|
+
over the plot, sets how many panels sit side by side; Auto fits as many as the width holds at 260 px or more.</li>
|
|
1451
1481
|
<li><strong>Wafer-level comparison</strong> (box and bar of one measured test): when the categories or the colour are a wafer field
|
|
1452
1482
|
such as split or lot, the line under the plot adds the comparison of those groups with each wafer as one value, as
|
|
1453
1483
|
the Distributions table does: the wafers in each group, Welch p and rank p.</li>
|
|
@@ -1475,6 +1505,11 @@ scatter or histogram of yield cannot, and says why.</li>
|
|
|
1475
1505
|
<p>When fields do not go together, the list says so before you choose: a field that would leave a plot that cannot be
|
|
1476
1506
|
drawn is dimmed in the <strong>X</strong>, <strong>Y</strong> and <strong>Colour</strong> lists with the reason after it, and does nothing when picked. A plot
|
|
1477
1507
|
that cannot be drawn says in words what is wrong and what to use instead.</p>
|
|
1508
|
+
<p>The <strong>JSON</strong> tab shows the plot as text, in the format of a saved plots file, for when a plot is easier to copy, share or
|
|
1509
|
+
paste in than to rebuild with the controls. Edit the text and choose <strong>Apply</strong>; the plot changes only then, and the tab says
|
|
1510
|
+
beforehand if a setting would be left out or the text is not a plot. Suggestions appear as you type inside a key or a string and after a comma, brace, colon or bracket, or on demand from the <strong>Suggest</strong> button or <strong>Ctrl/Cmd+Space</strong>: the plot's settings, the words a setting can take, your lot's test numbers and wafer fields. Use <strong>Up</strong> and <strong>Down</strong>, then <strong>Tab</strong> or <strong>Enter</strong> to accept, or <strong>Esc</strong> to close the list. A list that opened by itself leaves <strong>Enter</strong> as a new line until you type a letter or use the arrow keys; <strong>Tab</strong> always accepts. <strong>Discard edits</strong> drops text not yet applied;
|
|
1511
|
+
<strong>Ctrl/Cmd+Z</strong> (and <strong>Shift+Ctrl/Cmd+Z</strong>) step back and forward through the text you have typed, accepted or discarded and then through what you have applied, and the window's <strong>Reset</strong> and <strong>Cancel</strong> go back to the plot as it was when the window opened. <strong>Copy</strong> puts the text on the clipboard. The id is not part of the text, and a plots file can be pasted too, and when it holds several plots the tab lists them to choose one.</p>
|
|
1512
|
+
<p>A heatmap, or a scatter coloured by a number, also has <strong>Colours</strong> in Customise: blue to orange around zero (the automatic choice for values rescaled to a z-score), orange-red to blue for a yield or pass rate (bad to good), or any of the map's gradients (Viridis, Cividis, Plasma, Traffic and the rest), with <strong>Reverse colours</strong> to flip the direction. Blue to orange, orange-red to blue and Cividis stay distinguishable for the common kinds of colour blindness; Traffic and Jet do not, so they are offered by choice and never the automatic one. A gradient is stretched over the plot's own lowest and highest values, so it says "relative to this plot", not "above a target".</p>
|
|
1478
1513
|
<p>In <strong>Customise</strong>, the <strong>title</strong> and each <strong>axis title</strong> are written for you until
|
|
1479
1514
|
you type your own (the box shows what it would say, and clearing it brings that
|
|
1480
1515
|
back). If you type a title and later change the fields, the plot says when the title
|
|
@@ -1601,7 +1636,7 @@ reads 0.55 from <code>Fmax @ 0.55 V</code>, and <code>-{x}</code> reads 5 from <
|
|
|
1601
1636
|
naming the word, and is not applied, so the curve beside it never shows
|
|
1602
1637
|
something you did not mean. <strong>+ Add series</strong> adds a curve and <strong>Remove</strong> drops
|
|
1603
1638
|
one; the crossing and widths appear once there are two.</p>
|
|
1604
|
-
<p><strong>A sweep remembers what its tests were called.</strong> The editor
|
|
1639
|
+
<p><strong>A sweep remembers what its tests were called.</strong> The editor records each test's name
|
|
1605
1640
|
alongside its number. Open the sweep on a lot where a number now carries a different name (a test program that
|
|
1606
1641
|
reuses numbers for other measurements) and that test is not drawn: the card names it, and the crossing and widths
|
|
1607
1642
|
are not measured, rather than presenting another quantity as the original curve. Renaming a test in the selector
|
|
@@ -1660,7 +1695,7 @@ point to open this wafer") are left out. A chart on the <strong>My plots</s
|
|
|
1660
1695
|
its wafers and dies in the same place. The image takes the card's own background, so a dark
|
|
1661
1696
|
theme saves a dark chart. The file name identifies the lot, wafers and chart (see below).</p>
|
|
1662
1697
|
<p><strong>Printing.</strong> The dropdowns, toggles and buttons (Expand, the \u22EF menu button and, on the My plots tab, New
|
|
1663
|
-
plot,
|
|
1698
|
+
plot, Examples, Import, Export, Delete all, Edit, Duplicate and Delete) are left off the printed page.
|
|
1664
1699
|
In their place each chart prints a small block under its title giving the same settings and
|
|
1665
1700
|
lines as the saved image, so a printed histogram says which test it is of.</p>
|
|
1666
1701
|
<h3 id="wmap-names-of-saved-files">Names of saved files</h3>
|
|
@@ -1833,7 +1868,7 @@ and sets sample sizes only for static limits.</li>
|
|
|
1833
1868
|
<p>Neighbourhood screens (good die in a bad neighbourhood) are not part of AEC-Q001 and are not in this card.
|
|
1834
1869
|
Treat the counts as a way to find out where PAT would matter and which tests drive it.</p>
|
|
1835
1870
|
<h3 id="wmap-example-plots">10.13 Example plots</h3>
|
|
1836
|
-
<p><strong>
|
|
1871
|
+
<p><strong>Examples</strong> chooses its tests from the data in view rather than the order they are listed in. The <strong>lead test</strong>
|
|
1837
1872
|
is the one with the largest share of its variation lying between wafers (for a single wafer, the one most tied to
|
|
1838
1873
|
distance from the centre); its <strong>partner</strong> is the test that follows it most closely over a sample of dies (correlation
|
|
1839
1874
|
above 0.3); the <strong>split</strong> is the lot field whose groups explain most of the lead test's variation between wafers,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const WMAP_VERSION = "0.
|
|
2
|
-
export declare const WMAP_BUILD_TIME = "2026-
|
|
1
|
+
export declare const WMAP_VERSION = "0.39.0";
|
|
2
|
+
export declare const WMAP_BUILD_TIME = "2026-11-01T07:39:49.203Z";
|
|
3
3
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const WMAP_VERSION="0.
|
|
1
|
+
export const WMAP_VERSION="0.39.0",WMAP_BUILD_TIME="2026-11-01T07:39:49.203Z";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CLR as
|
|
1
|
+
import{CLR as o,FONT as w,RADIUS as l,SHADOW as f,SPACE as p,wireControlHover as A,wireTooltip as y}from"./toolbar.js";export function createViewSwitch(s,g,c,m){const n=s.createElement("div");n.setAttribute("role","tablist"),n.setAttribute("aria-label","View"),n.dataset.wmapViewSwitch="1",Object.assign(n.style,{order:"1",flexShrink:"0",display:"inline-flex",alignItems:"stretch",background:o.menuBg,border:`1px solid ${o.menuBorder}`,borderRadius:l.control,boxShadow:f.panel});const d=(t,e,h)=>{const r=s.createElement("button");return r.type="button",r.textContent=t,r.dataset.wmapView=e,r.setAttribute("role","tab"),Object.assign(r.style,{border:"none",cursor:"pointer",fontSize:w.body,padding:`${p.sm} ${p.lg}`,whiteSpace:"nowrap"}),A(r,"bare"),y(r,h),r.addEventListener("click",()=>{r.getAttribute("aria-selected")!=="true"&&m(e==="insights")}),r},i=d(g,"maps",c==="lot"?"The wafer maps":"The wafer map"),a=d("Insights","insights",`Charts and statistics for this ${c}`);i.style.borderRadius=`${l.control} 0 0 ${l.control}`,a.style.borderRadius=`0 ${l.control} ${l.control} 0`,n.append(i,a);const b=(t,e)=>{t.setAttribute("aria-selected",String(e)),t.dataset.on=String(e),t.tabIndex=e?0:-1,Object.assign(t.style,{background:e?o.bgActive:"transparent",color:e?o.iconActive:o.label,fontWeight:"600"})},u=t=>{b(i,!t),b(a,t)};return u(!1),n.addEventListener("keydown",t=>{if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;const e=s.activeElement===i?a:i;s.activeElement!==i&&s.activeElement!==a||(t.preventDefault(),e.focus(),e.click())}),{el:n,setInsightsOpen:u}}
|
|
@@ -6,6 +6,8 @@ export interface VirtualColumn<R> {
|
|
|
6
6
|
sortKey?: (row: R) => number | string | undefined;
|
|
7
7
|
/** Right-align (numbers). */
|
|
8
8
|
numeric?: boolean;
|
|
9
|
+
/** A colour behind the cell (see cellShade.ts), or undefined for none. */
|
|
10
|
+
shade?: (row: R) => string | undefined;
|
|
9
11
|
}
|
|
10
12
|
export interface VirtualTableOptions<R> {
|
|
11
13
|
columns: VirtualColumn<R>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ensureStylesInjected as
|
|
1
|
+
import{ensureStylesInjected as _}from"./dieList.js";import{CLR as K,RADIUS as X}from"./toolbar.js";const G=64,J=260,P=7.4;export function createVirtualTable(u){const l=u.ownerDocument??document;_(l);const b=u.rowHeight??24,L=u.overscan??10,w=u.columns;let c=u.rows,y=null,C=-1,x=1,k=0,M=-1;const i=l.createElement("div");Object.assign(i.style,{overflow:"auto",flex:"1",minHeight:"0",minWidth:"0",border:`1px solid ${K.menuBorder}`,borderRadius:X.control}),i.tabIndex=0,i.setAttribute("role","region"),i.setAttribute("aria-label",u.ariaLabel);const d=l.createElement("table");d.className="wmap-dielist-table",d.setAttribute("aria-label",u.ariaLabel),d.style.tableLayout="fixed";const N=l.createElement("colgroup"),q=Math.min(c.length,50);let H=0;w.forEach(t=>{let n=t.header.length+2;for(let o=0;o<q;o++)n=Math.max(n,t.get(c[o]).length);const e=Math.max(G,Math.min(J,Math.round(n*P+20)));H+=e;const a=l.createElement("col");a.style.width=`${e}px`,N.appendChild(a)}),d.style.width=`${H}px`,d.style.minWidth="100%",d.appendChild(N);const R=l.createElement("thead"),O=l.createElement("tr"),S=[];w.forEach((t,n)=>{const e=l.createElement("th");e.className="wmap-dielist-th",e.scope="col",e.textContent=t.header,e.style.cursor="pointer",e.style.overflow="hidden",e.style.textOverflow="ellipsis",t.numeric&&(e.style.textAlign="right"),e.setAttribute("aria-sort","none"),e.tabIndex=0;const a=()=>U(n);e.addEventListener("click",a),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),a())}),S.push(e),O.appendChild(e)}),R.appendChild(O),d.appendChild(R);const $=l.createElement("tbody");d.appendChild($),i.appendChild(d);const D=()=>{const t=l.createElement("tr");t.setAttribute("aria-hidden","true");const n=l.createElement("td");return n.colSpan=w.length,n.style.padding="0",n.style.border="none",t.appendChild(n),t},F=D(),I=D(),z=t=>c[y?y[t]:t];function B(){return i.clientHeight>0?i.clientHeight:u.fallbackViewportHeight??480}function E(t=!1){const n=c.length,e=R.offsetHeight||b,a=Math.max(0,i.scrollTop-e),o=Math.max(0,Math.floor(a/b)-L),r=Math.min(n-1,Math.ceil((a+B())/b)+L);if(!t&&o===k&&r===M)return;k=o,M=r;const p=l.createDocumentFragment();F.firstElementChild.style.height=`${o*b}px`,I.firstElementChild.style.height=`${Math.max(0,n-1-r)*b}px`,p.appendChild(F);for(let s=o;s<=r;s++){const h=z(s),m=l.createElement("tr");m.style.height=`${b}px`,m.setAttribute("aria-rowindex",String(s+2));for(const g of w){const f=l.createElement("td");f.className="wmap-dielist-td",f.textContent=g.get(h),f.style.overflow="hidden",f.style.textOverflow="ellipsis",g.numeric&&(f.style.textAlign="right");const j=g.shade?.(h);j&&(f.style.background=j),m.appendChild(f)}if(u.onRowClick){m.style.cursor="pointer";const g=y?y[s]:s;m.addEventListener("click",()=>u.onRowClick(h,g))}p.appendChild(m)}p.appendChild(I),$.replaceChildren(p)}function U(t){C===t?x=x===1?-1:1:(C=t,x=1),S.forEach((n,e)=>n.setAttribute("aria-sort",e!==C?"none":x===1?"ascending":"descending")),S.forEach((n,e)=>{n.textContent=w[e].header+(e===C?x===1?" \u25B2":" \u25BC":"")}),T(),i.scrollTop=0,E(!0)}function T(){const t=c.length;if(C<0||t===0){y=null;return}const n=w[C],e=n.sortKey??n.get,a=new Array(t);for(let r=0;r<t;r++)a[r]=e(c[r]);const o=new Uint32Array(t);for(let r=0;r<t;r++)o[r]=r;o.sort((r,p)=>{const s=a[r],h=a[p],m=s===void 0||s===""||typeof s=="number"&&Number.isNaN(s),g=h===void 0||h===""||typeof h=="number"&&Number.isNaN(h);if(m||g)return m===g?r-p:m?1:-1;const f=typeof s=="number"&&typeof h=="number"?s-h:String(s).localeCompare(String(h),void 0,{numeric:!0});return f!==0?f*x:r-p}),y=o}let v=0;const A=l.defaultView,V=()=>{v||(A&&typeof A.requestAnimationFrame=="function"?v=A.requestAnimationFrame(()=>{v=0,E()}):E())};i.addEventListener("scroll",V);const W=typeof ResizeObserver<"u"?new ResizeObserver(()=>E()):null;return W?.observe(i),d.setAttribute("aria-rowcount",String(c.length+1)),E(!0),{el:i,get length(){return c.length},orderedRows(){const t=c,n=y;return(function*(){for(let e=0;e<t.length;e++)yield t[n?n[e]:e]})()},setRows(t){c=t,d.setAttribute("aria-rowcount",String(c.length+1)),T(),i.scrollTop=0,E(!0)},drawnRange:()=>({first:k,last:M}),destroy(){i.removeEventListener("scroll",V),W?.disconnect(),v&&A&&A.cancelAnimationFrame(v),i.remove()}}}
|
|
@@ -44,6 +44,12 @@ export declare function hasAnyKey<T extends object>(obj: T | null | undefined):
|
|
|
44
44
|
* Returns 0 for an empty array, matching the callers that treat "no values" as no
|
|
45
45
|
* extent rather than as ±Infinity.
|
|
46
46
|
*/
|
|
47
|
+
/**
|
|
48
|
+
* A spread this small, as a share of the level it sits on, is noise to colour: a scale stretched over it would make a
|
|
49
|
+
* hundredth of a percent look as large as any other difference. Colour scales are widened to at least this share of the
|
|
50
|
+
* mean, and a set of means within it is left unshaded.
|
|
51
|
+
*/
|
|
52
|
+
export declare const NEGLIGIBLE_SPREAD = 0.01;
|
|
47
53
|
export declare function minOf(values: readonly number[]): number;
|
|
48
54
|
export declare function maxOf(values: readonly number[]): number;
|
|
49
55
|
export declare function clamp01(v: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function compareNatural(t,r){return t.localeCompare(r,"en",{numeric:!0})}export function prettyKey(t){return t.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/^./,r=>r.toUpperCase())}export function hasAnyKey(t){if(t==null)return!1;for(const r in t)if(Object.hasOwn(t,r))return!0;return!1}export function minOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]<r&&(r=t[e]);return r}export function maxOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]>r&&(r=t[e]);return r}export function clamp01(t){return Math.max(0,Math.min(1,t))}export function mean(t){if(t.length===0)return NaN;let r=0;for(const e of t)r+=e;return r/t.length}export function medianOfSorted(t){const r=t.length;if(r===0)return 0;const e=Math.floor(r/2);return r%2===1?t[e]:(t[e-1]+t[e])/2}export function median(t){return medianOfSorted([...t].sort((r,e)=>r-e))}export function percentile98(t){if(t.length===0)return 0;const r=Float64Array.from(t);r.sort();const e=Math.floor(r.length*.98);return r[Math.min(e,r.length-1)]}export function modeOf(t){if(!t.length)return null;const r=new Map;for(const o of t)r.set(o,(r.get(o)??0)+1);let e=0,n=t[0];for(const[o,f]of r)f>e&&(e=f,n=o);return n}const i=/^[=+\-@]/;export function csvField(t){const r=i.test(t)&&Number.isNaN(Number(t))?`'${t}`:t;return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r}export function escHtml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export function arrayEqual(t,r){if(t===r)return!0;if(!t||!r||t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==r[e])return!1;return!0}export function mapEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const[e,n]of t)if(!r.has(e)||r.get(e)!==n)return!1;return!0}export function setEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const e of t)if(!r.has(e))return!1;return!0}export function drain(t){let r=t.next();for(;!r.done;)r=t.next();return r.value}export function asList(t){return t===void 0?[]:Array.isArray(t)?t:[t]}export function toggleHighlight(t,r,e){const n=asList(t),o=e?n.includes(r)?n.filter(f=>f!==r):[...n,r]:n.length===1&&n[0]===r?[]:[r];return o.length===0?void 0:o.length===1?o[0]:o}
|
|
1
|
+
export function compareNatural(t,r){return t.localeCompare(r,"en",{numeric:!0})}export function prettyKey(t){return t.replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/_/g," ").trim().replace(/^./,r=>r.toUpperCase())}export function hasAnyKey(t){if(t==null)return!1;for(const r in t)if(Object.hasOwn(t,r))return!0;return!1}export const NEGLIGIBLE_SPREAD=.01;export function minOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]<r&&(r=t[e]);return r}export function maxOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]>r&&(r=t[e]);return r}export function clamp01(t){return Math.max(0,Math.min(1,t))}export function mean(t){if(t.length===0)return NaN;let r=0;for(const e of t)r+=e;return r/t.length}export function medianOfSorted(t){const r=t.length;if(r===0)return 0;const e=Math.floor(r/2);return r%2===1?t[e]:(t[e-1]+t[e])/2}export function median(t){return medianOfSorted([...t].sort((r,e)=>r-e))}export function percentile98(t){if(t.length===0)return 0;const r=Float64Array.from(t);r.sort();const e=Math.floor(r.length*.98);return r[Math.min(e,r.length-1)]}export function modeOf(t){if(!t.length)return null;const r=new Map;for(const o of t)r.set(o,(r.get(o)??0)+1);let e=0,n=t[0];for(const[o,f]of r)f>e&&(e=f,n=o);return n}const i=/^[=+\-@]/;export function csvField(t){const r=i.test(t)&&Number.isNaN(Number(t))?`'${t}`:t;return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r}export function escHtml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export function arrayEqual(t,r){if(t===r)return!0;if(!t||!r||t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==r[e])return!1;return!0}export function mapEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const[e,n]of t)if(!r.has(e)||r.get(e)!==n)return!1;return!0}export function setEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const e of t)if(!r.has(e))return!1;return!0}export function drain(t){let r=t.next();for(;!r.done;)r=t.next();return r.value}export function asList(t){return t===void 0?[]:Array.isArray(t)?t:[t]}export function toggleHighlight(t,r,e){const n=asList(t),o=e?n.includes(r)?n.filter(f=>f!==r):[...n,r]:n.length===1&&n[0]===r?[]:[r];return o.length===0?void 0:o.length===1?o[0]:o}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createWafer as Q}from"../core/wafer.js";import{isYieldEligibleDie as ve,getDieKey as X,hasPosition as W,positionKey as Se}from"../core/dies.js";import{applyOrientation as se,transformDies as Ce,clipDiesToWafer as ke}from"../core/transforms.js";import{generateDies as Oe}from"../core/dies.js";import{dieHasAnyTestData as Ae,dieLink as U,finaliseDie as z,linkDie as $e,recordedVerdict as Ne,recordedVerdictsReader as Re,tableFromRows as Fe,testValue as Z,testsPresent as Ee,VERDICT_FAIL as Te,VERDICT_NONE as We,VERDICT_PASS as Ie}from"../core/dieTable.js";import{isDieColumns as _e,linkColumns as Pe,linkRows as re,relink as oe}from"./columnarInput.js";import{affineRotation as Ve,affineMirror as Be,affineCompose as Le,affinePoint as Ye}from"../core/transforms.js";import{inferWaferFromXY as Xe}from"../core/inference/wafer.js";import{resolveGridPitch as Ke}from"../core/inference/pitch.js";import{assignGridIndices as je}from"../core/inference/grid.js";import{generateReticleGrid as He}from"../core/reticle.js";import{applyDerivedTests as Ue}from"./derivedTests/apply.js";import{isStdfBin as ze,isStdfCoord as ae,isStdfTestNumber as de,isStdfSite as Ge,STDF_BIN_MAX as qe,STDF_COORD_MAX as fe,STDF_TEST_NUM_MAX as Je,STDF_SITE_MAX as Qe}from"../core/stdf.js";import{hasAnyKey as Ze,maxOf as ee,minOf as le,modeOf as et}from"../core/utils.js";import{aggregateValues as ue,aggregateBinCounts as tt,stackHoldsMeasurements as nt,stackBinsAreData as it}from"../core/aggregates.js";import{normalizePassBins as ce}from"../core/passBins.js";import{defaultRingCount as te}from"../core/ringCount.js";import{applyValueFilter as st,mergeValueFilterTests as rt,valueFilterWarning as ot}from"./valueFilter.js";export function isParametricTest(n){return n?.testType!=="F"}export function isBuiltMap(n){return"wafer"in n&&"dies"in n&&"dataAxisFlip"in n}function at(n){const e=(i,a)=>({ringCount:i,ringCountWarning:{code:"analysis-option-corrected",severity:"warning",message:`ringCount=${String(n)} ${a} (using ${i}).`}});if(n===void 0)return{ringCount:te(),ringCountWarning:void 0};if(typeof n!="number"||!Number.isFinite(n))return e(te(),"is not a finite number");const t=Math.max(1,Math.round(n));return t===n?{ringCount:n,ringCountWarning:void 0}:e(t,"is not a whole number of at least 1")}function dt(n,e){const t=Array.isArray(n)?{}:n,i={hbin:0,sbin:0,siteNum:0,testValues:0,testPass:0};let a;const d=(u,C)=>{i[u]++,a??=`${u} ${JSON.stringify(C)}`},o={bins:0,positions:0,values:0,sites:0,orientation:0},r=new Set;let p=0;if(e){i.testValues+=e.wrongValues,i.testPass+=e.wrongVerdicts,e.example!==void 0&&(a??=e.example),o.values+=e.nonFinite;for(const u of e.badTestNumbers)r.add(u)}const h=u=>u==null?!0:typeof u!="number"?!1:Number.isNaN(u)?(p++,!1):ze(u)?!0:(o.bins++,!1);function l(u){const C=new Set,D=new Set;for(let S=0;S<u.length;S+=S<50?1:100){const N=u[S];if(!(N===null||typeof N!="object")){if(N.testValues&&typeof N.testValues=="object")for(const M of Object.keys(N.testValues))C.add(M);if(N.testPass&&typeof N.testPass=="object")for(const M of Object.keys(N.testPass))D.add(M)}}const g=[...C],b=[...D],k=S=>de(Number(S));for(const S of new Set([...g,...b]))k(S)||r.add(S);const R=g.map(k),v=b.map(k),T=g.map(Number),L=b.map(Number);let K;for(let S=0;S<u.length;S++){const N=u[S];if(N===null||typeof N!="object")continue;const M=N;let F;const $=()=>F??={...M};M.hbin!=null&&typeof M.hbin!="number"&&d("hbin",M.hbin),M.sbin!=null&&typeof M.sbin!="number"&&d("sbin",M.sbin),h(M.hbin)||($().hbin=void 0),h(M.sbin)||($().sbin=void 0);const Y=typeof M.x=="number"&&!ae(M.x),j=typeof M.y=="number"&&!ae(M.y);if(Y||j){o.positions+=(Y?1:0)+(j?1:0);const s=$();s.x=void 0,s.y=void 0}M.siteNum!=null&&typeof M.siteNum!="number"?(d("siteNum",M.siteNum),$().siteNum=void 0):typeof M.siteNum=="number"&&!Ge(M.siteNum)&&(o.sites++,$().siteNum=void 0);const P=M.testValues;if(P&&typeof P=="object"){let s;for(let x=0;x<g.length;x++){const A=g[x],O=P[T[x]];if(O!=null){if(!R[x]){s??={...P},delete s[A];continue}typeof O!="number"?(d("testValues",O),s??={...P},delete s[A]):Number.isFinite(O)||(o.values++,s??={...P},delete s[A])}}s&&($().testValues=s)}const I=M.testPass;if(I&&typeof I=="object"){let s;for(let x=0;x<b.length;x++){const A=b[x],O=I[L[x]];if(O!=null){if(!v[x]){s??={...I},delete s[A];continue}typeof O!="boolean"&&(d("testPass",O),s??={...I},delete s[A])}}s&&($().testPass=s)}F&&((K??=u.slice())[S]=F)}return K}const f={warnings:[]};if(Array.isArray(n))f.results=l(n);else{Array.isArray(t.results)&&(f.results=l(t.results)),Array.isArray(t.dies)&&(f.dies=l(t.dies));const u=t.lotStack?.results;if(Array.isArray(u)){const C=u.map(D=>Array.isArray(D)?l(D):void 0);C.some(Boolean)&&(f.stackResults=C.map((D,g)=>D??u[g]))}}if(Array.isArray(t.testDefs)){const u=t.testDefs,C=u.filter(D=>D==null||typeof D.testNumber!="number"||de(D.testNumber));for(const D of u)C.includes(D)||r.add(String(D.testNumber));C.length!==u.length&&(f.testDefs=C)}const y=t.waferConfig?.orientation;if(typeof y=="number"){const u=Number.isFinite(y)?(y%360+360)%360:NaN;u===0||u===90||u===180||u===270?f.orientation=u:(o.orientation++,f.orientation=0)}const m=(u,C,D=`${C}s`)=>`${u} ${u===1?C:D}`,c=[];if(i.hbin&&c.push(m(i.hbin,"hard bin")),i.sbin&&c.push(m(i.sbin,"soft bin")),i.siteNum&&c.push(m(i.siteNum,"site number")),i.testValues&&c.push(m(i.testValues,"test value")),i.testPass&&c.push(m(i.testPass,"pass/fail verdict")),c.length){const u=`buildWaferMap received ${c.join(", ")} of the wrong type (for example ${a}), treated as missing. Bins, sites and test values must be numbers and verdicts true/false \u2014 a bin of "1" is not pass bin 1 \u2014 so those dies have no bin, no site, no value or no verdict, and yield and every chart leave them out. Convert them with Number() (and verdicts to booleans) and rebuild.`;console.warn(`[wafermap] ${u}`),f.warnings.push({code:"input-values-not-numbers",message:u,severity:"error"})}const w=[];if(o.bins&&w.push(`${m(o.bins,"bin")} (legal: whole numbers 0\u2013${qe}) \u2014 those dies have no bin`),o.positions&&w.push(`${m(o.positions,"coordinate")} (legal: whole numbers \u2212${fe} to ${fe}) \u2014 those dies have no position`),r.size&&w.push(`${m(r.size,"test number")} (legal: whole numbers 0\u2013${Je}) \u2014 those tests are left out`),o.values&&w.push(`${m(o.values,"test value")} that ${o.values===1?"is":"are"} not finite \u2014 left out`),o.sites&&w.push(`${m(o.sites,"site number")} (legal: 0\u2013${Qe}) \u2014 those dies have no site`),o.orientation&&w.push("a waferConfig.orientation other than 0, 90, 180 or 270 \u2014 the map is built at 0"),w.length||p){const u=[];w.length&&u.push(`buildWaferMap received values outside the STDF V4 ranges, treated as missing: ${w.join("; ")}.`),p&&u.push(`${m(p,"bin was","bins were")} NaN and ${p===1?"is":"are"} treated as no bin.`);const C=u.join(" ");console.warn(`[wafermap] ${C}`),f.warnings.push({code:"input-values-outside-stdf",message:C,severity:"warning"})}return f}function pe(n){const e=(h,l)=>h!==null&&typeof h=="object"&&h[l]!==void 0,t=Array.isArray(n)?{}:n,i=[],a=(h,l,f)=>{h&&i.push(`\`${l}\` (now \`${f}\`)`)};a(e(t,"data"),"data","results"),a(e(t,"die"),"die","dieConfig"),a(e(t,"stack"),"stack","lotStack"),a(e(t.dieConfig,"origin"),"dieConfig.origin","dieConfig.coordinateOrigin"),a(e(t.waferConfig,"flat"),"waferConfig.flat","waferConfig.notch"),a(e(t.reticleConfig,"anchor"),"reticleConfig.anchor","reticleConfig.anchorDie"),a(e(t.lotStack,"aggr"),"lotStack.aggr","lotStack.method"),a(Array.isArray(t.testDefs)&&t.testDefs.some(h=>e(h,"index")&&!e(h,"testNumber")),"TestDef.index","TestDef.testNumber");const d=e(t.lotStack,"results")?t.lotStack.results:[],o=(Array.isArray(n)?[n]:[t.results,...Array.isArray(d)?d:[]]).filter(h=>Array.isArray(h));if(a(o.some(h=>h.slice(0,100).some(l=>e(l,"values"))),"values","testValues"),!i.length)return;const r=i.length>1,p=`buildWaferMap ignored ${i.join(", ")}: ${r?"these names were":"that name was"} removed in an earlier release, so what ${r?"they":"it"} described is not on this map. Rename and rebuild.`;return console.warn(`[wafermap] ${p}`),{code:"input-field-removed",message:p,severity:"error"}}function ft(n){if(n.results!==void 0||n.lotStack!==void 0)throw new Error("buildWaferMap: pass `layout`, `results` or `lotStack` \u2014 only one.");const e=n.waferConfig?.diameter,t=n.dieConfig?.width,i=n.dieConfig?.height;if(!(e>0&&t>0&&i>0))throw new Error("buildWaferMap: `layout` needs waferConfig.diameter and dieConfig.width and height, all positive.");const a=Q({diameter:e,notch:n.waferConfig?.notch,orientation:0}),d=ke(Oe(a,{width:t,height:i}),a,{width:t,height:i}).filter(l=>!l.partial),{flipX:o,flipY:r}=me(n.dieConfig,{type:"center"}),{layout:p,...h}=n;return{...h,results:d.map(l=>({x:o?-l.x:l.x,y:r?-l.y:l.y})),waferConfig:{...n.waferConfig,center:{x:0,y:0}},dieConfig:{...n.dieConfig,coordinateOrigin:{type:"center"}}}}function lt(n){if(!Array.isArray(n)&&"results"in n&&n.results!==void 0&&"lotStack"in n&&n.lotStack!==void 0)throw new Error("buildWaferMap: pass either `results` or `lotStack`, not both.");const e={wrongVerdicts:0,wrongValues:0,nonFinite:0,badTestNumbers:[]},t=!Array.isArray(n)&&_e(n.results)?{...n,results:Pe(n.results,e).records}:n,i=dt(t,e);return Array.isArray(t)?{results:ne(i.results??t),waferOpts:void 0,dieOpts:void 0,explicitDies:void 0,reticleOpts:void 0,lotStackOpts:void 0,passBins:ce(void 0),ringCount:te(),valueFilter:"validity",ringCountWarning:void 0,removedFieldWarning:pe(t),inputValueWarnings:i.warnings,standardDiameters:void 0,testDefs:void 0,hbinDefs:void 0,sbinDefs:void 0,metadataFields:void 0,derivedTests:void 0,retestPolicy:"last",edgeDieYieldMode:"exclude"}:{results:ne(i.results??t.results??[]),waferOpts:i.orientation===void 0||t.waferConfig===void 0?t.waferConfig:{...t.waferConfig,orientation:i.orientation},dieOpts:t.dieConfig,explicitDies:i.dies??t.dies,reticleOpts:t.reticleConfig,lotStackOpts:t.lotStack?{...t.lotStack,results:(i.stackResults??t.lotStack.results).map(ne)}:void 0,passBins:ce(t.passBins),valueFilter:t.valueFilter??"validity",...at(t.ringCount),removedFieldWarning:pe(t),inputValueWarnings:i.warnings,standardDiameters:t.standardDiameters,testDefs:(i.testDefs??t.testDefs)?.length?i.testDefs??t.testDefs:void 0,hbinDefs:t.hbinDefs,sbinDefs:t.sbinDefs,metadataFields:t.metadataFields,derivedTests:t.derivedTests?.length?t.derivedTests:void 0,retestPolicy:t.retestPolicy??"last",edgeDieYieldMode:t.edgeDieYieldMode??"exclude"}}function ne(n){return n.length>0&&U(n[0])!==void 0?n:re(n).records}function ut(n,e){return e?.coordinateOrigin?e.coordinateOrigin:{type:"center"}}function ct(n,e,t){if(e.type==="custom"&&e.offset)return{offsetX:e.offset.x,offsetY:e.offset.y};if(e.type!=="center"){let i=1/0,a=-1/0,d=1/0,o=-1/0;for(const r of n)r.x<i&&(i=r.x),r.x>a&&(a=r.x),r.y<d&&(d=r.y),r.y>o&&(o=r.y);return{offsetX:Math.round((a+i)/2),offsetY:Math.round((o+d)/2)}}return{offsetX:t.offsetX,offsetY:t.offsetY}}function pt(n,e){if(n.length<xe)return!1;const t=he(n),i=(a,d,o)=>{const r=o-d+1;return a<d-r||a>o+r};return i(Math.round(e.x),t.xMin,t.xMax)||i(Math.round(e.y),t.yMin,t.yMax)}function he(n){let e=1/0,t=-1/0,i=1/0,a=-1/0;for(const d of n){const o=Math.round(d.x),r=Math.round(d.y);o<e&&(e=o),o>t&&(t=o),r<i&&(i=r),r>a&&(a=r)}return{xMin:e,xMax:t,yMin:i,yMax:a}}const ht="The supplied wafer centre";function mt(n,e){const t=he(n);return`${ht} (${e.x}, ${e.y}) is far outside the probed dies (X ${t.xMin}\u2026${t.xMax}, Y ${t.yMin}\u2026${t.yMax}), so it was ignored and the centre was inferred from the dies. Used as given, it would draw a wafer many times the die extent with the dies in one corner. If it is the real centre, supply waferConfig.diameter as well.`}function gt(n,e,t,i,a,d){if(d)return{colMidX:(Math.round(d.x)-e)*i,colMidY:(Math.round(d.y)-t)*a,anchored:!0};if(n.length===0)return{colMidX:0,colMidY:0,anchored:!1};let o=1/0,r=-1/0,p=1/0,h=-1/0;for(const l of n){const f=Math.round(l.x)-e,y=Math.round(l.y)-t;f<o&&(o=f),f>r&&(r=f),y<p&&(p=y),y>h&&(h=y)}return{colMidX:(o+r)/2*i,colMidY:(p+h)/2*a,anchored:!1}}function yt(n,e,t){let i=1/0,a=-1/0,d=1/0,o=-1/0,r=0,p=0;for(const f of n){const y=Math.round(f.x)-e,m=Math.round(f.y)-t;r+=y,p+=m,y<i&&(i=y),y>a&&(a=y),m<d&&(d=m),m>o&&(o=m)}const h=n.length,l=(f,y,m)=>{const c=(m-y)/2;return c<=0?0:Math.abs(f/h-(y+m)/2)/c};return l(r,i,a)>.11||l(p,d,o)>.11}function me(n,e){let t=n?.xAxisDirection==="left",i=n?.yAxisDirection==="down";return(e.type==="UL"||e.type==="UR")&&(i=!0),(e.type==="LR"||e.type==="UR")&&(t=!0),{flipX:t,flipY:i}}function bt(n){const e={...n};return delete e.limitLow,delete e.limitHigh,delete e.limitLowInclusive,delete e.limitHighInclusive,delete e.specLow,delete e.specHigh,e}function wt(n,e){const{method:t,targetBin:i}=n,a=n.results.map(d=>d.filter(W));if(t==="mean"||t==="median"||t==="stddev"||t==="min"||t==="max"||t==="count"){const d=new Set((e??[]).filter(l=>!isParametricTest(l)).map(l=>l.testNumber)),o=new Set;for(const l of a)for(const f of Ee(l,"values"))d.has(f)||o.add(f);if(o.size===0)return ue(a,t);const r=[...o],p=r.map(l=>ue(a,t,l)),h=new Map;for(let l=0;l<r.length;l++){const f=r[l];for(const y of p[l]){const m=X(y);h.has(m)||h.set(m,{template:y,testValues:{}});const c=h.get(m),w=y.testValues?.[0];w!==void 0&&(c.testValues[f]=w)}}return[...h.values()].map(({template:l,testValues:f})=>({...l,testValues:Ze(f)?f:void 0}))}if(t==="countBin"||t==="percent"){if(i===void 0)return[];const d=tt(a,i,"hard");if(t==="countBin")return d;const o=a.length;return d.map(r=>({...r,testValues:{0:o>0?(r.testValues?.[0]??0)/o*100:0}}))}if(t==="mode"){const d=new Map;for(const r of a)for(const p of r){const h=X(p);d.has(h)||d.set(h,[]),d.get(h).push(p)}const o=[];for(const[r,p]of d){const h=r.split(","),l=Number(h[0]),f=Number(h[1]),y=p.map(c=>c.hbin).filter(c=>c!==void 0),m=et(y);m!==null&&o.push({x:l,y:f,hbin:m})}return o}return[]}export function computeCoverage(n){const e=n.filter(W),t=e.length,i=e.filter(d=>d.edgeExcluded).length,a=e.filter(d=>d.hbin!==void 0||d.sbin!==void 0||dieHasTestData(d)).length;return{filledDies:a,totalDies:t,edgeExcludedDies:i,unpositionedDies:n.length-e.length,ratio:t>0?a/t:0}}export function computeYield(n,e,t="exclude",i=!0){const a=new Set(e),o=n.filter(c=>!c.partial).filter(c=>c.edgeExcluded&&!c.filteredOut).length,r=n.filter(c=>c.partial).length;if(!i)return{passDies:0,failDies:0,edgeExcludedDies:o,partialDies:r,totalDies:0,yieldPercent:null,yieldPercentGross:null};let p=0,h=0,l=!1;for(const c of n){if(!ve(c))continue;const w=c.hbin??c.sbin;w!==void 0&&(l=!0,a.has(w)?p++:h++)}const f=p+h,y=l&&f>0?p/f*100:null;let m=null;if(t==="denominator-only"){const c=f+o;m=l&&c>0?p/c*100:null}return{passDies:p,failDies:h,edgeExcludedDies:o,partialDies:r,totalDies:f,yieldPercent:y,yieldPercentGross:m}}function ge(n,e,t,i,a,d=0,o=0,r=0,p=0,h=0,l=!1,f=!1){if(!n)return[];const y=n.anchorDie??{x:0,y:0},m=He(e,{width:n.width,height:n.height,diePitchX:i,diePitchY:a,anchorDie:{x:y.x-d,y:y.y-o},gridOrigin:{x:-r,y:-p}}),c=Le(Be(l,f,e.center.x,e.center.y),Ve(h,e.center.x,e.center.y));return m.filter(w=>{const u=w.width/2,C=w.height/2,D=[[w.x-u,w.y-C],[w.x+u,w.y-C],[w.x+u,w.y+C],[w.x-u,w.y+C]].map(([v,T])=>Ye(c,v,T)),g=le(D.map(v=>v.x)),b=ee(D.map(v=>v.x)),k=le(D.map(v=>v.y)),R=ee(D.map(v=>v.y));return t.some(v=>v.physX>=g&&v.physX<b&&v.physY>=k&&v.physY<R)})}function xt(n,e,t){const a=Math.max(0,e.radius-t)**2;return n.map(d=>{const o=d.physX-e.center.x,r=d.physY-e.center.y;return o*o+r*r>a?{...d,edgeExcluded:!0}:d})}const Dt=.2;function Mt(n){const e=new Set;for(const t of n){if(t.supersedes!==void 0||!W(t))return!1;const i=Se(t);if(e.has(i))return!1;e.add(i)}return!0}function vt(n,e,t){if(Mt(n))return{results:n.slice(),warning:void 0};const i=new Set(t);function a(g,b){if(e==="last")return!0;if(e==="first")return!1;const k=G(g.hbin),R=G(b.hbin);if(k===void 0||R===void 0)return!1;const v=i.has(k),T=i.has(R);return e==="best"?T!==v?T:R<k:T!==v?v:R>k}const d=(g,b)=>b.supersedes!==void 0||a(g,b),o=g=>{const b=g.partId===void 0?"":String(g.partId).trim();return b===""?void 0:b},r=n.filter(g=>!W(g)),p=new Map;for(const g of r){const b=o(g);b!==void 0&&p.set(b,(p.get(b)??0)+1)}const l=(r.length===0?0:Math.max(0,...p.values())/r.length)<=Dt,f=new Map,y=[],m=new Map;let c=0,w=0;for(const g of n){const b=o(g);let k;if(W(g)?k=`p:${X(g)}`:l&&b!==void 0?k=`i:${b}`:k=`u:${w++}`,g.supersedes==="partId"&&b!==void 0){const v=m.get(b);v!==void 0&&v!==k&&f.has(v)&&f.delete(v)}const R=f.get(k);R===void 0?(f.set(k,{winner:g,count:1}),y.push(k)):(R.count++,k.startsWith("i:")&&c++,d(R.winner,g)&&(R.winner=g)),b!==void 0&&m.set(b,k)}const u=[],C=[...y.filter(g=>g.startsWith("p:")),...y.filter(g=>!g.startsWith("p:"))];for(const g of C){const b=f.get(g);b!==void 0&&u.push(b.count>1?{...b.winner,retestCount:b.count}:b.winner)}const D=c>0?{code:"retests-by-part-id",severity:"info",message:`${c} record${c===1?"":"s"} with no position shared a part ID with an earlier record and ${c===1?"was":"were"} treated as a retest of it.`}:void 0;return{results:u,warning:D}}export function getDieTestValue(n,e){return Z(n,e)}export function getTestPassStatus(n,e,t){const i=Ne(n,e);return i!==void 0?i:t!==void 0&&!isParametricTest(t)?ye(Z(n,e)):void 0}function ye(n){return n===0||n===1?n===1:void 0}export function testPassStatusReader(n){const e=n.map(a=>a.testNumber),t=Re(e),i=n.map(a=>!isParametricTest(a));return function(d,o){t(d,o);for(let r=0;r<o.length;r++){if(o[r]!==We||!i[r])continue;const p=ye(Z(d,e[r]));p!==void 0&&(o[r]=p?Ie:Te)}return o}}export function dieHasTestData(n){return Ae(n)}function G(n){return n===void 0||Number.isNaN(n)?void 0:n}function q(n,e){const t={},i=G(e.hbin),a=G(e.sbin);i!==void 0&&(t.hbin=i),a!==void 0&&(t.sbin=a),e.retestCount!==void 0&&(t.retestCount=e.retestCount),e.siteNum!==void 0&&(t.siteNum=e.siteNum),e.partId!==void 0&&(t.partId=e.partId),e.metadata!==void 0&&(t.metadata=e.metadata);const d=U(e);return $e({...n,...t},d.table,d.row)}function be(n){return n.some(dieHasTestData)?"value":defaultBinMode([n])}export function defaultBinMode(n){const e=t=>n.some(i=>i.some(a=>t(a)!=null));return e(t=>t.hbin)?"hardBin":e(t=>t.sbin)?"softBin":"hardBin"}function we(n,e){return n.map(({code:t,message:i})=>({code:t,message:i,severity:t==="non-standard-diameter"||t==="diameter-exceeds-die-extent"||t==="implausible-center"?"warning":"error",confidence:e.wafer.confidence}))}const St="do not fit inside the supplied",Ct="Inferred wafer diameter",kt="The probed dies reach only",Ot=.75,xe=20;export const STANDARD_WAFER_DIAMETERS_MM=[100,125,150,200,300];const At=.02;function De(n,e){return e.reduce((t,i)=>Math.abs(i-n)<Math.abs(t-n)?i:t)}function $t(n,e){if(!e.length)return!0;const t=De(n,e);return Math.abs(t-n)/t<=At}function Nt(n){return n===void 0?STANDARD_WAFER_DIAMETERS_MM:n.filter(e=>Number.isFinite(e)&&e>0)}export function buildWaferMap(n){const e=lt(!Array.isArray(n)&&n.layout?ft(n):n),t=[];let i;if(e.valueFilter!=="none"&&e.testDefs){const s=e.valueFilter,x=(e.lotStackOpts?e.lotStackOpts.results:[e.results]).map(O=>{const _=O.length>0?U(O[0]):void 0;if(!_)return[];const E=st(_.table,e.testDefs,s);return E.tests.length>0&&oe(O,E.table),E.tests}),A=rt(x);if(A.length>0){i={mode:s,tests:A};const O=ot(s,A,e.testDefs);O&&t.push(O)}}if(e.derivedTests){const s=new Set(e.passBins),x=_=>{const E=_.length>0?U(_[0]):void 0,H=Ue(_,E?.table??Fe([]),e.testDefs,e.derivedTests,s);return E&&oe(_,H.table),H},O=(e.lotStackOpts?e.lotStackOpts.results:[e.results]).map(x);e.testDefs=O[0]?.testDefs??e.testDefs,t.push(...O[0]?.warnings??[])}e.lotStackOpts&&!nt(e.lotStackOpts.method)&&(e.testDefs=e.testDefs?.map(bt));const a=e.lotStackOpts?re(wt(e.lotStackOpts,e.testDefs)).records:e.results;for(let s=0;s<Math.min(5,a.length);s++){const x=a[s];if(typeof x.x=="string"||typeof x.y=="string")throw new TypeError("buildWaferMap: x and y must be numbers, received strings. Did you forget to cast CSV values? e.g. { x: +row.x, y: +row.y }")}for(const s of a)if(s.x==null!=(s.y==null))throw new TypeError(`buildWaferMap: die has only one of x/y set (x=${String(s.x)}, y=${String(s.y)}). A die must be either fully positioned (both x and y) or fully unpositioned (neither) \u2014 omit both to mark a die as having no reported position.`);const{results:d,warning:o}=vt(a,e.retestPolicy,e.passBins),r={wafer:{confidence:1,method:"provided"},diePitch:{confidence:1,units:"mm"},grid:{confidence:1}},p=[];if(e.explicitDies){let s=e.explicitDies.filter(W);const x=e.explicitDies.filter(B=>!W(B)),A=d.filter(W),O=d.filter(B=>!W(B));if(A.length>0){const B=new Map(A.map(V=>[X(V),V]));s=s.map(V=>{const ie=B.get(X(V));return ie?q(V,ie):V})}const _=e.waferOpts?.diameter??300,E=Q({diameter:_,notch:e.waferOpts?.notch,orientation:e.waferOpts?.orientation??0,metadata:e.waferOpts?.metadata,reticle:e.reticleOpts});E.orientation!==0&&(s=se(s,E)),s=s.map(z);const H=ge(e.reticleOpts,E,s,1,1,0,0,0,0,E.orientation),Me=O.map((B,V)=>z(q({id:`unpositioned_${V}`,width:s[0]?.width??1,height:s[0]?.height??1},B))),J=[...s,...x,...Me];return{wafer:E,dies:J,dataAxisFlip:{x:!1,y:!1},reticleConfig:e.reticleOpts,units:"mm",inference:r,warnings:[...e.removedFieldWarning?[e.removedFieldWarning]:[],...e.inputValueWarnings,...o?[o]:[],...we(p,r),...t,...e.ringCountWarning?[e.ringCountWarning]:[]],plotMode:be(d),metadata:E.metadata??null,isLotStack:!1,dataCoverage:computeCoverage(J),passBins:e.passBins,...i?{valueFilter:i}:{},ringCount:e.ringCount,yield:computeYield(J,e.passBins,e.edgeDieYieldMode),reticles:H,hbinDefs:e.hbinDefs,sbinDefs:e.sbinDefs,testDefs:e.testDefs,metadataFields:e.metadataFields}}const h=d.filter(W),l=d.filter(s=>!W(s)),f=h.map(s=>({x:s.x,y:s.y})),y=Ke(f,e.dieOpts,e.waferOpts?.diameter);r.diePitch={confidence:y.confidence,units:y.units};const{pitchX:m,pitchY:c}=y,w=y.units,u=ut(h,e.dieOpts),C=je(f);r.grid={confidence:C.confidence};const{offsetX:D,offsetY:g}=ct(f,u,C),{flipX:b,flipY:k}=me(e.dieOpts,u),R=e.waferOpts?.diameter===void 0&&e.waferOpts?.center!==void 0&&pt(f,e.waferOpts.center),v=R?void 0:e.waferOpts?.center;R&&p.push({code:"implausible-center",message:mt(f,e.waferOpts.center)});const{colMidX:T,colMidY:L,anchored:K}=gt(f,D,g,m,c,v);let S=e.waferOpts?.diameter;const N=f.map(s=>({x:(Math.round(s.x)-D)*m-T,y:(Math.round(s.y)-g)*c-L})),M=ee(N.map(({x:s,y:x})=>Math.hypot(Math.abs(s)+m/2,Math.abs(x)+c/2)));if(S===void 0)if(f.length>0)if(w==="mm"){const s=Xe(N,{minRadius:M});S=s.diameter,r.wafer={confidence:s.confidence,method:s.method};const x=Nt(e.standardDiameters);if(!$t(S,x)){const A=De(S,x);p.push({code:"non-standard-diameter",message:`${Ct} ${S.toFixed(1)} mm is not a standard wafer size (nearest is ${A} mm). The diameter was derived from the die extent, which assumes the probed grid reaches the wafer edge \u2014 a non-standard result usually means it does not, because the outer dies were never probed. Every die is then placed against a wafer that is too small, which moves dies between rings and changes ring and edge findings. Supply waferConfig.diameter.`})}}else S=M*2,r.wafer={confidence:y.confidence*.8,method:"extent"};else S=w==="mm"?300:30,r.wafer={confidence:0,method:"default"};if(!K&&f.length>0&&yt(f,D,g)&&(r.wafer.method="inferred-partial",p.push({code:"partial-coverage",message:"Wafer geometry was inferred from die positions alone. The data does not span a full symmetric wafer, so the inferred diameter and centre may be wrong and dies may be mis-positioned relative to the true wafer boundary. Supply waferConfig.diameter and waferConfig.center (the prober coordinate of the wafer centre) to position partial data correctly."})),e.waferOpts?.diameter!==void 0&&v===void 0&&M>0&&f.length>=xe){const s=M/(S/2);s<Ot&&p.push({code:"diameter-exceeds-die-extent",message:`${kt} ${(s*100).toFixed(0)}% of the ${S} mm wafer's radius. Either the diameter is larger than the real one, or this is a partial map covering only part of the wafer. Ring bands are equal-radius, so the outer rings are mostly or entirely empty and ring, quadrant and edge findings describe the assumed wafer rather than the probed area. Check waferConfig.diameter, or drop it and let the diameter be inferred from the die extent.`})}if(e.waferOpts?.diameter!==void 0){const s=e.dieOpts?.width!==void 0&&e.dieOpts?.height!==void 0;if(s&&M>S/2+1e-9){const x=N.filter(({x:A,y:O})=>Math.hypot(Math.abs(A)+m/2,Math.abs(O)+c/2)>S/2+1e-9).length;p.push({code:"geometry-conflict",message:`${x} of ${N.length} probed die positions ${St} ${S} mm wafer at the supplied die pitch of ${m} \xD7 ${c} mm. A die with test results is a real prober position and is always fully on the wafer, so one of the two supplied values must be wrong: containing these dies at this pitch would need a diameter of at least ${(M*2).toFixed(1)} mm. Check waferConfig.diameter and dieConfig.width/height against the real device.`})}}const F=Q({diameter:S,units:w,notch:e.waferOpts?.notch,orientation:e.waferOpts?.orientation??0,metadata:e.waferOpts?.metadata,reticle:e.reticleOpts});let $=h.map(s=>{const x=Math.round(s.x)-D,A=Math.round(s.y)-g,O={id:`${x}_${A}`,x,y:A,physX:x*m-T,physY:A*c-L,width:m,height:c,insideWafer:!0,partial:!1};return q(O,s)});(D!==0||g!==0)&&($=$.map(s=>({...s,x:s.x+D,y:s.y+g,id:`${s.x+D}_${s.y+g}`}))),$=se($,F),(b||k)&&($=Ce($,{flipX:b,flipY:k},F.center));const Y=[];e.waferOpts?.edgeExclusion&&e.waferOpts.edgeExclusion>0&&($=xt($,F,e.waferOpts.edgeExclusion),e.waferOpts.edgeExclusion>F.radius&&Y.push({code:"edge-exclusion-exceeds-radius",message:`edgeExclusion (${e.waferOpts.edgeExclusion}mm) exceeds the resolved wafer radius (${F.radius}mm) \u2014 the entire wafer is excluded.`,severity:"warning"})),$=$.map(z);const j=ge(e.reticleOpts,F,$,m,c,D,g,T,L,F.orientation,b,k),P=l.map((s,x)=>z(q({id:`unpositioned_${x}`,width:m,height:c},s))),I=[...$,...P];return{wafer:F,dies:I,dataAxisFlip:{x:b,y:k},reticleConfig:e.reticleOpts,units:w,inference:r,warnings:[...e.removedFieldWarning?[e.removedFieldWarning]:[],...e.inputValueWarnings,...o?[o]:[],...we(p,r),...Y,...t,...e.ringCountWarning?[e.ringCountWarning]:[]],plotMode:be(d),metadata:F.metadata??null,isLotStack:e.lotStackOpts!==void 0,dataCoverage:computeCoverage(I),passBins:e.passBins,...i?{valueFilter:i}:{},ringCount:e.ringCount,yield:computeYield(I,e.passBins,e.edgeDieYieldMode,it(e.lotStackOpts!==void 0,e.lotStackOpts?.method)),reticles:j,hbinDefs:e.hbinDefs,sbinDefs:e.sbinDefs,testDefs:e.testDefs,metadataFields:e.metadataFields,aggrMethod:e.lotStackOpts?.method,lotSize:e.lotStackOpts?.results.length}}
|
|
1
|
+
import{createWafer as Q}from"../core/wafer.js";import{isYieldEligibleDie as ve,getDieKey as X,hasPosition as I,positionKey as Se}from"../core/dies.js";import{applyOrientation as se,transformDies as Ce,clipDiesToWafer as ke}from"../core/transforms.js";import{generateDies as Oe}from"../core/dies.js";import{dieHasAnyTestData as Ae,dieLink as U,finaliseDie as z,linkDie as $e,recordedVerdict as Ne,recordedVerdictsReader as Re,tableFromRows as Ee,testValue as Z,testsPresent as Te,VERDICT_FAIL as Fe,VERDICT_NONE as Ie,VERDICT_PASS as We}from"../core/dieTable.js";import{isDieColumns as _e,linkColumns as Pe,linkRows as re,relink as oe}from"./columnarInput.js";import{affineRotation as Be,affineMirror as Ve,affineCompose as Le,affinePoint as Ye}from"../core/transforms.js";import{inferWaferFromXY as Xe}from"../core/inference/wafer.js";import{resolveGridPitch as Ke}from"../core/inference/pitch.js";import{assignGridIndices as je}from"../core/inference/grid.js";import{generateReticleGrid as He}from"../core/reticle.js";import{applyDerivedTests as Ue}from"./derivedTests/apply.js";import{isStdfBin as ze,isStdfCoord as ae,isStdfTestNumber as de,isStdfSite as Ge,STDF_BIN_MAX as qe,STDF_COORD_MAX as fe,STDF_TEST_NUM_MAX as Je,STDF_SITE_MAX as Qe}from"../core/stdf.js";import{hasAnyKey as Ze,maxOf as ee,minOf as le,modeOf as et}from"../core/utils.js";import{aggregateValues as ue,aggregateBinCounts as tt,stackHoldsMeasurements as nt,stackBinsAreData as it}from"../core/aggregates.js";import{normalizePassBins as ce}from"../core/passBins.js";import{defaultRingCount as te}from"../core/ringCount.js";import{applyValueFilter as st,mergeValueFilterTests as rt,valueFilterWarning as ot}from"./valueFilter.js";export function isParametricTest(n){return n?.testType!=="F"}export function isBuiltMap(n){return"wafer"in n&&"dies"in n&&"dataAxisFlip"in n}function at(n){const e=(i,a)=>({ringCount:i,ringCountWarning:{code:"analysis-option-corrected",severity:"warning",message:`ringCount=${String(n)} ${a} (using ${i}).`}});if(n===void 0)return{ringCount:te(),ringCountWarning:void 0};if(typeof n!="number"||!Number.isFinite(n))return e(te(),"is not a finite number");const t=Math.max(1,Math.round(n));return t===n?{ringCount:n,ringCountWarning:void 0}:e(t,"is not a whole number of at least 1")}function dt(n,e){const t=Array.isArray(n)?{}:n,i={hbin:0,sbin:0,siteNum:0,testValues:0,testPass:0};let a;const d=(u,C)=>{i[u]++,a??=`${u} ${JSON.stringify(C)}`},o={bins:0,positions:0,values:0,sites:0,orientation:0},r=new Set;let p=0;if(e){i.testValues+=e.wrongValues,i.testPass+=e.wrongVerdicts,e.example!==void 0&&(a??=e.example),o.values+=e.nonFinite;for(const u of e.badTestNumbers)r.add(u)}const h=u=>u==null?!0:typeof u!="number"?!1:Number.isNaN(u)?(p++,!1):ze(u)?!0:(o.bins++,!1);function l(u){const C=new Set,D=new Set;for(let S=0;S<u.length;S+=S<50?1:100){const N=u[S];if(!(N===null||typeof N!="object")){if(N.testValues&&typeof N.testValues=="object")for(const M of Object.keys(N.testValues))C.add(M);if(N.testPass&&typeof N.testPass=="object")for(const M of Object.keys(N.testPass))D.add(M)}}const g=[...C],b=[...D],k=S=>de(Number(S));for(const S of new Set([...g,...b]))k(S)||r.add(S);const R=g.map(k),v=b.map(k),F=g.map(Number),L=b.map(Number);let K;for(let S=0;S<u.length;S++){const N=u[S];if(N===null||typeof N!="object")continue;const M=N;let E;const $=()=>E??={...M};M.hbin!=null&&typeof M.hbin!="number"&&d("hbin",M.hbin),M.sbin!=null&&typeof M.sbin!="number"&&d("sbin",M.sbin),h(M.hbin)||($().hbin=void 0),h(M.sbin)||($().sbin=void 0);const Y=typeof M.x=="number"&&!ae(M.x),j=typeof M.y=="number"&&!ae(M.y);if(Y||j){o.positions+=(Y?1:0)+(j?1:0);const s=$();s.x=void 0,s.y=void 0}M.siteNum!=null&&typeof M.siteNum!="number"?(d("siteNum",M.siteNum),$().siteNum=void 0):typeof M.siteNum=="number"&&!Ge(M.siteNum)&&(o.sites++,$().siteNum=void 0);const P=M.testValues;if(P&&typeof P=="object"){let s;for(let x=0;x<g.length;x++){const A=g[x],O=P[F[x]];if(O!=null){if(!R[x]){s??={...P},delete s[A];continue}typeof O!="number"?(d("testValues",O),s??={...P},delete s[A]):Number.isFinite(O)||(o.values++,s??={...P},delete s[A])}}s&&($().testValues=s)}const W=M.testPass;if(W&&typeof W=="object"){let s;for(let x=0;x<b.length;x++){const A=b[x],O=W[L[x]];if(O!=null){if(!v[x]){s??={...W},delete s[A];continue}typeof O!="boolean"&&(d("testPass",O),s??={...W},delete s[A])}}s&&($().testPass=s)}E&&((K??=u.slice())[S]=E)}return K}const f={warnings:[]};if(Array.isArray(n))f.results=l(n);else{Array.isArray(t.results)&&(f.results=l(t.results)),Array.isArray(t.dies)&&(f.dies=l(t.dies));const u=t.lotStack?.results;if(Array.isArray(u)){const C=u.map(D=>Array.isArray(D)?l(D):void 0);C.some(Boolean)&&(f.stackResults=C.map((D,g)=>D??u[g]))}}if(Array.isArray(t.testDefs)){const u=t.testDefs,C=u.filter(D=>D==null||typeof D.testNumber!="number"||de(D.testNumber));for(const D of u)C.includes(D)||r.add(String(D.testNumber));C.length!==u.length&&(f.testDefs=C)}const y=t.waferConfig?.orientation;if(typeof y=="number"){const u=Number.isFinite(y)?(y%360+360)%360:NaN;u===0||u===90||u===180||u===270?f.orientation=u:(o.orientation++,f.orientation=0)}const m=(u,C,D=`${C}s`)=>`${u} ${u===1?C:D}`,c=[];if(i.hbin&&c.push(m(i.hbin,"hard bin")),i.sbin&&c.push(m(i.sbin,"soft bin")),i.siteNum&&c.push(m(i.siteNum,"site number")),i.testValues&&c.push(m(i.testValues,"test value")),i.testPass&&c.push(m(i.testPass,"pass/fail verdict")),c.length){const u=`buildWaferMap received ${c.join(", ")} of the wrong type (for example ${a}), treated as missing. Bins, sites and test values must be numbers and verdicts true/false \u2014 a bin of "1" is not pass bin 1 \u2014 so those dies have no bin, no site, no value or no verdict, and yield and every chart leave them out. Convert them with Number() (and verdicts to booleans) and rebuild.`;console.warn(`[wafermap] ${u}`),f.warnings.push({code:"input-values-not-numbers",message:u,severity:"error"})}const w=[];if(o.bins&&w.push(`${m(o.bins,"bin")} (legal: whole numbers 0\u2013${qe}) \u2014 those dies have no bin`),o.positions&&w.push(`${m(o.positions,"coordinate")} (legal: whole numbers \u2212${fe} to ${fe}) \u2014 those dies have no position`),r.size&&w.push(`${m(r.size,"test number")} (legal: whole numbers 0\u2013${Je}) \u2014 those tests are left out`),o.values&&w.push(`${m(o.values,"test value")} that ${o.values===1?"is":"are"} not finite \u2014 left out`),o.sites&&w.push(`${m(o.sites,"site number")} (legal: 0\u2013${Qe}) \u2014 those dies have no site`),o.orientation&&w.push("a waferConfig.orientation other than 0, 90, 180 or 270 \u2014 the map is built at 0"),w.length||p){const u=[];w.length&&u.push(`buildWaferMap received values outside the STDF V4 ranges, treated as missing: ${w.join("; ")}.`),p&&u.push(`${m(p,"bin was","bins were")} NaN and ${p===1?"is":"are"} treated as no bin.`);const C=u.join(" ");console.warn(`[wafermap] ${C}`),f.warnings.push({code:"input-values-outside-stdf",message:C,severity:"warning"})}return f}function pe(n){const e=(h,l)=>h!==null&&typeof h=="object"&&h[l]!==void 0,t=Array.isArray(n)?{}:n,i=[],a=(h,l,f)=>{h&&i.push(`\`${l}\` (now \`${f}\`)`)};a(e(t,"data"),"data","results"),a(e(t,"die"),"die","dieConfig"),a(e(t,"stack"),"stack","lotStack"),a(e(t.dieConfig,"origin"),"dieConfig.origin","dieConfig.coordinateOrigin"),a(e(t.waferConfig,"flat"),"waferConfig.flat","waferConfig.notch"),a(e(t.reticleConfig,"anchor"),"reticleConfig.anchor","reticleConfig.anchorDie"),a(e(t.lotStack,"aggr"),"lotStack.aggr","lotStack.method"),a(Array.isArray(t.testDefs)&&t.testDefs.some(h=>e(h,"index")&&!e(h,"testNumber")),"TestDef.index","TestDef.testNumber");const d=e(t.lotStack,"results")?t.lotStack.results:[],o=(Array.isArray(n)?[n]:[t.results,...Array.isArray(d)?d:[]]).filter(h=>Array.isArray(h));if(a(o.some(h=>h.slice(0,100).some(l=>e(l,"values"))),"values","testValues"),!i.length)return;const r=i.length>1,p=`buildWaferMap ignored ${i.join(", ")}: ${r?"these names were":"that name was"} removed in an earlier release, so what ${r?"they":"it"} described is not on this map. Rename and rebuild.`;return console.warn(`[wafermap] ${p}`),{code:"input-field-removed",message:p,severity:"error"}}function ft(n){if(n.results!==void 0||n.lotStack!==void 0)throw new Error("buildWaferMap: pass `layout`, `results` or `lotStack` \u2014 only one.");const e=n.waferConfig?.diameter,t=n.dieConfig?.width,i=n.dieConfig?.height;if(!(e>0&&t>0&&i>0))throw new Error("buildWaferMap: `layout` needs waferConfig.diameter and dieConfig.width and height, all positive.");const a=Q({diameter:e,notch:n.waferConfig?.notch,orientation:0}),d=ke(Oe(a,{width:t,height:i}),a,{width:t,height:i}).filter(l=>!l.partial),{flipX:o,flipY:r}=me(n.dieConfig,{type:"center"}),{layout:p,...h}=n;return{...h,results:d.map(l=>({x:o?-l.x:l.x,y:r?-l.y:l.y})),waferConfig:{...n.waferConfig,center:{x:0,y:0}},dieConfig:{...n.dieConfig,coordinateOrigin:{type:"center"}}}}function lt(n){if(!Array.isArray(n)&&"results"in n&&n.results!==void 0&&"lotStack"in n&&n.lotStack!==void 0)throw new Error("buildWaferMap: pass either `results` or `lotStack`, not both.");const e={wrongVerdicts:0,wrongValues:0,nonFinite:0,badTestNumbers:[]},t=!Array.isArray(n)&&_e(n.results)?{...n,results:Pe(n.results,e).records}:n,i=dt(t,e);return Array.isArray(t)?{results:ne(i.results??t),waferOpts:void 0,dieOpts:void 0,explicitDies:void 0,reticleOpts:void 0,lotStackOpts:void 0,passBins:ce(void 0),ringCount:te(),valueFilter:"validity",ringCountWarning:void 0,removedFieldWarning:pe(t),inputValueWarnings:i.warnings,standardDiameters:void 0,testDefs:void 0,hbinDefs:void 0,sbinDefs:void 0,metadataFields:void 0,derivedTests:void 0,retestPolicy:"last",edgeDieYieldMode:"exclude"}:{results:ne(i.results??t.results??[]),waferOpts:i.orientation===void 0||t.waferConfig===void 0?t.waferConfig:{...t.waferConfig,orientation:i.orientation},dieOpts:t.dieConfig,explicitDies:i.dies??t.dies,reticleOpts:t.reticleConfig,lotStackOpts:t.lotStack?{...t.lotStack,results:(i.stackResults??t.lotStack.results).map(ne)}:void 0,passBins:ce(t.passBins),valueFilter:t.valueFilter??"validity",...at(t.ringCount),removedFieldWarning:pe(t),inputValueWarnings:i.warnings,standardDiameters:t.standardDiameters,testDefs:(i.testDefs??t.testDefs)?.length?i.testDefs??t.testDefs:void 0,hbinDefs:t.hbinDefs,sbinDefs:t.sbinDefs,metadataFields:t.metadataFields,derivedTests:t.derivedTests?.length?t.derivedTests:void 0,retestPolicy:t.retestPolicy??"last",edgeDieYieldMode:t.edgeDieYieldMode??"exclude"}}function ne(n){return n.length>0&&U(n[0])!==void 0?n:re(n).records}function ut(n,e){return e?.coordinateOrigin?e.coordinateOrigin:{type:"center"}}function ct(n,e,t){if(e.type==="custom"&&e.offset)return{offsetX:e.offset.x,offsetY:e.offset.y};if(e.type!=="center"){let i=1/0,a=-1/0,d=1/0,o=-1/0;for(const r of n)r.x<i&&(i=r.x),r.x>a&&(a=r.x),r.y<d&&(d=r.y),r.y>o&&(o=r.y);return{offsetX:Math.round((a+i)/2),offsetY:Math.round((o+d)/2)}}return{offsetX:t.offsetX,offsetY:t.offsetY}}function pt(n,e){if(n.length<xe)return!1;const t=he(n),i=(a,d,o)=>{const r=o-d+1;return a<d-r||a>o+r};return i(Math.round(e.x),t.xMin,t.xMax)||i(Math.round(e.y),t.yMin,t.yMax)}function he(n){let e=1/0,t=-1/0,i=1/0,a=-1/0;for(const d of n){const o=Math.round(d.x),r=Math.round(d.y);o<e&&(e=o),o>t&&(t=o),r<i&&(i=r),r>a&&(a=r)}return{xMin:e,xMax:t,yMin:i,yMax:a}}const ht="The supplied wafer centre";function mt(n,e){const t=he(n);return`${ht} (${e.x}, ${e.y}) is far outside the tested dies (X ${t.xMin}\u2026${t.xMax}, Y ${t.yMin}\u2026${t.yMax}), so it was ignored and the centre was worked out from the dies. Used as given, it would draw a wafer many times the size of the dies, with all of them in one corner.`}const gt="If the supplied centre is correct, also supply waferConfig.diameter.";function yt(n,e,t,i,a,d){if(d)return{colMidX:(Math.round(d.x)-e)*i,colMidY:(Math.round(d.y)-t)*a,anchored:!0};if(n.length===0)return{colMidX:0,colMidY:0,anchored:!1};let o=1/0,r=-1/0,p=1/0,h=-1/0;for(const l of n){const f=Math.round(l.x)-e,y=Math.round(l.y)-t;f<o&&(o=f),f>r&&(r=f),y<p&&(p=y),y>h&&(h=y)}return{colMidX:(o+r)/2*i,colMidY:(p+h)/2*a,anchored:!1}}function bt(n,e,t){let i=1/0,a=-1/0,d=1/0,o=-1/0,r=0,p=0;for(const f of n){const y=Math.round(f.x)-e,m=Math.round(f.y)-t;r+=y,p+=m,y<i&&(i=y),y>a&&(a=y),m<d&&(d=m),m>o&&(o=m)}const h=n.length,l=(f,y,m)=>{const c=(m-y)/2;return c<=0?0:Math.abs(f/h-(y+m)/2)/c};return l(r,i,a)>.11||l(p,d,o)>.11}function me(n,e){let t=n?.xAxisDirection==="left",i=n?.yAxisDirection==="down";return(e.type==="UL"||e.type==="UR")&&(i=!0),(e.type==="LR"||e.type==="UR")&&(t=!0),{flipX:t,flipY:i}}function wt(n){const e={...n};return delete e.limitLow,delete e.limitHigh,delete e.limitLowInclusive,delete e.limitHighInclusive,delete e.specLow,delete e.specHigh,e}function xt(n,e){const{method:t,targetBin:i}=n,a=n.results.map(d=>d.filter(I));if(t==="mean"||t==="median"||t==="stddev"||t==="min"||t==="max"||t==="count"){const d=new Set((e??[]).filter(l=>!isParametricTest(l)).map(l=>l.testNumber)),o=new Set;for(const l of a)for(const f of Te(l,"values"))d.has(f)||o.add(f);if(o.size===0)return ue(a,t);const r=[...o],p=r.map(l=>ue(a,t,l)),h=new Map;for(let l=0;l<r.length;l++){const f=r[l];for(const y of p[l]){const m=X(y);h.has(m)||h.set(m,{template:y,testValues:{}});const c=h.get(m),w=y.testValues?.[0];w!==void 0&&(c.testValues[f]=w)}}return[...h.values()].map(({template:l,testValues:f})=>({...l,testValues:Ze(f)?f:void 0}))}if(t==="countBin"||t==="percent"){if(i===void 0)return[];const d=tt(a,i,"hard");if(t==="countBin")return d;const o=a.length;return d.map(r=>({...r,testValues:{0:o>0?(r.testValues?.[0]??0)/o*100:0}}))}if(t==="mode"){const d=new Map;for(const r of a)for(const p of r){const h=X(p);d.has(h)||d.set(h,[]),d.get(h).push(p)}const o=[];for(const[r,p]of d){const h=r.split(","),l=Number(h[0]),f=Number(h[1]),y=p.map(c=>c.hbin).filter(c=>c!==void 0),m=et(y);m!==null&&o.push({x:l,y:f,hbin:m})}return o}return[]}export function computeCoverage(n){const e=n.filter(I),t=e.length,i=e.filter(d=>d.edgeExcluded).length,a=e.filter(d=>d.hbin!==void 0||d.sbin!==void 0||dieHasTestData(d)).length;return{filledDies:a,totalDies:t,edgeExcludedDies:i,unpositionedDies:n.length-e.length,ratio:t>0?a/t:0}}export function computeYield(n,e,t="exclude",i=!0){const a=new Set(e),o=n.filter(c=>!c.partial).filter(c=>c.edgeExcluded&&!c.filteredOut).length,r=n.filter(c=>c.partial).length;if(!i)return{passDies:0,failDies:0,edgeExcludedDies:o,partialDies:r,totalDies:0,yieldPercent:null,yieldPercentGross:null};let p=0,h=0,l=!1;for(const c of n){if(!ve(c))continue;const w=c.hbin??c.sbin;w!==void 0&&(l=!0,a.has(w)?p++:h++)}const f=p+h,y=l&&f>0?p/f*100:null;let m=null;if(t==="denominator-only"){const c=f+o;m=l&&c>0?p/c*100:null}return{passDies:p,failDies:h,edgeExcludedDies:o,partialDies:r,totalDies:f,yieldPercent:y,yieldPercentGross:m}}function ge(n,e,t,i,a,d=0,o=0,r=0,p=0,h=0,l=!1,f=!1){if(!n)return[];const y=n.anchorDie??{x:0,y:0},m=He(e,{width:n.width,height:n.height,diePitchX:i,diePitchY:a,anchorDie:{x:y.x-d,y:y.y-o},gridOrigin:{x:-r,y:-p}}),c=Le(Ve(l,f,e.center.x,e.center.y),Be(h,e.center.x,e.center.y));return m.filter(w=>{const u=w.width/2,C=w.height/2,D=[[w.x-u,w.y-C],[w.x+u,w.y-C],[w.x+u,w.y+C],[w.x-u,w.y+C]].map(([v,F])=>Ye(c,v,F)),g=le(D.map(v=>v.x)),b=ee(D.map(v=>v.x)),k=le(D.map(v=>v.y)),R=ee(D.map(v=>v.y));return t.some(v=>v.physX>=g&&v.physX<b&&v.physY>=k&&v.physY<R)})}function Dt(n,e,t){const a=Math.max(0,e.radius-t)**2;return n.map(d=>{const o=d.physX-e.center.x,r=d.physY-e.center.y;return o*o+r*r>a?{...d,edgeExcluded:!0}:d})}const Mt=.2;function vt(n){const e=new Set;for(const t of n){if(t.supersedes!==void 0||!I(t))return!1;const i=Se(t);if(e.has(i))return!1;e.add(i)}return!0}function St(n,e,t){if(vt(n))return{results:n.slice(),warning:void 0};const i=new Set(t);function a(g,b){if(e==="last")return!0;if(e==="first")return!1;const k=G(g.hbin),R=G(b.hbin);if(k===void 0||R===void 0)return!1;const v=i.has(k),F=i.has(R);return e==="best"?F!==v?F:R<k:F!==v?v:R>k}const d=(g,b)=>b.supersedes!==void 0||a(g,b),o=g=>{const b=g.partId===void 0?"":String(g.partId).trim();return b===""?void 0:b},r=n.filter(g=>!I(g)),p=new Map;for(const g of r){const b=o(g);b!==void 0&&p.set(b,(p.get(b)??0)+1)}const l=(r.length===0?0:Math.max(0,...p.values())/r.length)<=Mt,f=new Map,y=[],m=new Map;let c=0,w=0;for(const g of n){const b=o(g);let k;if(I(g)?k=`p:${X(g)}`:l&&b!==void 0?k=`i:${b}`:k=`u:${w++}`,g.supersedes==="partId"&&b!==void 0){const v=m.get(b);v!==void 0&&v!==k&&f.has(v)&&f.delete(v)}const R=f.get(k);R===void 0?(f.set(k,{winner:g,count:1}),y.push(k)):(R.count++,k.startsWith("i:")&&c++,d(R.winner,g)&&(R.winner=g)),b!==void 0&&m.set(b,k)}const u=[],C=[...y.filter(g=>g.startsWith("p:")),...y.filter(g=>!g.startsWith("p:"))];for(const g of C){const b=f.get(g);b!==void 0&&u.push(b.count>1?{...b.winner,retestCount:b.count}:b.winner)}const D=c>0?{code:"retests-by-part-id",severity:"info",message:`${c} record${c===1?"":"s"} with no position shared a part ID with an earlier record and ${c===1?"was":"were"} treated as a retest of it.`}:void 0;return{results:u,warning:D}}export function getDieTestValue(n,e){return Z(n,e)}export function getTestPassStatus(n,e,t){const i=Ne(n,e);return i!==void 0?i:t!==void 0&&!isParametricTest(t)?ye(Z(n,e)):void 0}function ye(n){return n===0||n===1?n===1:void 0}export function testPassStatusReader(n){const e=n.map(a=>a.testNumber),t=Re(e),i=n.map(a=>!isParametricTest(a));return function(d,o){t(d,o);for(let r=0;r<o.length;r++){if(o[r]!==Ie||!i[r])continue;const p=ye(Z(d,e[r]));p!==void 0&&(o[r]=p?We:Fe)}return o}}export function dieHasTestData(n){return Ae(n)}function G(n){return n===void 0||Number.isNaN(n)?void 0:n}function q(n,e){const t={},i=G(e.hbin),a=G(e.sbin);i!==void 0&&(t.hbin=i),a!==void 0&&(t.sbin=a),e.retestCount!==void 0&&(t.retestCount=e.retestCount),e.siteNum!==void 0&&(t.siteNum=e.siteNum),e.partId!==void 0&&(t.partId=e.partId),e.metadata!==void 0&&(t.metadata=e.metadata);const d=U(e);return $e({...n,...t},d.table,d.row)}function be(n){return n.some(dieHasTestData)?"value":defaultBinMode([n])}export function defaultBinMode(n){const e=t=>n.some(i=>i.some(a=>t(a)!=null));return e(t=>t.hbin)?"hardBin":e(t=>t.sbin)?"softBin":"hardBin"}function we(n,e){return n.map(({code:t,message:i})=>({code:t,message:i,severity:t==="non-standard-diameter"||t==="diameter-exceeds-die-extent"||t==="implausible-center"?"warning":"error",confidence:e.wafer.confidence}))}const Ct="do not fit inside the supplied",kt="Inferred wafer diameter",Ot="The probed dies reach only",At=.75,xe=20;export const STANDARD_WAFER_DIAMETERS_MM=[100,125,150,200,300];const $t=.02;function De(n,e){return e.reduce((t,i)=>Math.abs(i-n)<Math.abs(t-n)?i:t)}function Nt(n,e){if(!e.length)return!0;const t=De(n,e);return Math.abs(t-n)/t<=$t}function Rt(n){return n===void 0?STANDARD_WAFER_DIAMETERS_MM:n.filter(e=>Number.isFinite(e)&&e>0)}export function buildWaferMap(n){const e=lt(!Array.isArray(n)&&n.layout?ft(n):n),t=[];let i;if(e.valueFilter!=="none"&&e.testDefs){const s=e.valueFilter,x=(e.lotStackOpts?e.lotStackOpts.results:[e.results]).map(O=>{const _=O.length>0?U(O[0]):void 0;if(!_)return[];const T=st(_.table,e.testDefs,s);return T.tests.length>0&&oe(O,T.table),T.tests}),A=rt(x);if(A.length>0){i={mode:s,tests:A};const O=ot(s,A,e.testDefs);O&&t.push(O)}}if(e.derivedTests){const s=new Set(e.passBins),x=_=>{const T=_.length>0?U(_[0]):void 0,H=Ue(_,T?.table??Ee([]),e.testDefs,e.derivedTests,s);return T&&oe(_,H.table),H},O=(e.lotStackOpts?e.lotStackOpts.results:[e.results]).map(x);e.testDefs=O[0]?.testDefs??e.testDefs,t.push(...O[0]?.warnings??[])}e.lotStackOpts&&!nt(e.lotStackOpts.method)&&(e.testDefs=e.testDefs?.map(wt));const a=e.lotStackOpts?re(xt(e.lotStackOpts,e.testDefs)).records:e.results;for(let s=0;s<Math.min(5,a.length);s++){const x=a[s];if(typeof x.x=="string"||typeof x.y=="string")throw new TypeError("buildWaferMap: x and y must be numbers, received strings. Did you forget to cast CSV values? e.g. { x: +row.x, y: +row.y }")}for(const s of a)if(s.x==null!=(s.y==null))throw new TypeError(`buildWaferMap: die has only one of x/y set (x=${String(s.x)}, y=${String(s.y)}). A die must be either fully positioned (both x and y) or fully unpositioned (neither) \u2014 omit both to mark a die as having no reported position.`);const{results:d,warning:o}=St(a,e.retestPolicy,e.passBins),r={wafer:{confidence:1,method:"provided"},diePitch:{confidence:1,units:"mm"},grid:{confidence:1}},p=[];if(e.explicitDies){let s=e.explicitDies.filter(I);const x=e.explicitDies.filter(V=>!I(V)),A=d.filter(I),O=d.filter(V=>!I(V));if(A.length>0){const V=new Map(A.map(B=>[X(B),B]));s=s.map(B=>{const ie=V.get(X(B));return ie?q(B,ie):B})}const _=e.waferOpts?.diameter??300,T=Q({diameter:_,notch:e.waferOpts?.notch,orientation:e.waferOpts?.orientation??0,metadata:e.waferOpts?.metadata,reticle:e.reticleOpts});T.orientation!==0&&(s=se(s,T)),s=s.map(z);const H=ge(e.reticleOpts,T,s,s[0]?.width??1,s[0]?.height??1,0,0,0,0,T.orientation),Me=O.map((V,B)=>z(q({id:`unpositioned_${B}`,width:s[0]?.width??1,height:s[0]?.height??1},V))),J=[...s,...x,...Me];return{wafer:T,dies:J,dataAxisFlip:{x:!1,y:!1},reticleConfig:e.reticleOpts,units:"mm",inference:r,warnings:[...e.removedFieldWarning?[e.removedFieldWarning]:[],...e.inputValueWarnings,...o?[o]:[],...we(p,r),...t,...e.ringCountWarning?[e.ringCountWarning]:[]],plotMode:be(d),metadata:T.metadata??null,isLotStack:!1,dataCoverage:computeCoverage(J),passBins:e.passBins,...i?{valueFilter:i}:{},ringCount:e.ringCount,yield:computeYield(J,e.passBins,e.edgeDieYieldMode),reticles:H,hbinDefs:e.hbinDefs,sbinDefs:e.sbinDefs,testDefs:e.testDefs,metadataFields:e.metadataFields}}const h=d.filter(I),l=d.filter(s=>!I(s)),f=h.map(s=>({x:s.x,y:s.y})),y=Ke(f,e.dieOpts,e.waferOpts?.diameter);r.diePitch={confidence:y.confidence,units:y.units};const{pitchX:m,pitchY:c}=y,w=y.units,u=ut(h,e.dieOpts),C=je(f);r.grid={confidence:C.confidence};const{offsetX:D,offsetY:g}=ct(f,u,C),{flipX:b,flipY:k}=me(e.dieOpts,u),R=e.waferOpts?.diameter===void 0&&e.waferOpts?.center!==void 0&&pt(f,e.waferOpts.center),v=R?void 0:e.waferOpts?.center;if(R){const s=mt(f,e.waferOpts.center);console.warn(`[wafermap] ${s} ${gt}`),p.push({code:"implausible-center",message:s})}const{colMidX:F,colMidY:L,anchored:K}=yt(f,D,g,m,c,v);let S=e.waferOpts?.diameter;const N=f.map(s=>({x:(Math.round(s.x)-D)*m-F,y:(Math.round(s.y)-g)*c-L})),M=ee(N.map(({x:s,y:x})=>Math.hypot(Math.abs(s)+m/2,Math.abs(x)+c/2)));if(S===void 0)if(f.length>0)if(w==="mm"){const s=Xe(N,{minRadius:M});S=s.diameter,r.wafer={confidence:s.confidence,method:s.method};const x=Rt(e.standardDiameters);if(!Nt(S,x)){const A=De(S,x);p.push({code:"non-standard-diameter",message:`${kt} ${S.toFixed(1)} mm is not a standard wafer size (nearest is ${A} mm). The diameter was derived from the die extent, which assumes the probed grid reaches the wafer edge \u2014 a non-standard result usually means it does not, because the outer dies were never probed. Every die is then placed against a wafer that is too small, which moves dies between rings and changes ring and edge findings. Supply waferConfig.diameter.`})}}else S=M*2,r.wafer={confidence:y.confidence*.8,method:"extent"};else S=w==="mm"?300:30,r.wafer={confidence:0,method:"default"};if(!K&&f.length>0&&bt(f,D,g)&&(r.wafer.method="inferred-partial",p.push({code:"partial-coverage",message:"Wafer geometry was inferred from die positions alone. The data does not span a full symmetric wafer, so the inferred diameter and centre may be wrong and dies may be mis-positioned relative to the true wafer boundary. Supply waferConfig.diameter and waferConfig.center (the prober coordinate of the wafer centre) to position partial data correctly."})),e.waferOpts?.diameter!==void 0&&v===void 0&&M>0&&f.length>=xe){const s=M/(S/2);s<At&&p.push({code:"diameter-exceeds-die-extent",message:`${Ot} ${(s*100).toFixed(0)}% of the ${S} mm wafer's radius. Either the diameter is larger than the real one, or this is a partial map covering only part of the wafer. Ring bands are equal-radius, so the outer rings are mostly or entirely empty and ring, quadrant and edge findings describe the assumed wafer rather than the probed area. Check waferConfig.diameter, or drop it and let the diameter be inferred from the die extent.`})}if(e.waferOpts?.diameter!==void 0){const s=e.dieOpts?.width!==void 0&&e.dieOpts?.height!==void 0;if(s&&M>S/2+1e-9){const x=N.filter(({x:A,y:O})=>Math.hypot(Math.abs(A)+m/2,Math.abs(O)+c/2)>S/2+1e-9).length;p.push({code:"geometry-conflict",message:`${x} of ${N.length} probed die positions ${Ct} ${S} mm wafer at the supplied die pitch of ${m} \xD7 ${c} mm. A die with test results is a real prober position and is always fully on the wafer, so one of the two supplied values must be wrong: containing these dies at this pitch would need a diameter of at least ${(M*2).toFixed(1)} mm. Check waferConfig.diameter and dieConfig.width/height against the real device.`})}}const E=Q({diameter:S,units:w,notch:e.waferOpts?.notch,orientation:e.waferOpts?.orientation??0,metadata:e.waferOpts?.metadata,reticle:e.reticleOpts});let $=h.map(s=>{const x=Math.round(s.x)-D,A=Math.round(s.y)-g,O={id:`${x}_${A}`,x,y:A,physX:x*m-F,physY:A*c-L,width:m,height:c,insideWafer:!0,partial:!1};return q(O,s)});(D!==0||g!==0)&&($=$.map(s=>({...s,x:s.x+D,y:s.y+g,id:`${s.x+D}_${s.y+g}`}))),$=se($,E),(b||k)&&($=Ce($,{flipX:b,flipY:k},E.center));const Y=[];e.waferOpts?.edgeExclusion&&e.waferOpts.edgeExclusion>0&&($=Dt($,E,e.waferOpts.edgeExclusion),e.waferOpts.edgeExclusion>E.radius&&Y.push({code:"edge-exclusion-exceeds-radius",message:`edgeExclusion (${e.waferOpts.edgeExclusion}mm) exceeds the resolved wafer radius (${E.radius}mm) \u2014 the entire wafer is excluded.`,severity:"warning"})),$=$.map(z);const j=ge(e.reticleOpts,E,$,m,c,D,g,F,L,E.orientation,b,k),P=l.map((s,x)=>z(q({id:`unpositioned_${x}`,width:m,height:c},s))),W=[...$,...P];return{wafer:E,dies:W,dataAxisFlip:{x:b,y:k},reticleConfig:e.reticleOpts,units:w,inference:r,warnings:[...e.removedFieldWarning?[e.removedFieldWarning]:[],...e.inputValueWarnings,...o?[o]:[],...we(p,r),...Y,...t,...e.ringCountWarning?[e.ringCountWarning]:[]],plotMode:be(d),metadata:E.metadata??null,isLotStack:e.lotStackOpts!==void 0,dataCoverage:computeCoverage(W),passBins:e.passBins,...i?{valueFilter:i}:{},ringCount:e.ringCount,yield:computeYield(W,e.passBins,e.edgeDieYieldMode,it(e.lotStackOpts!==void 0,e.lotStackOpts?.method)),reticles:j,hbinDefs:e.hbinDefs,sbinDefs:e.sbinDefs,testDefs:e.testDefs,metadataFields:e.metadataFields,aggrMethod:e.lotStackOpts?.method,lotSize:e.lotStackOpts?.results.length}}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* with no further change.
|
|
22
22
|
*/
|
|
23
23
|
import type { DieResult, TestDef, WaferWarning } from '../buildWaferMap.js';
|
|
24
|
+
import { type ExprNode } from './parser.js';
|
|
24
25
|
import type { DieTable } from '../../core/dieTable.js';
|
|
25
26
|
/**
|
|
26
27
|
* A test whose values are computed from other tests on the same die, rather than
|
|
@@ -77,6 +78,15 @@ export interface ApplyResult {
|
|
|
77
78
|
testDefs: TestDef[] | undefined;
|
|
78
79
|
warnings: WaferWarning[];
|
|
79
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Unit agreement across `+` and `-`. The library knows the units, so staying
|
|
83
|
+
* silent about a volts-minus-amps subtraction would be exactly the kind of
|
|
84
|
+
* unlabelled nonsense the design principles forbid. It is a warning rather than
|
|
85
|
+
* a rejection: unit strings are free text and a site may legitimately use
|
|
86
|
+
* `"uA"` and `"µA"` for the same thing, so refusing to build would be worse than
|
|
87
|
+
* saying so.
|
|
88
|
+
*/
|
|
89
|
+
export declare function unitMismatch(node: ExprNode, defs: Map<number, TestDef>): string[];
|
|
80
90
|
/**
|
|
81
91
|
* Apply `derivedTests` to a wafer's records: `records[i]` is row `i` of
|
|
82
92
|
* `table` (its bins give `diePass()`). Returns a copy of the table with a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isStdfTestNumber as D,STDF_TEST_NUM_MAX as T}from"../../core/stdf.js";import{diePassStatus as M}from"../../core/dies.js";import{getTestPassStatus as F,isParametricTest as V}from"../buildWaferMap.js";import{classifySpec as _}from"../spec.js";import{parseExpression as P}from"./parser.js";import{evaluate as A}from"./evaluate.js";import{extendTable as E,rowView as O,testValue as I,HAS_VALUES as k,HAS_VERDICTS as C,VERDICT_FAIL as L,VERDICT_NONE as S,VERDICT_PASS as R}from"../../core/dieTable.js";function l(w){return{code:"derived-test-invalid",message:w,severity:"warning"}}function
|
|
1
|
+
import{isStdfTestNumber as D,STDF_TEST_NUM_MAX as T}from"../../core/stdf.js";import{diePassStatus as M}from"../../core/dies.js";import{getTestPassStatus as F,isParametricTest as V}from"../buildWaferMap.js";import{classifySpec as _}from"../spec.js";import{parseExpression as P}from"./parser.js";import{evaluate as A}from"./evaluate.js";import{extendTable as E,rowView as O,testValue as I,HAS_VALUES as k,HAS_VERDICTS as C,VERDICT_FAIL as L,VERDICT_NONE as S,VERDICT_PASS as R}from"../../core/dieTable.js";function l(w){return{code:"derived-test-invalid",message:w,severity:"warning"}}export function unitMismatch(w,p){const m=[],n=r=>{switch(r.k){case"acc":{if(r.kind!=="t")return;const o=p.get(r.test)?.unit;return o?new Set([o]):void 0}case"unary":return r.op==="-"?n(r.arg):void 0;case"binary":{const o=n(r.left),a=n(r.right);if(r.op==="+"||r.op==="-"){if(o&&a){const d=new Set([...o,...a]);return d.size>1&&m.push(`${[...d].join(" and ")} are combined by "${r.op}"`),d}return o??a}return}case"call":{if(r.name==="min"||r.name==="max"||r.name==="mean"||r.name==="sum"){const o=r.args[0];if(o?.k==="vec"&&o.kind==="t"){const a=new Set(o.tests.map(d=>p.get(d)?.unit).filter(d=>!!d));return a.size>1&&m.push(`${[...a].join(" and ")} are combined by "${r.name}"`),a}}return}default:return}};return n(w),m}function j(w,p,m){const n=[],r=new Map((p??[]).map(e=>[e.testNumber,e])),o=e=>`${JSON.stringify(e.name??"")} (test ${e.testNumber})`,a=[],d=new Set;for(const e of w){const s=o(e);if(!D(e.testNumber)){n.push(l(`Derived test ${s} was dropped: \`testNumber\` must be a whole number from 0 to ${T}, as STDF stores it.`));continue}if(m.has(e.testNumber)||r.has(e.testNumber)){n.push(l(`Derived test ${s} was dropped: test number ${e.testNumber} already exists in the data. Measured values are never replaced by a derived test \u2014 give it an unused number.`));continue}if(d.has(e.testNumber)){n.push(l(`Derived test ${s} was dropped: test number ${e.testNumber} is used by an earlier derived test.`));continue}if(typeof e.expression!="string"||e.expression.trim()===""){n.push(l(`Derived test ${s} was dropped: \`expression\` is empty.`));continue}d.add(e.testNumber),a.push(e)}const g=new Map(r);for(const e of a){const{expression:s,constants:u,...c}=e;g.set(e.testNumber,{...c,testType:e.testType??"P"})}const h=new Map,f=new Set;for(const e of a){const s=o(e),u={testDefs:g,constants:e.constants??{}},c=P(e.expression,u);if(!c.ok){n.push(l(`Derived test ${s} was dropped: ${c.message}`)),f.add(e.testNumber);continue}const t=c.type==="boolean",i=!V(e);if(t!==i){n.push(l(t?`Derived test ${s} was dropped: its expression produces a true/false verdict, so it must declare \`testType: 'F'\`.`:`Derived test ${s} was dropped: it declares \`testType: 'F'\` but its expression produces a number. Functional tests carry a verdict, not a measurement.`)),f.add(e.testNumber);continue}if(t&&(e.limitLow!==void 0||e.limitHigh!==void 0)&&n.push(l(`Derived test ${s}: test limits are ignored on a true/false derived test.`)),e.testNumber===void 0)continue;const N=e.testNumber,x=[...new Set(c.reads.map(v=>v.test))].filter(v=>v!==N&&d.has(v));if(c.reads.some(v=>v.test===N)){n.push(l(`Derived test ${s} was dropped: its expression reads itself.`)),f.add(N);continue}for(const v of unitMismatch(c.ast,g))n.push(l(`Derived test ${s} combines different units \u2014 ${v}. The result is computed as written; set \`unit\` on the derived test to say what it is.`));h.set(N,{raw:e,compiled:{def:{...e,testType:t?"F":"P",derived:!0},ast:c.ast,boolean:t},deps:x})}const y=[],b=new Map,$=(e,s)=>{if(b.get(e)==="done")return!f.has(e);if(b.get(e)==="visiting"){const t=[...s.slice(s.indexOf(e)),e].join(" \u2192 ");for(const i of s.slice(s.indexOf(e)))f.has(i)||(f.add(i),n.push(l(`Derived test ${o(h.get(i).raw)} was dropped: its expression depends on itself through ${t}.`)));return!1}const u=h.get(e);if(u===void 0)return!1;b.set(e,"visiting");let c=!0;for(const t of u.deps)if(!$(t,[...s,e])){if(!f.has(e)){f.add(e);const i=h.get(t)?.raw.name??`test ${t}`;n.push(l(`Derived test ${o(u.raw)} was dropped: it reads ${JSON.stringify(i)} (test ${t}), which was itself dropped.`))}c=!1;break}return b.set(e,"done"),!c||f.has(e)?!1:(y.push(u.compiled),!0)};for(const e of a)$(e.testNumber,[]);return{compiled:y,warnings:n}}export function applyDerivedTests(w,p,m,n,r){if(n===void 0||n.length===0)return{table:p,testDefs:m,warnings:[]};const o=new Set;for(const[e,s]of p.values)s.some(u=>!Number.isNaN(u))&&o.add(e);for(const[e,s]of p.verdicts)s.some(u=>u!==S)&&o.add(e);const{compiled:a,warnings:d}=j(n,m,o);if(a.length===0)return{table:p,testDefs:m,warnings:d};const g=new Map((m??[]).map(e=>[e.testNumber,e]));for(const e of a)g.set(e.def.testNumber,e.def);const h=p.rows,f=new Map,y=new Map;for(const e of a)e.boolean?y.set(e.def.testNumber,new Int8Array(h).fill(S)):f.set(e.def.testNumber,new Float64Array(h).fill(NaN));const b=E(p,f,y),$=O(b);for(let e=0;e<h;e++){const s=$(e),u=t=>I(s,t),c={value:u,testPass:t=>F(s,t,g.get(t)),specPass:t=>{const i=_(u(t),g.get(t));return i===null?void 0:i==="pass"},diePass:()=>M(w[e],r),field:t=>{const i=w[e],N=t==="x"?i.x:t==="y"?i.y:t==="hbin"?i.hbin:t==="sbin"?i.sbin:i.siteNum;return typeof N=="number"&&Number.isFinite(N)?N:void 0}};for(const t of a){const i=A(t.ast,c);i!==void 0&&(t.boolean?(y.get(t.def.testNumber)[e]=i?R:L,b.fields[e]|=C):(f.get(t.def.testNumber)[e]=i,b.fields[e]|=k))}}return{table:b,testDefs:[...m??[],...a.map(e=>e.def)],warnings:d}}
|