]> git.codecow.com Git - nano-pow.git/commitdiff
Start updating test page with new body content and styling.
authorChris Duncan <chris@codecow.com>
Fri, 24 Jul 2026 23:13:33 +0000 (16:13 -0700)
committerChris Duncan <chris@codecow.com>
Fri, 24 Jul 2026 23:13:33 +0000 (16:13 -0700)
index.html

index 420e109244025e7c20faa5e25abef5c8b33c8ce3..9727a3f517fd4dd2d689c3bdb57e9748b47606ef 100644 (file)
@@ -306,36 +306,49 @@ SPDX-License-Identifier: GPL-3.0-or-later
                }
        </script>
        <style>
-               body{background:black;color:white;}a{color:darkcyan;}input[type=number]{width:5em;}input[type=checkbox]{margin-right:2em;}
+               body{background:black;color:white;font-size:0.9rem;line-height:140%;margin:0 auto;max-width:900px;}a{color:darkcyan;}input[type=number]{width:5em;}input[type=checkbox]{margin-right:2em;}
                div.hex{display:inline-block;font-family:monospace;}
-               div.hex::before{color:grey;content:'0x';display:inline-block;font-size:90%;left:0.5em;position:relative;width:0;}
-               div.hex>input{padding-left:1.5em;}
+               div.hex::before{color:grey;content:'0x';display:inline-block;font-family:monospace;font-size:90%;left:0.5em;position:relative;width:0;}
+               div.hex>input{font-family:monospace;padding-left:1.5em;}
                .warning::before{content:'\0026a0\00FE0F';}
        </style>
 </head>
 
 <body>
-       <h1>nano-pow</h1>
-       <h4><a href="https://www.npmjs.com/package/nano-pow">https://www.npmjs.com/package/nano-pow</a></h4>
-       <h2>Speed test for NanoPow proof-of-work tool.</h2>
+       <h1>Speed test for nano-pow</h1>
+       <h2><a href="https://www.npmjs.com/package/nano-pow">https://www.npmjs.com/package/nano-pow</a></h2>
+       <p>This benchmark tests a browser-based proof-of-work implementation for the cryptocurrency Nano. A random 32-byte value is generated for a block hash, and then the test uses this value to find a nonce that meets a minimum threshold.</p>
        <p>NanoPow uses cutting edge WebGPU technology, and not all browsers support it.</p>
-       <p>NanoPow uses WebGL 2.0 as a fallback option if WebGPU is not detected and a WASM module if neither GPU API is available.</p>
+       <p>NanoPow uses WebGL 2.0 as a fallback option if WebGPU is not detected. It uses a WASM module if neither GPU API is available.</p>
        <p>Times below are in milliseconds and are summarized by various averaging methods.</p>
        <p>Level of Effort depends on hardware and does not guarantee faster results.</p>
+       <ul>
+               <li>Each work_generate call is individually timed.</li>
+               <li>Each test is comprised of the specified iterations of calls.</li>
+               <li>Each test run is comprised of the specified iterations of tests.</li>
+       </ul>
+       <p>The final score is displayed as "work-per-second" and is calculated as follows:</p>
+       <ol>
+               <li>For each test run:
+                       <ol>
+                               <li>Collect all the work_generate timings for the test run.</li>
+                               <li>Truncate the results by eliminating the fastest 10% and slowest 10% of sequence timings.</li>
+                               <li>Calculate the arithmetic mean (average) of the truncated results.</li>
+                       </ol>
+               </li>
+               <li>Collect the truncated arithmetic means from all test runs.</li>
+               <li>Truncate the results by eliminating the fastest 10% and slowest 10% of test runs.</li>
+               <li>Calculate the harmonic mean of the truncated results.</li>
+       </ol>
        <hr />
-       <label for="work">Validate Work</label>
+       <h3>Work Validation Tool</h3>
+       <label for="work">Work</label>
        <div class="hex"><input id="work" type="text" /></div>
-       <label for="hash" class="hex">Hash</label>
+       <label for="hash" class="hex">Block Hash</label>
        <div class="hex"><input id="hash" type="text" /></div>
        <span id="validation"></span>
        <hr />
-       <h3>Options</h3>
-       <label for="difficulty" class="hex">Difficulty</label>
-       <div class="hex"><input id="difficulty" type="text" value="FFFFFFF800000000" /></div>
-       <label for="size">Test Size</label>
-       <input id="size" type="number" value="1" autofocus />
-       <label for="effort">Effort (1-32)</label>
-       <input id="effort" type="number" min="1" max="32" />
+       <h3>Benchmarking</h3>
        <span>
                <label for="api">API</label>
                <select id="api">
@@ -345,28 +358,13 @@ SPDX-License-Identifier: GPL-3.0-or-later
                        <option>CPU</option>
                </select>
        </span>
+       <label for="size">Test Size</label>
+       <input id="size" type="number" value="100" min="1" autofocus />
+       <label for="runs">Test Runs</label>
+       <input id="runs" type="number" value="10" min="1" autofocus />
+       <button id="btnStartTest" disabled>Go</button>
        <hr />
-       <h3>Benchmarking</h3>
-       <span>
-               <label for="isOutputShown">Show output?</label>
-               <input id="isOutputShown" type="checkbox" checked />
-       </span>
-       <span>
-               <label for="isDebug">Debug?</label>
-               <input id="isDebug" type="checkbox" />
-       </span>
-       <span>
-               <label for="isSelfCheck">Run self-check?</label>
-               <input id="isSelfCheck" type="checkbox" checked />
-       </span>
-       <button id="btnStartTest">Go</button>
-       <hr />
-       <h3>Scoring</h3>
-       <label for="runs">Score Runs</label>
-       <input id="runs" type="number" value="1" autofocus />
-       <button id="btnStartScore">Score &#x2757;</button>
-       <hr />
-       <h3 id="status">WAITING</h3>
+       <h3 id="status">LOADING</h3>
        <hr />
        <pre id="summary"></pre>
        <hr />