218 lines
12 KiB
XML
218 lines
12 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!--
|
||
- StarForth — Steady-State Virtual Machine Runtime
|
||
-
|
||
- Copyright (c) 2023–2025 Robert A. James
|
||
- All rights reserved.
|
||
-
|
||
- This file is part of the StarForth project.
|
||
-
|
||
- Licensed under the StarForth License, Version 1.0 (the "License");
|
||
- you may not use this file except in compliance with the License.
|
||
-
|
||
- You may obtain a copy of the License at:
|
||
- https://github.com/star.4th@proton.me/StarForth/LICENSE.txt
|
||
-
|
||
- This software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
- express or implied, including but not limited to the warranties of
|
||
- merchantability, fitness for a particular purpose, and noninfringement.
|
||
-
|
||
- See the License for the specific language governing permissions and
|
||
- limitations under the License.
|
||
-
|
||
- StarForth — Steady-State Virtual Machine Runtime
|
||
- Copyright (c) 2023–2025 Robert A. James
|
||
- All rights reserved.
|
||
-
|
||
- This file is part of the StarForth project.
|
||
-
|
||
- Licensed under the StarForth License, Version 1.0 (the "License");
|
||
- you may not use this file except in compliance with the License.
|
||
-
|
||
- You may obtain a copy of the License at:
|
||
- https://github.com/star.4th@proton.me/StarForth/LICENSE.txt
|
||
-
|
||
- This software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
- express or implied, including but not limited to the warranties of
|
||
- merchantability, fitness for a particular purpose, and noninfringement.
|
||
-
|
||
- See the License for the specific language governing permissions and
|
||
- limitations under the License.
|
||
-
|
||
-->
|
||
|
||
<svg width="960" height="540" viewBox="0 0 960 540" xmlns="http://www.w3.org/2000/svg">
|
||
<!-- Title (outside boundary) -->
|
||
<text x="480" y="30" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="16" font-weight="bold" text-anchor="middle">
|
||
Figure 2: K Statistic vs Window Size (Resonance Pattern)
|
||
</text>
|
||
|
||
<!-- Main plot area -->
|
||
<g transform="translate(80, 70)">
|
||
<!-- Axes -->
|
||
<line x1="0" y1="400" x2="800" y2="400" stroke="black" stroke-width="1.25" />
|
||
<line x1="0" y1="0" x2="0" y2="400" stroke="black" stroke-width="1.25" />
|
||
|
||
<!-- X-axis label -->
|
||
<text x="400" y="450" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="14" text-anchor="middle">
|
||
Window Size (bytes, log₂ scale)
|
||
</text>
|
||
|
||
<!-- Y-axis label -->
|
||
<text x="-200" y="-35" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="14" text-anchor="middle" transform="rotate(-90)">
|
||
K Statistic
|
||
</text>
|
||
|
||
<!-- X-axis tick marks and labels (log2 scale: 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536) -->
|
||
<line x1="0" y1="400" x2="0" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="0" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">512</text>
|
||
|
||
<line x1="100" y1="400" x2="100" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="100" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">1K</text>
|
||
|
||
<line x1="200" y1="400" x2="200" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="200" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">2K</text>
|
||
|
||
<line x1="300" y1="400" x2="300" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="300" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">4K</text>
|
||
|
||
<line x1="400" y1="400" x2="400" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="400" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">8K</text>
|
||
|
||
<line x1="500" y1="400" x2="500" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="500" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">16K</text>
|
||
|
||
<line x1="600" y1="400" x2="600" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="600" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">32K</text>
|
||
|
||
<line x1="700" y1="400" x2="700" y2="410" stroke="black" stroke-width="1.25" />
|
||
<text x="700" y="430" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="middle">64K</text>
|
||
|
||
<!-- Y-axis tick marks and labels (0.0 to 0.5) -->
|
||
<line x1="-10" y1="400" x2="0" y2="400" stroke="black" stroke-width="1.25" />
|
||
<text x="-15" y="405" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="end">0.0</text>
|
||
|
||
<line x1="-10" y1="320" x2="0" y2="320" stroke="black" stroke-width="1.25" />
|
||
<text x="-15" y="325" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="end">0.1</text>
|
||
|
||
<line x1="-10" y1="240" x2="0" y2="240" stroke="black" stroke-width="1.25" />
|
||
<text x="-15" y="245" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="end">0.2</text>
|
||
|
||
<line x1="-10" y1="160" x2="0" y2="160" stroke="black" stroke-width="1.25" />
|
||
<text x="-15" y="165" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="end">0.3</text>
|
||
|
||
<line x1="-10" y1="80" x2="0" y2="80" stroke="black" stroke-width="1.25" />
|
||
<text x="-15" y="85" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="end">0.4</text>
|
||
|
||
<line x1="-10" y1="0" x2="0" y2="0" stroke="black" stroke-width="1.25" />
|
||
<text x="-15" y="5" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" text-anchor="end">0.5</text>
|
||
|
||
<!-- Baseline inverse law: K = 256/W (dashed line) -->
|
||
<!-- Points: 512->0.5 (0,0), 1024->0.25 (100,200), 2048->0.125 (200,300), 4096->0.0625 (300,350),
|
||
8192->0.0312 (400,375), 16384->0.0156 (500,387.5), 32768->0.0078 (600,393.75), 65536->0.0039 (700,396.875) -->
|
||
<polyline points="0,0 100,200 200,300 300,350 400,375 500,387.5 600,393.75 700,396.875"
|
||
stroke="gray" stroke-width="1.5" fill="none" stroke-dasharray="5,5" />
|
||
|
||
<!-- James Law target (K=1.0, horizontal dashed line) -->
|
||
<line x1="0" y1="-200" x2="800" y2="-200" stroke="blue" stroke-width="1.25" stroke-dasharray="3,3" />
|
||
<text x="750" y="-205" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10" fill="blue">K=1.0 (James Law)</text>
|
||
|
||
<!-- Observed data points with error bars showing range -->
|
||
<!-- Scale: K: 0-0.5 -> 400-0px (inverted) -->
|
||
|
||
<!-- W=512B: K=0.500, range [0.500,0.500] -> (0, 0) no error bar -->
|
||
<circle cx="0" cy="0" r="5" fill="black" stroke="black" stroke-width="1.25" />
|
||
|
||
<!-- W=1024B: K=0.310, range [0.250,0.854] -> (100, 152), error bar to 200 and -354.4 -->
|
||
<line x1="100" y1="200" x2="100" y2="-354.4" stroke="black" stroke-width="1.25" />
|
||
<line x1="95" y1="200" x2="105" y2="200" stroke="black" stroke-width="1.25" />
|
||
<line x1="95" y1="-354.4" x2="105" y2="-354.4" stroke="black" stroke-width="1.25" />
|
||
<rect x="95" y="147" width="10" height="10" fill="black" stroke="black" stroke-width="1.25" />
|
||
|
||
<!-- W=2048B: K=0.125, range [0.125,0.125] -> (200, 300) no error bar -->
|
||
<circle cx="200" cy="300" r="5" fill="black" stroke="black" stroke-width="1.25" />
|
||
|
||
<!-- W=4096B: K=0.0625, range [0.0625,0.0625] -> (300, 350) - triple lock -->
|
||
<circle cx="300" cy="350" r="7" fill="black" stroke="black" stroke-width="2" />
|
||
<circle cx="300" cy="350" r="4" fill="white" stroke="black" stroke-width="1.25" />
|
||
|
||
<!-- W=6144B: K=0.274, range [0.042,1.000] -> (450, 146.4), error bar 366.4 to -400 -->
|
||
<line x1="450" y1="366.4" x2="450" y2="-400" stroke="red" stroke-width="1.5" />
|
||
<line x1="445" y1="366.4" x2="455" y2="366.4" stroke="red" stroke-width="1.5" />
|
||
<line x1="445" y1="-400" x2="455" y2="-400" stroke="red" stroke-width="1.5" />
|
||
<rect x="445" y="141.4" width="10" height="10" fill="red" stroke="black" stroke-width="1.25" />
|
||
<text x="450" y="130" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="9" text-anchor="middle" font-weight="bold" fill="red">53%</text>
|
||
|
||
<!-- W=8192B: K=0.0522, range [0.031,0.562] -> (400, 358.24), error bar 375.2 to -49.6 -->
|
||
<line x1="400" y1="375.2" x2="400" y2="-49.6" stroke="black" stroke-width="1.25" />
|
||
<line x1="395" y1="375.2" x2="405" y2="375.2" stroke="black" stroke-width="1.25" />
|
||
<line x1="395" y1="-49.6" x2="405" y2="-49.6" stroke="black" stroke-width="1.25" />
|
||
<circle cx="400" cy="358.24" r="5" fill="black" stroke="black" stroke-width="1.25" />
|
||
|
||
<!-- W=16384B: K=0.140, range [0.016,1.000] -> (500, 288), error bar 387.2 to -400 -->
|
||
<line x1="500" y1="387.2" x2="500" y2="-400" stroke="red" stroke-width="1.5" />
|
||
<line x1="495" y1="387.2" x2="505" y2="387.2" stroke="red" stroke-width="1.5" />
|
||
<line x1="495" y1="-400" x2="505" y2="-400" stroke="red" stroke-width="1.5" />
|
||
<rect x="495" y="283" width="10" height="10" fill="red" stroke="black" stroke-width="1.25" />
|
||
<text x="500" y="270" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="9" text-anchor="middle" font-weight="bold" fill="red">47%</text>
|
||
|
||
<!-- W=32768B: K=0.0564, range [0.008,0.750] -> (600, 354.88), error bar 393.6 to -200 -->
|
||
<line x1="600" y1="393.6" x2="600" y2="-200" stroke="orange" stroke-width="1.25" />
|
||
<line x1="595" y1="393.6" x2="605" y2="393.6" stroke="orange" stroke-width="1.25" />
|
||
<line x1="595" y1="-200" x2="605" y2="-200" stroke="orange" stroke-width="1.25" />
|
||
<path d="M 594,354.88 L 600,348.88 L 606,354.88 L 600,360.88 Z" fill="orange" stroke="black" stroke-width="1.25" />
|
||
<text x="600" y="340" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="9" text-anchor="middle" fill="orange">17%</text>
|
||
|
||
<!-- W=52153B: K=0.0183, range [0.005,0.138] -> (675, 385.36), error bar 396 to 277.6 -->
|
||
<line x1="675" y1="396" x2="675" y2="277.6" stroke="black" stroke-width="1.25" />
|
||
<line x1="670" y1="396" x2="680" y2="396" stroke="black" stroke-width="1.25" />
|
||
<line x1="670" y1="277.6" x2="680" y2="277.6" stroke="black" stroke-width="1.25" />
|
||
<polygon points="675,380.36 681,392.36 669,392.36" fill="black" stroke="black" stroke-width="1.25" />
|
||
|
||
<!-- W=65536B: K=0.00546, range [0.004,0.051] -> (700, 395.632), error bar 396.8 to 359.2 -->
|
||
<line x1="700" y1="396.8" x2="700" y2="359.2" stroke="black" stroke-width="1.25" />
|
||
<line x1="695" y1="396.8" x2="705" y2="396.8" stroke="black" stroke-width="1.25" />
|
||
<line x1="695" y1="359.2" x2="705" y2="359.2" stroke="black" stroke-width="1.25" />
|
||
<circle cx="700" cy="395.632" r="5" fill="black" stroke="black" stroke-width="1.25" />
|
||
</g>
|
||
|
||
<!-- Legend (below plot, non-overlapping) -->
|
||
<g transform="translate(100, 495)">
|
||
<line x1="0" y1="0" x2="30" y2="0" stroke="gray" stroke-width="1.5" stroke-dasharray="5,5" />
|
||
<text x="35" y="4" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10">K = 256/W (baseline inverse law)</text>
|
||
|
||
<line x1="250" y1="0" x2="280" y2="0" stroke="blue" stroke-width="1.25" stroke-dasharray="3,3" />
|
||
<text x="285" y="4" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10">K = 1.0 (James Law target)</text>
|
||
|
||
<circle cx="490" cy="0" r="4" fill="black" stroke="black" stroke-width="1.25" />
|
||
<text x="500" y="4" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10">Observed mean K</text>
|
||
|
||
<circle cx="620" cy="0" r="5" fill="black" stroke="black" stroke-width="2" />
|
||
<circle cx="620" cy="0" r="2" fill="white" />
|
||
<text x="630" y="4" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10">Triple-lock (zero variance)</text>
|
||
</g>
|
||
|
||
<!-- Annotations -->
|
||
<g transform="translate(80, 70)">
|
||
<!-- Intrinsic wavelength λ₀ = 256B annotation -->
|
||
<text x="100" y="-10" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="11" fill="green" font-weight="bold">
|
||
λ₀ = 256 bytes (intrinsic wavelength)
|
||
</text>
|
||
|
||
<!-- Resonance peaks -->
|
||
<text x="420" y="120" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10" fill="red" font-weight="bold">
|
||
Resonance Peak #1
|
||
</text>
|
||
<text x="470" y="260" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10" fill="red" font-weight="bold">
|
||
Resonance Peak #2
|
||
</text>
|
||
|
||
<!-- Anti-resonance trough -->
|
||
<text x="270" y="330" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10" fill="blue">
|
||
Anti-resonance
|
||
</text>
|
||
<text x="280" y="345" font-family="Liberation Sans, DejaVu Sans, sans-serif" font-size="10" fill="blue">
|
||
(locked)
|
||
</text>
|
||
</g>
|
||
</svg> |