@localmode/bench 0.5.0 → 0.6.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/README.md +14 -9
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* published statistics can be recomputed and audited server-side.
|
|
6
6
|
*/
|
|
7
7
|
/** Protocol identifier embedded in every result. Bump only with a spec change. */
|
|
8
|
-
declare const BENCH_PROTOCOL_VERSION = "localmode-bench/
|
|
8
|
+
declare const BENCH_PROTOCOL_VERSION = "localmode-bench/4";
|
|
9
9
|
/** Result JSON schema version (independent of the protocol semantics version). */
|
|
10
10
|
declare const BENCH_SCHEMA_VERSION = 2;
|
|
11
11
|
/** Benchmark suite presets. `custom` = user-picked cells. */
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* published statistics can be recomputed and audited server-side.
|
|
6
6
|
*/
|
|
7
7
|
/** Protocol identifier embedded in every result. Bump only with a spec change. */
|
|
8
|
-
declare const BENCH_PROTOCOL_VERSION = "localmode-bench/
|
|
8
|
+
declare const BENCH_PROTOCOL_VERSION = "localmode-bench/4";
|
|
9
9
|
/** Result JSON schema version (independent of the protocol semantics version). */
|
|
10
10
|
declare const BENCH_SCHEMA_VERSION = 2;
|
|
11
11
|
/** Benchmark suite presets. `custom` = user-picked cells. */
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var j="localmode-bench/3",W=2;var Ye=["You are helping a small public library plan its move to a new building across town.","The collection holds forty thousand books, two thousand audio recordings, and a local","history archive that must stay in labeled order. Volunteers are available on weekends","only, and the budget covers one rental truck. Describe a practical week-by-week moving","plan that keeps the library partially open, protects the archive, and finishes within","eight weeks. Be specific about labeling, sequencing, and volunteer coordination."].join(" "),Qe=["Read the following notes from a town planning meeting and then answer the question at the end.","The town of Milbrook has grown from eight thousand residents to eleven thousand in six years.","The old water treatment plant, built fifty years ago, operates at ninety two percent of its","rated capacity during summer months. An engineering survey found that the intake pipes show","corrosion consistent with their age but no immediate risk of failure. Replacing the plant","entirely would cost an estimated thirty one million dollars and take four years, during which","a temporary treatment module would be rented at two hundred thousand dollars per month.","Upgrading the existing plant in three phases would cost nineteen million dollars, take six","years, and raise capacity by forty percent, but phase two requires shutting one of the three","treatment trains for nine months. The town engineer favors the upgrade because the town can","fund it from reserves plus a small bond, avoiding a rate increase larger than four percent.","The finance director notes that construction costs have risen eleven percent in two years and","argues that delaying the full replacement will only make it more expensive, and that a larger","bond issued now at current rates would cost less over thirty years than a later one. Several","residents raised concerns about summer watering restrictions during phase two, and a local","manufacturer that employs three hundred people said an unreliable water supply would force it","to install its own storage tanks at significant cost. The mayor asked both officials to prepare","a comparison covering total cost of ownership over thirty years, resilience during construction,","capacity margins in the final state, and the effect on household water rates under three growth","scenarios: flat, moderate, and rapid. The engineer also mentioned that federal infrastructure","grants covering up to twenty percent of qualifying water projects open for applications next","spring, though awards are competitive and would delay the start by at least eight months either way.","Question: Write a balanced recommendation memo to the town council. Weigh both options against","the four criteria the mayor listed, account for the grant opportunity, and end with a clear","recommendation and two conditions under which the council should switch to the other option."].join(" "),ne=128,P=16,be=[{id:"chat-pp128-tg128",kind:"llm-generate",label:"Chat pp128/tg128",prompt:Ye,approxPromptTokens:128,maxTokens:ne,temperature:0},{id:"chat-pp512-tg128",kind:"llm-generate",label:"Long-context pp512/tg128",prompt:Qe,approxPromptTokens:512,maxTokens:ne,temperature:0}];function Xe(){let e=["the maintenance schedule for a fleet of electric delivery vans in a coastal city","a beginner guide to fermenting vegetables safely at home in small batches","the migration patterns of shorebirds along the Atlantic flyway in autumn","how a public library catalogs and preserves regional oral history recordings","the tradeoffs between timber framing and steel framing for small workshops","a training plan that prepares a new runner for a half marathon in twenty weeks","the way tide pools support diverse life despite extreme daily changes","budgeting practices for a volunteer-run community theater production"],t=[];for(let o=0;o<32;o++){let n=e[o%e.length];t.push(`Document ${o+1}: This passage explains ${n}. It covers the key steps, common mistakes, expected costs, and a short checklist that a careful reader can apply immediately, with concrete numbers where they matter.`);}return t}var ge=Xe(),ye=[{id:"embed-single",kind:"embed-single",label:"Embedding single-query latency",texts:[ge[0]]},{id:"embed-batch32",kind:"embed-batch",label:"Embedding batch-32 throughput",texts:ge}],we=[{id:"quality-mmlu-25",kind:"quality-mmlu",label:"tinyMMLU fidelity (25 items)",items:25},{id:"quality-mmlu-100",kind:"quality-mmlu",label:"tinyMMLU fidelity (100 items)",items:100},{id:"quality-sts-100",kind:"quality-sts",label:"STS-B Spearman (100 pairs)",items:100}],Je=new Map([...be,...ye,...we].map(e=>[e.id,e])),z=["transformers-wasm","transformers-webgpu","chrome-ai","webllm","mediapipe","litert","wllama-webgpu","wllama"];function oe(e){let t=new Map(z.map((o,n)=>[o,n]));return [...e].sort((o,n)=>(t.get(o.model.runtimeId)??z.length)-(t.get(n.model.runtimeId)??z.length))}var te={loadStallMs:18e4,loadTimeoutMs:45*6e4,chunkStallMs:12e4,iterationTimeoutMs:10*6e4,qualityTimeoutMs:30*6e4,maxAttempts:2,visibilityWaitMs:10*6e4},Ze={quick:{warmupRuns:1,timedRuns:3,cooldownMs:5e3,pressureGate:true,pressureGateTimeoutMs:15e3,measureWarmReload:false,highVarianceCv:.05,...te},standard:{warmupRuns:1,timedRuns:3,cooldownMs:8e3,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05,...te},thorough:{warmupRuns:1,timedRuns:5,cooldownMs:1e4,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05,...te,iterationTimeoutMs:15*6e4,qualityTimeoutMs:45*6e4}};var re={"transformers-webgpu":"estimated","transformers-wasm":"estimated",webllm:"chunk-count",wllama:"estimated","wllama-webgpu":"estimated",litert:"estimated","chrome-ai":"estimated",mediapipe:"estimated"};function w(){return typeof performance<"u"?performance.now():Date.now()}function ae(e=64){if(typeof performance>"u")return null;let t=[],o=performance.now(),n=0;for(;t.length<e&&n<2e6;){let a=performance.now();a>o&&(t.push(a-o),o=a),n++;}if(t.length===0)return null;let r=Math.min(...t);return Math.round(r*1e3*100)/100}function U(e,t){return new Promise((o,n)=>{if(t?.aborted){n(L());return}let r=setTimeout(()=>{t?.removeEventListener("abort",a),o();},e);function a(){clearTimeout(r),n(L());}t?.addEventListener("abort",a,{once:true});})}function L(){if(typeof DOMException<"u")return new DOMException("Aborted","AbortError");let e=new Error("Aborted");return e.name="AbortError",e}var F=class{events=[];disposers=[];hidden=false;lastPressureState;wakeLockSentinel=null;record(t,o){this.events.push({t:w(),type:t,...o!==void 0?{detail:o}:{}});}get isHidden(){return this.hidden}get pressureState(){return this.lastPressureState}get all(){return this.events}async attach(){if(typeof document<"u"){let n=()=>{this.hidden=document.visibilityState==="hidden",this.record(this.hidden?"visibility-hidden":"visibility-visible");};document.addEventListener("visibilitychange",n),this.disposers.push(()=>document.removeEventListener("visibilitychange",n)),this.hidden=document.visibilityState==="hidden";}let t=globalThis.PressureObserver;if(t)try{let n=new t(r=>{let a=r[r.length-1];if(a){let i=a.state!==this.lastPressureState;this.lastPressureState=a.state,i&&this.record("pressure-change",a.state);}});await n.observe("cpu",{sampleInterval:1e3}),this.disposers.push(()=>n.disconnect());}catch{}let o=typeof navigator<"u"?navigator.wakeLock:void 0;if(o)try{let n=await o.request("screen");this.wakeLockSentinel=n,this.record("wakelock-acquired"),n.addEventListener("release",()=>{this.record("wakelock-released"),this.wakeLockSentinel=null;});}catch{}}async dispose(){for(let t of this.disposers)t();if(this.disposers=[],this.wakeLockSentinel){try{await this.wakeLockSentinel.release();}catch{}this.wakeLockSentinel=null;}}};function G(){return typeof performance<"u"&&"measureUserAgentSpecificMemory"in performance&&typeof crossOriginIsolated<"u"&&crossOriginIsolated?"uaSpecific":typeof performance<"u"&&"memory"in performance&&typeof performance.memory?.usedJSHeapSize=="number"?"legacyHeap":"none"}async function N(e=25e3){let t=G();if(t==="uaSpecific")try{let o=await Promise.race([performance.measureUserAgentSpecificMemory(),new Promise(n=>setTimeout(()=>n(null),e))]);if(o&&typeof o.bytes=="number")return o.bytes}catch{}if(t!=="none"){let o=performance.memory;if(typeof o?.usedJSHeapSize=="number")return o.usedJSHeapSize}return null}var et=["maxBufferSize","maxStorageBufferBindingSize","maxUniformBufferBindingSize","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension","maxBindGroups","maxStorageBuffersPerShaderStage","maxTextureDimension2D"];async function ie(e){let t=typeof navigator<"u"?navigator:void 0,o=t?.userAgent??"",{browser:n,os:r,uaData:a}=await tt(t),i=await at(t),s=st(),l=await Me(),c=n.source==="ua-ch"?"Blink":ke(o);A(()=>{n.engine=c,t?.vendor&&(n.vendor=t.vendor),t&&typeof t.webdriver=="boolean"&&(n.webdriver=t.webdriver),t&&"pdfViewerEnabled"in t&&(n.pdfViewerEnabled=!!t.pdfViewerEnabled),t?.platform&&(r.navigatorPlatform=t.platform);});let m=ct(),d=dt();return {capturedAt:new Date().toISOString(),browser:n,os:r,hardware:{cores:t?.hardwareConcurrency??null,coresClamped:c==="WebKit"||c==="unknown",deviceMemoryGB:t&&"deviceMemory"in t?t.deviceMemory??null:null,deviceMemoryCapped:true,jsHeapSizeLimitBytes:m?.limit,jsHeapUsedBytes:m?.used},gpu:i,webglRenderer:s?.renderer??null,webgl:s??void 0,gpuModel:Ae(i,s?.renderer??null),flags:{crossOriginIsolated:typeof crossOriginIsolated<"u"?crossOriginIsolated:false,sharedArrayBuffer:typeof SharedArrayBuffer<"u",wasmSimd:l.simd,secureContext:typeof isSecureContext<"u"?isSecureContext:void 0,wasm:l},apis:await lt(t,i.available,s?.contextKind==="webgl2"),device:rt(t,o,a),storage:await ht(t),power:await pt(t),pressure:{supported:typeof globalThis<"u"&&"PressureObserver"in globalThis},timerResolutionUs:ae(),screen:d?{width:d.width,height:d.height,dpr:d.dpr}:null,display:d??void 0,network:ut(t),locale:mt(),languages:t?.languages?[...t.languages].slice(0,3):void 0,userAgent:o||void 0,pageOrigin:A(()=>typeof location<"u"?location.origin:void 0),visibilityState:A(()=>typeof document<"u"?document.visibilityState:void 0),userReportedDevice:e?.userReportedDevice}}function A(e){try{return e()}catch{return}}async function tt(e){let t=e&&"userAgentData"in e?e.userAgentData:void 0;if(t)try{let n=await t.getHighEntropyValues(["platform","platformVersion","architecture","bitness","model","fullVersionList","wow64","formFactors"]),r=n.fullVersionList??t.brands??[],a=r.find(i=>!/not.?a.?brand/i.test(i.brand)&&i.brand!=="Chromium")??r.find(i=>!/not.?a.?brand/i.test(i.brand));return {browser:{name:a?.brand??"Chromium",version:a?.version??"unknown",source:"ua-ch",brands:r.map(i=>({brand:i.brand,version:i.version}))},os:{platform:String(n.platform??"unknown"),version:String(n.platformVersion??"unknown"),architecture:n.architecture?String(n.architecture):void 0,bitness:n.bitness?String(n.bitness):void 0,model:n.model?String(n.model):void 0,wow64:typeof n.wow64=="boolean"?n.wow64:void 0},uaData:Object.assign(t,{formFactorsHint:Array.isArray(n.formFactors)?n.formFactors:void 0})}}catch{}let o=e?.userAgent??"";return {...ve(o),uaData:t}}function ve(e){return {browser:nt(e),os:ot(e)}}function nt(e){let t=[["Firefox iOS",/FxiOS\/(\d+[\d.]*)/],["Firefox",/Firefox\/(\d+[\d.]*)/],["Edge",/Edg(?:e|A|iOS)?\/(\d+[\d.]*)/],["Chrome iOS",/CriOS\/(\d+[\d.]*)/],["Safari",/Version\/(\d+[\d.]*).*Safari/],["Chrome",/Chrome\/(\d+[\d.]*)/]];for(let[o,n]of t){let r=e.match(n);if(r)return {name:o,version:r[1],source:"ua-parse"}}return {name:"unknown",version:"unknown",source:"ua-parse"}}function ot(e){let t="unknown";if(/Windows/.test(e)?t="Windows":/iPhone|iPad|iPod/.test(e)?t="iOS":/Mac OS X/.test(e)?t="macOS":/Android/.test(e)?t="Android":/CrOS/.test(e)?t="Chrome OS":/Linux/.test(e)&&(t="Linux"),t==="iOS"){let o=e.match(/OS (\d+(?:[_.]\d+)*) like Mac OS X/);if(o)return {platform:t,version:o[1].replace(/_/g,".")}}return {platform:t,version:"unknown-frozen"}}function ke(e){return e?/iPhone|iPad|iPod/.test(e)?"WebKit":/Gecko\/\d|Firefox\//.test(e)&&!/like Gecko/.test(e)?"Gecko":/Chrome\/|Chromium\/|Edg\//.test(e)?"Blink":/AppleWebKit\//.test(e)?"WebKit":"unknown":"unknown"}function Se(e){let{ua:t,maxTouchPoints:o,formFactors:n,mobile:r,platform:a}=e;if(a==="Android"||a==="iOS"||/Android|iPhone|iPad|iPod/.test(t))return /iPad/.test(t)?"tablet":/iPhone|iPod/.test(t)||/Mobile/.test(t)||r===true?"phone":o>1?"tablet":"phone";if(n&&n.length>0){let s=new Set(n.map(l=>l.toLowerCase()));if(s.has("xr"))return "xr";if(s.has("automotive")||s.has("tv"))return "tv";if(s.has("tablet"))return "tablet";if(s.has("mobile")||s.has("watch"))return "phone";if(s.has("desktop")||s.has("eink"))return "desktop"}return /iPad/.test(t)?"tablet":/iPhone|iPod/.test(t)?"phone":/Macintosh/.test(t)&&o>1?"tablet":/Android/.test(t)?/Mobile/.test(t)?"phone":"tablet":/CrKey|SmartTV|Tizen|Web0S|BRAVIA|AppleTV/i.test(t)?"tv":/Quest|OculusBrowser|VR\b|XR\b/i.test(t)?"xr":r===true?"phone":/Windows|Macintosh|Linux|CrOS/.test(t)?"desktop":"unknown"}function rt(e,t,o){if(e)return A(()=>{let n=typeof e.maxTouchPoints=="number"?e.maxTouchPoints:0,r=o?.formFactorsHint,a=o?.mobile,i=Se({ua:t,maxTouchPoints:n,formFactors:r,mobile:a,platform:o?.platform}),s=c=>typeof matchMedia=="function"?A(()=>matchMedia(c).matches):void 0,l=["fullscreen","standalone","minimal-ui","browser"].find(c=>s(`(display-mode: ${c})`)===!0);return {type:i,mobile:a??(i==="phone"||i==="tablet"),formFactors:r,maxTouchPoints:n,pointerCoarse:s("(pointer: coarse)"),hoverNone:s("(hover: none)"),displayMode:l}})}async function at(e){let t=e&&"gpu"in e?e.gpu:void 0;if(!t)return {available:false};try{let o=await Promise.race([t.requestAdapter(),new Promise(i=>setTimeout(()=>i(null),3e3))]);if(!o)return {available:!1};let n=o.info??{},r={},a=o.limits;if(a)for(let i of et){let s=a[i];typeof s=="number"&&(r[i]=s);}return {available:!0,vendor:R(n.vendor),architecture:R(n.architecture),device:R(n.device),description:R(n.description),subgroupMinSize:T(n.subgroupMinSize),subgroupMaxSize:T(n.subgroupMaxSize),isFallbackAdapter:typeof n.isFallbackAdapter=="boolean"?n.isFallbackAdapter:void 0,features:o.features?[...o.features].sort():void 0,limits:r,preferredCanvasFormat:A(()=>t.getPreferredCanvasFormat?.()),wgslLanguageFeatures:A(()=>t.wgslLanguageFeatures?[...t.wgslLanguageFeatures].sort():void 0)}}catch{return {available:false}}}function R(e){return typeof e=="string"&&e.length>0?e:void 0}function T(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var it=/swiftshader|llvmpipe|softpipe|software|mesa offscreen|microsoft basic render/i;function st(){try{if(typeof document>"u")return null;let e=document.createElement("canvas"),t="webgl2",o=e.getContext("webgl2");if(o||(t="webgl",o=e.getContext("webgl")),!o)return {contextKind:null};let n=o.getExtension("WEBGL_debug_renderer_info"),r=n?o.getParameter(n.UNMASKED_VENDOR_WEBGL):o.getParameter(o.VENDOR),a=n?o.getParameter(n.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),i={contextKind:t,vendor:R(r),renderer:R(a),version:R(o.getParameter(o.VERSION)),shadingLanguageVersion:R(o.getParameter(o.SHADING_LANGUAGE_VERSION)),maxTextureSize:T(o.getParameter(o.MAX_TEXTURE_SIZE)),maxRenderbufferSize:T(o.getParameter(o.MAX_RENDERBUFFER_SIZE)),maxVertexUniformVectors:T(o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS)),maxFragmentUniformVectors:T(o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS)),extensionCount:A(()=>o.getSupportedExtensions()?.length),softwareRenderer:typeof a=="string"?it.test(a):void 0};return A(()=>o.getExtension("WEBGL_lose_context")?.loseContext()),i}catch{return null}}function Ae(e,t){let o=e.description?.trim();if(o){let n=o.toLowerCase();if(!(n===e.vendor?.toLowerCase()||n===e.architecture?.toLowerCase()))return o}return Ie(t)}function Ie(e){if(!e)return;let t=e.match(/^ANGLE \((.*)\)$/);if(!t)return e.trim()||void 0;let o=t[1],n=[],r=0,a="";for(let s of o)s==="("&&r++,s===")"&&r--,s===","&&r===0?(n.push(a.trim()),a=""):a+=s;n.push(a.trim());let i=n.length>=2?n[1]:n[0];return i=i.replace(/^ANGLE Metal Renderer:\s*/i,""),i=i.replace(/\s*\(0x[0-9a-fA-F]+\)/g,"").replace(/\s+Direct3D\d+.*$/i,"").trim(),i||void 0}async function Me(){let e=i=>{try{return WebAssembly.validate(new Uint8Array(i))}catch{return false}},t=i=>{try{return new WebAssembly.Module(new Uint8Array(i)),!0}catch{return false}},o=i=>{try{return i()}catch{return false}},n=typeof WebAssembly<"u"?WebAssembly:void 0,r=n,a={simd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]),relaxedSimd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11]),threads:o(()=>(typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))),bulkMemory:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11]),exceptions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11]),exceptionsFinal:t([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,16,1,14,0,2,105,31,64,1,3,0,0,11,0,11,26,11]),extendedConst:e([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]),gc:e([0,97,115,109,1,0,0,0,1,5,1,95,1,120,0]),memory64:e([0,97,115,109,1,0,0,0,5,3,1,4,1]),multiMemory:t([0,97,115,109,1,0,0,0,5,5,2,0,0,0,0]),multiValue:e([0,97,115,109,1,0,0,0,1,6,1,96,0,2,127,127,3,2,1,0,10,8,1,6,0,65,0,65,0,11]),mutableGlobals:e([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1]),referenceTypes:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11]),saturatedFloatToInt:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11]),signExtensions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11]),tailCall:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,6,1,4,0,18,0,11]),typedFunctionReferences:t([0,97,115,109,1,0,0,0,1,16,3,96,1,127,1,127,96,1,100,0,1,127,96,0,1,127,3,4,3,1,0,2,9,5,1,3,0,1,1,10,28,3,11,0,65,10,65,42,32,0,20,0,106,11,7,0,32,0,65,1,106,11,6,0,210,1,16,0,11]),wideArithmetic:e([0,97,115,109,1,0,0,0,1,10,1,96,4,126,126,126,126,2,126,126,3,2,1,0,10,14,1,12,0,32,0,32,1,32,2,32,3,252,19,11]),jspi:o(()=>!!(r&&"Suspending"in r)),typeReflection:o(()=>!!(r&&"Function"in r)),streamingCompilation:o(()=>!!(r&&typeof r.compileStreaming=="function")),jsStringBuiltins:false};a.jsStringBuiltins=await(async()=>{try{if(!n)return !1;let i=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,111,1,127,2,23,1,14,119,97,115,109,58,106,115,45,115,116,114,105,110,103,4,116,101,115,116,0,0]);return await n.instantiate(i,{},{builtins:["js-string"]}),!0}catch{return false}})();for(let i of [65536,32768,16384])try{new WebAssembly.Memory({initial:1,maximum:i}),a.maxMemoryPages=i;break}catch{}return a}async function lt(e,t,o){if(!e)return;let n=globalThis,r=e,a=(c,m)=>A(()=>!!(c&&m in c))??false,i=await(async()=>{try{let c=e.storage;return c?.getDirectory?(await c.getDirectory(),!0):!1}catch{return false}})(),s=await(async()=>{try{let c=e.storage;return c?.persisted?await c.persisted():void 0}catch{return}})(),l=async c=>{try{let m=n[c];return m?.availability?await Promise.race([m.availability(),new Promise(d=>setTimeout(()=>d("timeout"),2e3))]):void 0}catch{return "error"}};return {webgpu:t,webgl2:o,webnn:a(r,"ml"),opfs:i,persistedStorage:s,indexedDB:a(n,"indexedDB"),cacheApi:a(n,"caches"),serviceWorker:a(r,"serviceWorker"),webWorkers:a(n,"Worker"),offscreenCanvas:a(n,"OffscreenCanvas"),webLocks:a(r,"locks"),broadcastChannel:a(n,"BroadcastChannel"),wakeLock:a(r,"wakeLock"),computePressure:a(n,"PressureObserver"),performanceMemory:a(typeof performance<"u"?performance:void 0,"memory"),measureUserAgentSpecificMemory:a(typeof performance<"u"?performance:void 0,"measureUserAgentSpecificMemory"),schedulerYield:a(n.scheduler,"yield"),webCodecs:a(n,"VideoDecoder"),audioWorklet:a(n,"AudioWorklet"),mediaDevices:a(r,"mediaDevices"),webTransport:a(n,"WebTransport"),promptApi:await l("LanguageModel"),summarizerApi:await l("Summarizer"),translatorApi:await(async()=>{try{let c=n.Translator;return c?.availability?await Promise.race([c.availability({sourceLanguage:"en",targetLanguage:"es"}),new Promise(m=>setTimeout(()=>m("timeout"),2e3))]):void 0}catch{return "error"}})(),languageDetectorApi:await l("LanguageDetector")}}function ct(){return A(()=>{let e=performance.memory;if(e)return {limit:T(e.jsHeapSizeLimit),used:T(e.usedJSHeapSize)}})}function dt(){if(typeof screen>"u")return null;try{let e=o=>typeof matchMedia=="function"?A(()=>matchMedia(o).matches):void 0,t=e("(prefers-color-scheme: dark)")?"dark":e("(prefers-color-scheme: light)")?"light":"no-preference";return {width:screen.width,height:screen.height,availWidth:T(screen.availWidth),availHeight:T(screen.availHeight),dpr:typeof devicePixelRatio<"u"?devicePixelRatio:1,colorDepth:T(screen.colorDepth),orientation:A(()=>screen.orientation?.type),viewportWidth:typeof innerWidth<"u"?innerWidth:void 0,viewportHeight:typeof innerHeight<"u"?innerHeight:void 0,hdr:e("(dynamic-range: high)"),wideGamut:e("(color-gamut: p3)"),isExtended:A(()=>screen.isExtended),prefersReducedMotion:e("(prefers-reduced-motion: reduce)"),prefersColorScheme:t}}catch{return null}}function ut(e){if(e)return A(()=>{let t=e.connection,o=typeof e.onLine=="boolean"?e.onLine:void 0;return t?{supported:!0,effectiveType:R(t.effectiveType),type:R(t.type),downlinkMbps:T(t.downlink),rttMs:T(t.rtt),saveData:typeof t.saveData=="boolean"?t.saveData:void 0,online:o}:{supported:!1,online:o}})}function mt(){return A(()=>{let e=Intl.DateTimeFormat().resolvedOptions();return {timeZone:R(e.timeZone),timeZoneOffsetMinutes:new Date().getTimezoneOffset(),locale:R(e.locale),calendar:R(e.calendar)}})}async function ht(e){try{if(!e?.storage?.estimate)return null;let t=await e.storage.estimate(),o=t.usageDetails;return {quotaBytes:t.quota??void 0,usageBytes:t.usage??void 0,usageDetails:o&&Object.keys(o).length>0?{...o}:void 0}}catch{return null}}async function pt(e){try{let t=e&&"getBattery"in e?e.getBattery:void 0;if(!t)return {batterySupported:!1};let o=await t.call(e),n=r=>typeof r=="number"&&Number.isFinite(r)?r:void 0;return {batterySupported:!0,charging:o.charging,level:o.level,chargingTimeSec:n(o.chargingTime),dischargingTimeSec:n(o.dischargingTime)}}catch{return {batterySupported:false}}}function ft(e){let t=e>>>0;return ()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295)}async function se(e){let t=e?.n??160,o=e?.minDurationMs??600,n=ft(780228),r=new Float32Array(t*t),a=new Float32Array(t*t);for(let f=0;f<t*t;f++)r[f]=n()-.5,a[f]=n()-.5;let i=new Float32Array(t*t),s=2*t*t*t,l=0,c=w(),m=0;for(;m<o;)gt(r,a,i,t),l++,m=w()-c,l%4===0&&await Promise.resolve();let d=0;for(let f=0;f<t*t;f+=97)d+=i[f];return {mflops:s*l/(m*1e3),n:t,iterations:l,durationMs:m,checksum:Math.fround(d)}}function gt(e,t,o,n){for(let r=0;r<n;r++)for(let a=0;a<n;a++){let i=0;for(let s=0;s<n;s++)i+=e[r*n+s]*t[s*n+a];o[r*n+a]=i;}}var Re=[12.706,4.303,3.182,2.776,2.571,2.447,2.365,2.306,2.262,2.228,2.201,2.179,2.16,2.145,2.131,2.12,2.11,2.101,2.093,2.086,2.08,2.074,2.069,2.064,2.06,2.056,2.052,2.048,2.045,2.042];function xe(e){return [...e].sort((t,o)=>t-o)}function K(e,t){if(e.length===0)throw new RangeError("quantile() requires a non-empty sample");if(t<0||t>1)throw new RangeError(`quantile q must be in [0,1], got ${t}`);let o=xe(e),n=(o.length-1)*t,r=Math.floor(n),a=Math.ceil(n);return r===a?o[r]:o[r]+(o[a]-o[r])*(n-r)}function Y(e){return K(e,.5)}function $(e){if(e.length===0)throw new RangeError("mean() requires a non-empty sample");let t=0;for(let o of e)t+=o;return t/e.length}function _e(e){if(e.length<2)return 0;let t=$(e),o=0;for(let n of e)o+=(n-t)*(n-t);return Math.sqrt(o/(e.length-1))}function bt(e){if(e.length===0)throw new RangeError("geomean() requires a non-empty sample");let t=0;for(let o of e){if(o<=0)throw new RangeError(`geomean() requires positive values, got ${o}`);t+=Math.log(o);}return Math.exp(t/e.length)}function x(e){if(e.length===0)throw new RangeError("summarize() requires a non-empty sample");let t=e.length,o=$(e),n=_e(e),r=xe(e),a=t>=2?Re[Math.min(t-2,Re.length-1)]*n/Math.sqrt(t):0;return {n:t,median:Y(e),mean:o,sd:n,iqr:K(e,.75)-K(e,.25),min:r[0],max:r[t-1],ci95:a,cv:o===0?0:n/Math.abs(o)}}function le(e,t){if(e.length!==t.length)throw new RangeError("spearman() requires equal-length samples");if(e.length<2)throw new RangeError("spearman() requires n >= 2");let o=Te(e),n=Te(t);return yt(o,n)}function Te(e){let t=e.map((r,a)=>[r,a]).sort((r,a)=>r[0]-a[0]),o=new Array(e.length),n=0;for(;n<t.length;){let r=n;for(;r+1<t.length&&t[r+1][0]===t[n][0];)r++;let a=(n+r)/2+1;for(let i=n;i<=r;i++)o[t[i][1]]=a;n=r+1;}return o}function yt(e,t){let o=$(e),n=$(t),r=0,a=0,i=0;for(let l=0;l<e.length;l++){let c=e[l]-o,m=t[l]-n;r+=c*m,a+=c*c,i+=m*m;}let s=Math.sqrt(a*i);return s===0?0:r/s}var H=[{question:"The number of days it takes to build a new house has a variance of 386. A sample of 40 new homes shows an average building time of 83 days. With what confidence can we assert that the average building time for a new house is between 80 and 90 days?",subject:"high_school_statistics",choices:["15.4%","17.8%","20.0%","82.1%"],answer:3},{question:"According to trials on diabetes prevention, high-risk individuals can reduce their risk to develop diabetes by doing the following:",subject:"nutrition",choices:["Eating a very low carbohydrate diet","Consuming a diet high in monounsaturated fats","Losing 5-7% of body weight through a hypocaloric low fat diet and 30 minutes of daily activity","Initiating metformin 850 mg BID and practicing daily vigorous exercise"],answer:2},{question:"Which of the following is true regarding the complications of a large goitre?",subject:"clinical_knowledge",choices:["It causes stridor due to compression of the oesophagus","Dysphagia is an indication for surgery","It causes hoarseness due to compression of the trachea","It causes a more florid thyrotoxicosis than a smaller goitre"],answer:1},{question:"Doses of substances used in animal toxicity studies are usually many times greater than those experienced by people because:",subject:"nutrition",choices:["Animals are generally much less sensitive than people","Such tests can detect only very large risks because of the fact that only small numbers of animals can be used","It is difficult in such studies to determine whether the observed toxic effects were caused by the substance","It is the only way to ensure results are applicable to people"],answer:1},{question:"Rowena can paint a room in $14$ hours, while Ruby can paint it in $6$ hours. If Rowena paints for $x$ hours and Ruby paints for $y$ hours, they will finish half of the painting, while if Rowena paints for $y$ hours and Ruby paints for $x$ hours they will paint the whole room. Find the ordered pair $(x,y)$.",subject:"high_school_mathematics",choices:["(\\frac{11}{10}, \\frac{11}{10})","(\\frac{231}{20}, \\frac{21}{20})","(\\frac{231}{40}, \\frac{21}{40})","(1,1)"],answer:2},{question:"Which of the following statements would Macedo disagree with?",subject:"moral_disputes",choices:["States should give special weight to their own citizens.","Immigration policies can have powerful economic effects.","Self-governance is morally irrelevant to the immigration debate.","There are reasons to think U.S. immigration policy has had detrimental effects on income distribution among citizens."],answer:2},{question:"A 17-year-old girl is brought to the physician by her mother because she has not had a menstrual period for 6 months. The patient is unconcerned about the lack of menses. Menarche occurred at the age of 12 years, and menses had occurred at regular 28-day intervals until they became irregular 1 year ago. She is a member of her high school gymnastics team. She appears emaciated. She is 163 cm (5 ft 4 in) tall and weighs 40 kg (88 lb); BMI is 15 kg/m2 . Her pulse is 54/min, and blood pressure is 80/50 mm Hg. Which of the following is the most likely cause of this patient's amenorrhea?",subject:"professional_medicine",choices:["Hyperthyroidism","Hypogonadotropic hypogonadism","Hypothyroidism","Polycystic ovarian syndrome"],answer:1},{question:"The Yang-shao culture gave way to the Lung-Shan sometime after:",subject:"prehistory",choices:["6,000 B.P.","5,000 B.P.","4,000 B.P.","3,000 B.P."],answer:1},{question:"Cultural homogenization.",subject:"business_ethics",choices:["1,3,4","1,2,3","1,2,3,4","2,3,4"],answer:1},{question:"Of the ways of escaping moral arguments that he discusses, Hare claims:",subject:"philosophy",choices:["none of them are successful.","some, but not all of them are successful.","all are entirely successful.","all might be successful, but at a price."],answer:3},{question:"An employee of large manufacturing firm finds the work dull, and pursues the job only for the money. The employee performs minimally, and is not motivated so produce highest quantity or better quality. According to F. Herzberg's two-factor theory, the best way 10 increase this worker's self-motivation would be to",subject:"professional_psychology",choices:["offer a raise and incentive pay for greater productivity","redesign the job to provide a challenge and a sense of accomplishment","increase opportunities for informed social interaction","provide the employee with a job tide carrying greater prestige"],answer:1},{question:"In an e-commerce environment that requires that the information technology (IT) system be available on a continuous basis, more emphasis will be placed on which of the following aspects of the planning than in a traditional organization?",subject:"professional_accounting",choices:["Maintain appropriate written source documents so the data can be re-entered if it is lost or compromised","Maintain redundant systems for instant availability to assure the flow of transactions","Review additional expenses to obtain the required amount of business interruption insurance coverage for the organization","Assure that appropriate data backups are stored in an off-site location"],answer:1},{question:"The Space Shuttle orbits 300 km above the Earth\u2019s surface; the Earth\u2019s radius is 6400 km. What is the acceleration due to Earth\u2019s gravity experienced by the Space Shuttle?",subject:"high_school_physics",choices:["4.9 m/s^2","8.9 m/s^2","9.8 m/s^2","10.8 m/s^2"],answer:1},{question:"Statement 1 | The image of a group of 6 elements under a homomorphism may have 12 elements. Statement 2 | There is a homomorphism of some group of 6 elements into some group of 12 elements.",subject:"abstract_algebra",choices:["True, True","False, False","True, False","False, True"],answer:3},{question:"At which of the following locations does bile enter the digestive tract?",subject:"anatomy",choices:["Gastroesophageal sphincter","Duodenum","Ileocecum","Jejunum"],answer:1},{question:`This question refers to the following information.
|
|
1
|
+
var j="localmode-bench/4",W=2;var Ye=["You are helping a small public library plan its move to a new building across town.","The collection holds forty thousand books, two thousand audio recordings, and a local","history archive that must stay in labeled order. Volunteers are available on weekends","only, and the budget covers one rental truck. Describe a practical week-by-week moving","plan that keeps the library partially open, protects the archive, and finishes within","eight weeks. Be specific about labeling, sequencing, and volunteer coordination."].join(" "),Qe=["Read the following notes from a town planning meeting and then answer the question at the end.","The town of Milbrook has grown from eight thousand residents to eleven thousand in six years.","The old water treatment plant, built fifty years ago, operates at ninety two percent of its","rated capacity during summer months. An engineering survey found that the intake pipes show","corrosion consistent with their age but no immediate risk of failure. Replacing the plant","entirely would cost an estimated thirty one million dollars and take four years, during which","a temporary treatment module would be rented at two hundred thousand dollars per month.","Upgrading the existing plant in three phases would cost nineteen million dollars, take six","years, and raise capacity by forty percent, but phase two requires shutting one of the three","treatment trains for nine months. The town engineer favors the upgrade because the town can","fund it from reserves plus a small bond, avoiding a rate increase larger than four percent.","The finance director notes that construction costs have risen eleven percent in two years and","argues that delaying the full replacement will only make it more expensive, and that a larger","bond issued now at current rates would cost less over thirty years than a later one. Several","residents raised concerns about summer watering restrictions during phase two, and a local","manufacturer that employs three hundred people said an unreliable water supply would force it","to install its own storage tanks at significant cost. The mayor asked both officials to prepare","a comparison covering total cost of ownership over thirty years, resilience during construction,","capacity margins in the final state, and the effect on household water rates under three growth","scenarios: flat, moderate, and rapid. The engineer also mentioned that federal infrastructure","grants covering up to twenty percent of qualifying water projects open for applications next","spring, though awards are competitive and would delay the start by at least eight months either way.","Question: Write a balanced recommendation memo to the town council. Weigh both options against","the four criteria the mayor listed, account for the grant opportunity, and end with a clear","recommendation and two conditions under which the council should switch to the other option."].join(" "),ne=128,P=16,be=[{id:"chat-pp128-tg128",kind:"llm-generate",label:"Chat pp128/tg128",prompt:Ye,approxPromptTokens:128,maxTokens:ne,temperature:0},{id:"chat-pp512-tg128",kind:"llm-generate",label:"Long-context pp512/tg128",prompt:Qe,approxPromptTokens:512,maxTokens:ne,temperature:0}];function Xe(){let e=["the maintenance schedule for a fleet of electric delivery vans in a coastal city","a beginner guide to fermenting vegetables safely at home in small batches","the migration patterns of shorebirds along the Atlantic flyway in autumn","how a public library catalogs and preserves regional oral history recordings","the tradeoffs between timber framing and steel framing for small workshops","a training plan that prepares a new runner for a half marathon in twenty weeks","the way tide pools support diverse life despite extreme daily changes","budgeting practices for a volunteer-run community theater production"],t=[];for(let o=0;o<32;o++){let n=e[o%e.length];t.push(`Document ${o+1}: This passage explains ${n}. It covers the key steps, common mistakes, expected costs, and a short checklist that a careful reader can apply immediately, with concrete numbers where they matter.`);}return t}var ge=Xe(),ye=[{id:"embed-single",kind:"embed-single",label:"Embedding single-query latency",texts:[ge[0]]},{id:"embed-batch32",kind:"embed-batch",label:"Embedding batch-32 throughput",texts:ge}],we=[{id:"quality-mmlu-25",kind:"quality-mmlu",label:"tinyMMLU fidelity (25 items)",items:25},{id:"quality-mmlu-100",kind:"quality-mmlu",label:"tinyMMLU fidelity (100 items)",items:100},{id:"quality-sts-100",kind:"quality-sts",label:"STS-B Spearman (100 pairs)",items:100}],Je=new Map([...be,...ye,...we].map(e=>[e.id,e])),z=["transformers-wasm","transformers-webgpu","chrome-ai","webllm","mediapipe","litert","wllama-webgpu","wllama"];function oe(e){let t=new Map(z.map((o,n)=>[o,n]));return [...e].sort((o,n)=>(t.get(o.model.runtimeId)??z.length)-(t.get(n.model.runtimeId)??z.length))}var te={loadStallMs:18e4,loadTimeoutMs:45*6e4,chunkStallMs:12e4,iterationTimeoutMs:10*6e4,qualityTimeoutMs:30*6e4,maxAttempts:2,visibilityWaitMs:10*6e4},Ze={quick:{warmupRuns:1,timedRuns:3,cooldownMs:5e3,pressureGate:true,pressureGateTimeoutMs:15e3,measureWarmReload:false,highVarianceCv:.05,...te},standard:{warmupRuns:1,timedRuns:3,cooldownMs:8e3,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05,...te},thorough:{warmupRuns:1,timedRuns:5,cooldownMs:1e4,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05,...te,iterationTimeoutMs:15*6e4,qualityTimeoutMs:45*6e4}};var re={"transformers-webgpu":"estimated","transformers-wasm":"estimated",webllm:"chunk-count",wllama:"estimated","wllama-webgpu":"estimated",litert:"estimated","chrome-ai":"estimated",mediapipe:"estimated"};function w(){return typeof performance<"u"?performance.now():Date.now()}function ae(e=64){if(typeof performance>"u")return null;let t=[],o=performance.now(),n=0;for(;t.length<e&&n<2e6;){let a=performance.now();a>o&&(t.push(a-o),o=a),n++;}if(t.length===0)return null;let r=Math.min(...t);return Math.round(r*1e3*100)/100}function U(e,t){return new Promise((o,n)=>{if(t?.aborted){n(L());return}let r=setTimeout(()=>{t?.removeEventListener("abort",a),o();},e);function a(){clearTimeout(r),n(L());}t?.addEventListener("abort",a,{once:true});})}function L(){if(typeof DOMException<"u")return new DOMException("Aborted","AbortError");let e=new Error("Aborted");return e.name="AbortError",e}var F=class{events=[];disposers=[];hidden=false;lastPressureState;wakeLockSentinel=null;record(t,o){this.events.push({t:w(),type:t,...o!==void 0?{detail:o}:{}});}get isHidden(){return this.hidden}get pressureState(){return this.lastPressureState}get all(){return this.events}async attach(){if(typeof document<"u"){let n=()=>{this.hidden=document.visibilityState==="hidden",this.record(this.hidden?"visibility-hidden":"visibility-visible");};document.addEventListener("visibilitychange",n),this.disposers.push(()=>document.removeEventListener("visibilitychange",n)),this.hidden=document.visibilityState==="hidden";}let t=globalThis.PressureObserver;if(t)try{let n=new t(r=>{let a=r[r.length-1];if(a){let i=a.state!==this.lastPressureState;this.lastPressureState=a.state,i&&this.record("pressure-change",a.state);}});await n.observe("cpu",{sampleInterval:1e3}),this.disposers.push(()=>n.disconnect());}catch{}let o=typeof navigator<"u"?navigator.wakeLock:void 0;if(o)try{let n=await o.request("screen");this.wakeLockSentinel=n,this.record("wakelock-acquired"),n.addEventListener("release",()=>{this.record("wakelock-released"),this.wakeLockSentinel=null;});}catch{}}async dispose(){for(let t of this.disposers)t();if(this.disposers=[],this.wakeLockSentinel){try{await this.wakeLockSentinel.release();}catch{}this.wakeLockSentinel=null;}}};function G(){return typeof performance<"u"&&"measureUserAgentSpecificMemory"in performance&&typeof crossOriginIsolated<"u"&&crossOriginIsolated?"uaSpecific":typeof performance<"u"&&"memory"in performance&&typeof performance.memory?.usedJSHeapSize=="number"?"legacyHeap":"none"}async function N(e=25e3){let t=G();if(t==="uaSpecific")try{let o=await Promise.race([performance.measureUserAgentSpecificMemory(),new Promise(n=>setTimeout(()=>n(null),e))]);if(o&&typeof o.bytes=="number")return o.bytes}catch{}if(t!=="none"){let o=performance.memory;if(typeof o?.usedJSHeapSize=="number")return o.usedJSHeapSize}return null}var et=["maxBufferSize","maxStorageBufferBindingSize","maxUniformBufferBindingSize","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension","maxBindGroups","maxStorageBuffersPerShaderStage","maxTextureDimension2D"];async function ie(e){let t=typeof navigator<"u"?navigator:void 0,o=t?.userAgent??"",{browser:n,os:r,uaData:a}=await tt(t),i=await at(t),s=st(),l=await Me(),c=n.source==="ua-ch"?"Blink":ke(o);I(()=>{n.engine=c,t?.vendor&&(n.vendor=t.vendor),t&&typeof t.webdriver=="boolean"&&(n.webdriver=t.webdriver),t&&"pdfViewerEnabled"in t&&(n.pdfViewerEnabled=!!t.pdfViewerEnabled),t?.platform&&(r.navigatorPlatform=t.platform);});let m=ct(),u=dt();return {capturedAt:new Date().toISOString(),browser:n,os:r,hardware:{cores:t?.hardwareConcurrency??null,coresClamped:c==="WebKit"||c==="unknown",deviceMemoryGB:t&&"deviceMemory"in t?t.deviceMemory??null:null,deviceMemoryCapped:true,jsHeapSizeLimitBytes:m?.limit,jsHeapUsedBytes:m?.used},gpu:i,webglRenderer:s?.renderer??null,webgl:s??void 0,gpuModel:Ae(i,s?.renderer??null),flags:{crossOriginIsolated:typeof crossOriginIsolated<"u"?crossOriginIsolated:false,sharedArrayBuffer:typeof SharedArrayBuffer<"u",wasmSimd:l.simd,secureContext:typeof isSecureContext<"u"?isSecureContext:void 0,wasm:l},apis:await lt(t,i.available,s?.contextKind==="webgl2"),device:rt(t,o,a),storage:await ht(t),power:await pt(t),pressure:{supported:typeof globalThis<"u"&&"PressureObserver"in globalThis},timerResolutionUs:ae(),screen:u?{width:u.width,height:u.height,dpr:u.dpr}:null,display:u??void 0,network:ut(t),locale:mt(),languages:t?.languages?[...t.languages].slice(0,3):void 0,userAgent:o||void 0,pageOrigin:I(()=>typeof location<"u"?location.origin:void 0),visibilityState:I(()=>typeof document<"u"?document.visibilityState:void 0),userReportedDevice:e?.userReportedDevice}}function I(e){try{return e()}catch{return}}async function tt(e){let t=e&&"userAgentData"in e?e.userAgentData:void 0;if(t)try{let n=await t.getHighEntropyValues(["platform","platformVersion","architecture","bitness","model","fullVersionList","wow64","formFactors"]),r=n.fullVersionList??t.brands??[],a=r.find(i=>!/not.?a.?brand/i.test(i.brand)&&i.brand!=="Chromium")??r.find(i=>!/not.?a.?brand/i.test(i.brand));return {browser:{name:a?.brand??"Chromium",version:a?.version??"unknown",source:"ua-ch",brands:r.map(i=>({brand:i.brand,version:i.version}))},os:{platform:String(n.platform??"unknown"),version:String(n.platformVersion??"unknown"),architecture:n.architecture?String(n.architecture):void 0,bitness:n.bitness?String(n.bitness):void 0,model:n.model?String(n.model):void 0,wow64:typeof n.wow64=="boolean"?n.wow64:void 0},uaData:Object.assign(t,{formFactorsHint:Array.isArray(n.formFactors)?n.formFactors:void 0})}}catch{}let o=e?.userAgent??"";return {...ve(o),uaData:t}}function ve(e){return {browser:nt(e),os:ot(e)}}function nt(e){let t=[["Firefox iOS",/FxiOS\/(\d+[\d.]*)/],["Firefox",/Firefox\/(\d+[\d.]*)/],["Edge",/Edg(?:e|A|iOS)?\/(\d+[\d.]*)/],["Chrome iOS",/CriOS\/(\d+[\d.]*)/],["Safari",/Version\/(\d+[\d.]*).*Safari/],["Chrome",/Chrome\/(\d+[\d.]*)/]];for(let[o,n]of t){let r=e.match(n);if(r)return {name:o,version:r[1],source:"ua-parse"}}return {name:"unknown",version:"unknown",source:"ua-parse"}}function ot(e){let t="unknown";if(/Windows/.test(e)?t="Windows":/iPhone|iPad|iPod/.test(e)?t="iOS":/Mac OS X/.test(e)?t="macOS":/Android/.test(e)?t="Android":/CrOS/.test(e)?t="Chrome OS":/Linux/.test(e)&&(t="Linux"),t==="iOS"){let o=e.match(/OS (\d+(?:[_.]\d+)*) like Mac OS X/);if(o)return {platform:t,version:o[1].replace(/_/g,".")}}return {platform:t,version:"unknown-frozen"}}function ke(e){return e?/iPhone|iPad|iPod/.test(e)?"WebKit":/Gecko\/\d|Firefox\//.test(e)&&!/like Gecko/.test(e)?"Gecko":/Chrome\/|Chromium\/|Edg\//.test(e)?"Blink":/AppleWebKit\//.test(e)?"WebKit":"unknown":"unknown"}function Se(e){let{ua:t,maxTouchPoints:o,formFactors:n,mobile:r,platform:a}=e;if(a==="Android"||a==="iOS"||/Android|iPhone|iPad|iPod/.test(t))return /iPad/.test(t)?"tablet":/iPhone|iPod/.test(t)||/Mobile/.test(t)||r===true?"phone":o>1?"tablet":"phone";if(n&&n.length>0){let s=new Set(n.map(l=>l.toLowerCase()));if(s.has("xr"))return "xr";if(s.has("automotive")||s.has("tv"))return "tv";if(s.has("tablet"))return "tablet";if(s.has("mobile")||s.has("watch"))return "phone";if(s.has("desktop")||s.has("eink"))return "desktop"}return /iPad/.test(t)?"tablet":/iPhone|iPod/.test(t)?"phone":/Macintosh/.test(t)&&o>1?"tablet":/Android/.test(t)?/Mobile/.test(t)?"phone":"tablet":/CrKey|SmartTV|Tizen|Web0S|BRAVIA|AppleTV/i.test(t)?"tv":/Quest|OculusBrowser|VR\b|XR\b/i.test(t)?"xr":r===true?"phone":/Windows|Macintosh|Linux|CrOS/.test(t)?"desktop":"unknown"}function rt(e,t,o){if(e)return I(()=>{let n=typeof e.maxTouchPoints=="number"?e.maxTouchPoints:0,r=o?.formFactorsHint,a=o?.mobile,i=Se({ua:t,maxTouchPoints:n,formFactors:r,mobile:a,platform:o?.platform}),s=c=>typeof matchMedia=="function"?I(()=>matchMedia(c).matches):void 0,l=["fullscreen","standalone","minimal-ui","browser"].find(c=>s(`(display-mode: ${c})`)===!0);return {type:i,mobile:a??(i==="phone"||i==="tablet"),formFactors:r,maxTouchPoints:n,pointerCoarse:s("(pointer: coarse)"),hoverNone:s("(hover: none)"),displayMode:l}})}async function at(e){let t=e&&"gpu"in e?e.gpu:void 0;if(!t)return {available:false};try{let o=await Promise.race([t.requestAdapter(),new Promise(i=>setTimeout(()=>i(null),3e3))]);if(!o)return {available:!1};let n=o.info??{},r={},a=o.limits;if(a)for(let i of et){let s=a[i];typeof s=="number"&&(r[i]=s);}return {available:!0,vendor:R(n.vendor),architecture:R(n.architecture),device:R(n.device),description:R(n.description),subgroupMinSize:T(n.subgroupMinSize),subgroupMaxSize:T(n.subgroupMaxSize),isFallbackAdapter:typeof n.isFallbackAdapter=="boolean"?n.isFallbackAdapter:void 0,features:o.features?[...o.features].sort():void 0,limits:r,preferredCanvasFormat:I(()=>t.getPreferredCanvasFormat?.()),wgslLanguageFeatures:I(()=>t.wgslLanguageFeatures?[...t.wgslLanguageFeatures].sort():void 0)}}catch{return {available:false}}}function R(e){return typeof e=="string"&&e.length>0?e:void 0}function T(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var it=/swiftshader|llvmpipe|softpipe|software|mesa offscreen|microsoft basic render/i;function st(){try{if(typeof document>"u")return null;let e=document.createElement("canvas"),t="webgl2",o=e.getContext("webgl2");if(o||(t="webgl",o=e.getContext("webgl")),!o)return {contextKind:null};let n=o.getExtension("WEBGL_debug_renderer_info"),r=n?o.getParameter(n.UNMASKED_VENDOR_WEBGL):o.getParameter(o.VENDOR),a=n?o.getParameter(n.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),i={contextKind:t,vendor:R(r),renderer:R(a),version:R(o.getParameter(o.VERSION)),shadingLanguageVersion:R(o.getParameter(o.SHADING_LANGUAGE_VERSION)),maxTextureSize:T(o.getParameter(o.MAX_TEXTURE_SIZE)),maxRenderbufferSize:T(o.getParameter(o.MAX_RENDERBUFFER_SIZE)),maxVertexUniformVectors:T(o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS)),maxFragmentUniformVectors:T(o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS)),extensionCount:I(()=>o.getSupportedExtensions()?.length),softwareRenderer:typeof a=="string"?it.test(a):void 0};return I(()=>o.getExtension("WEBGL_lose_context")?.loseContext()),i}catch{return null}}function Ae(e,t){let o=e.description?.trim();if(o){let n=o.toLowerCase();if(!(n===e.vendor?.toLowerCase()||n===e.architecture?.toLowerCase()))return o}return Ie(t)}function Ie(e){if(!e)return;let t=e.match(/^ANGLE \((.*)\)$/);if(!t)return e.trim()||void 0;let o=t[1],n=[],r=0,a="";for(let s of o)s==="("&&r++,s===")"&&r--,s===","&&r===0?(n.push(a.trim()),a=""):a+=s;n.push(a.trim());let i=n.length>=2?n[1]:n[0];return i=i.replace(/^ANGLE Metal Renderer:\s*/i,""),i=i.replace(/\s*\(0x[0-9a-fA-F]+\)/g,"").replace(/\s+Direct3D\d+.*$/i,"").trim(),i||void 0}async function Me(){let e=i=>{try{return WebAssembly.validate(new Uint8Array(i))}catch{return false}},t=i=>{try{return new WebAssembly.Module(new Uint8Array(i)),!0}catch{return false}},o=i=>{try{return i()}catch{return false}},n=typeof WebAssembly<"u"?WebAssembly:void 0,r=n,a={simd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]),relaxedSimd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11]),threads:o(()=>(typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))),bulkMemory:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11]),exceptions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11]),exceptionsFinal:t([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,16,1,14,0,2,105,31,64,1,3,0,0,11,0,11,26,11]),extendedConst:e([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]),gc:e([0,97,115,109,1,0,0,0,1,5,1,95,1,120,0]),memory64:e([0,97,115,109,1,0,0,0,5,3,1,4,1]),multiMemory:t([0,97,115,109,1,0,0,0,5,5,2,0,0,0,0]),multiValue:e([0,97,115,109,1,0,0,0,1,6,1,96,0,2,127,127,3,2,1,0,10,8,1,6,0,65,0,65,0,11]),mutableGlobals:e([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1]),referenceTypes:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11]),saturatedFloatToInt:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11]),signExtensions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11]),tailCall:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,6,1,4,0,18,0,11]),typedFunctionReferences:t([0,97,115,109,1,0,0,0,1,16,3,96,1,127,1,127,96,1,100,0,1,127,96,0,1,127,3,4,3,1,0,2,9,5,1,3,0,1,1,10,28,3,11,0,65,10,65,42,32,0,20,0,106,11,7,0,32,0,65,1,106,11,6,0,210,1,16,0,11]),wideArithmetic:e([0,97,115,109,1,0,0,0,1,10,1,96,4,126,126,126,126,2,126,126,3,2,1,0,10,14,1,12,0,32,0,32,1,32,2,32,3,252,19,11]),jspi:o(()=>!!(r&&"Suspending"in r)),typeReflection:o(()=>!!(r&&"Function"in r)),streamingCompilation:o(()=>!!(r&&typeof r.compileStreaming=="function")),jsStringBuiltins:false};a.jsStringBuiltins=await(async()=>{try{if(!n)return !1;let i=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,111,1,127,2,23,1,14,119,97,115,109,58,106,115,45,115,116,114,105,110,103,4,116,101,115,116,0,0]);return await n.instantiate(i,{},{builtins:["js-string"]}),!0}catch{return false}})();for(let i of [65536,32768,16384])try{new WebAssembly.Memory({initial:1,maximum:i}),a.maxMemoryPages=i;break}catch{}return a}async function lt(e,t,o){if(!e)return;let n=globalThis,r=e,a=(c,m)=>I(()=>!!(c&&m in c))??false,i=await(async()=>{try{let c=e.storage;return c?.getDirectory?(await c.getDirectory(),!0):!1}catch{return false}})(),s=await(async()=>{try{let c=e.storage;return c?.persisted?await c.persisted():void 0}catch{return}})(),l=async c=>{try{let m=n[c];return m?.availability?await Promise.race([m.availability(),new Promise(u=>setTimeout(()=>u("timeout"),2e3))]):void 0}catch{return "error"}};return {webgpu:t,webgl2:o,webnn:a(r,"ml"),opfs:i,persistedStorage:s,indexedDB:a(n,"indexedDB"),cacheApi:a(n,"caches"),serviceWorker:a(r,"serviceWorker"),webWorkers:a(n,"Worker"),offscreenCanvas:a(n,"OffscreenCanvas"),webLocks:a(r,"locks"),broadcastChannel:a(n,"BroadcastChannel"),wakeLock:a(r,"wakeLock"),computePressure:a(n,"PressureObserver"),performanceMemory:a(typeof performance<"u"?performance:void 0,"memory"),measureUserAgentSpecificMemory:a(typeof performance<"u"?performance:void 0,"measureUserAgentSpecificMemory"),schedulerYield:a(n.scheduler,"yield"),webCodecs:a(n,"VideoDecoder"),audioWorklet:a(n,"AudioWorklet"),mediaDevices:a(r,"mediaDevices"),webTransport:a(n,"WebTransport"),promptApi:await l("LanguageModel"),summarizerApi:await l("Summarizer"),translatorApi:await(async()=>{try{let c=n.Translator;return c?.availability?await Promise.race([c.availability({sourceLanguage:"en",targetLanguage:"es"}),new Promise(m=>setTimeout(()=>m("timeout"),2e3))]):void 0}catch{return "error"}})(),languageDetectorApi:await l("LanguageDetector")}}function ct(){return I(()=>{let e=performance.memory;if(e)return {limit:T(e.jsHeapSizeLimit),used:T(e.usedJSHeapSize)}})}function dt(){if(typeof screen>"u")return null;try{let e=o=>typeof matchMedia=="function"?I(()=>matchMedia(o).matches):void 0,t=e("(prefers-color-scheme: dark)")?"dark":e("(prefers-color-scheme: light)")?"light":"no-preference";return {width:screen.width,height:screen.height,availWidth:T(screen.availWidth),availHeight:T(screen.availHeight),dpr:typeof devicePixelRatio<"u"?devicePixelRatio:1,colorDepth:T(screen.colorDepth),orientation:I(()=>screen.orientation?.type),viewportWidth:typeof innerWidth<"u"?innerWidth:void 0,viewportHeight:typeof innerHeight<"u"?innerHeight:void 0,hdr:e("(dynamic-range: high)"),wideGamut:e("(color-gamut: p3)"),isExtended:I(()=>screen.isExtended),prefersReducedMotion:e("(prefers-reduced-motion: reduce)"),prefersColorScheme:t}}catch{return null}}function ut(e){if(e)return I(()=>{let t=e.connection,o=typeof e.onLine=="boolean"?e.onLine:void 0;return t?{supported:!0,effectiveType:R(t.effectiveType),type:R(t.type),downlinkMbps:T(t.downlink),rttMs:T(t.rtt),saveData:typeof t.saveData=="boolean"?t.saveData:void 0,online:o}:{supported:!1,online:o}})}function mt(){return I(()=>{let e=Intl.DateTimeFormat().resolvedOptions();return {timeZone:R(e.timeZone),timeZoneOffsetMinutes:new Date().getTimezoneOffset(),locale:R(e.locale),calendar:R(e.calendar)}})}async function ht(e){try{if(!e?.storage?.estimate)return null;let t=await e.storage.estimate(),o=t.usageDetails;return {quotaBytes:t.quota??void 0,usageBytes:t.usage??void 0,usageDetails:o&&Object.keys(o).length>0?{...o}:void 0}}catch{return null}}async function pt(e){try{let t=e&&"getBattery"in e?e.getBattery:void 0;if(!t)return {batterySupported:!1};let o=await t.call(e),n=r=>typeof r=="number"&&Number.isFinite(r)?r:void 0;return {batterySupported:!0,charging:o.charging,level:o.level,chargingTimeSec:n(o.chargingTime),dischargingTimeSec:n(o.dischargingTime)}}catch{return {batterySupported:false}}}function ft(e){let t=e>>>0;return ()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295)}async function se(e){let t=e?.n??160,o=e?.minDurationMs??600,n=ft(780228),r=new Float32Array(t*t),a=new Float32Array(t*t);for(let f=0;f<t*t;f++)r[f]=n()-.5,a[f]=n()-.5;let i=new Float32Array(t*t),s=2*t*t*t,l=0,c=w(),m=0;for(;m<o;)gt(r,a,i,t),l++,m=w()-c,l%4===0&&await Promise.resolve();let u=0;for(let f=0;f<t*t;f+=97)u+=i[f];return {mflops:s*l/(m*1e3),n:t,iterations:l,durationMs:m,checksum:Math.fround(u)}}function gt(e,t,o,n){for(let r=0;r<n;r++)for(let a=0;a<n;a++){let i=0;for(let s=0;s<n;s++)i+=e[r*n+s]*t[s*n+a];o[r*n+a]=i;}}var Re=[12.706,4.303,3.182,2.776,2.571,2.447,2.365,2.306,2.262,2.228,2.201,2.179,2.16,2.145,2.131,2.12,2.11,2.101,2.093,2.086,2.08,2.074,2.069,2.064,2.06,2.056,2.052,2.048,2.045,2.042];function xe(e){return [...e].sort((t,o)=>t-o)}function K(e,t){if(e.length===0)throw new RangeError("quantile() requires a non-empty sample");if(t<0||t>1)throw new RangeError(`quantile q must be in [0,1], got ${t}`);let o=xe(e),n=(o.length-1)*t,r=Math.floor(n),a=Math.ceil(n);return r===a?o[r]:o[r]+(o[a]-o[r])*(n-r)}function Y(e){return K(e,.5)}function $(e){if(e.length===0)throw new RangeError("mean() requires a non-empty sample");let t=0;for(let o of e)t+=o;return t/e.length}function _e(e){if(e.length<2)return 0;let t=$(e),o=0;for(let n of e)o+=(n-t)*(n-t);return Math.sqrt(o/(e.length-1))}function bt(e){if(e.length===0)throw new RangeError("geomean() requires a non-empty sample");let t=0;for(let o of e){if(o<=0)throw new RangeError(`geomean() requires positive values, got ${o}`);t+=Math.log(o);}return Math.exp(t/e.length)}function x(e){if(e.length===0)throw new RangeError("summarize() requires a non-empty sample");let t=e.length,o=$(e),n=_e(e),r=xe(e),a=t>=2?Re[Math.min(t-2,Re.length-1)]*n/Math.sqrt(t):0;return {n:t,median:Y(e),mean:o,sd:n,iqr:K(e,.75)-K(e,.25),min:r[0],max:r[t-1],ci95:a,cv:o===0?0:n/Math.abs(o)}}function le(e,t){if(e.length!==t.length)throw new RangeError("spearman() requires equal-length samples");if(e.length<2)throw new RangeError("spearman() requires n >= 2");let o=Te(e),n=Te(t);return yt(o,n)}function Te(e){let t=e.map((r,a)=>[r,a]).sort((r,a)=>r[0]-a[0]),o=new Array(e.length),n=0;for(;n<t.length;){let r=n;for(;r+1<t.length&&t[r+1][0]===t[n][0];)r++;let a=(n+r)/2+1;for(let i=n;i<=r;i++)o[t[i][1]]=a;n=r+1;}return o}function yt(e,t){let o=$(e),n=$(t),r=0,a=0,i=0;for(let l=0;l<e.length;l++){let c=e[l]-o,m=t[l]-n;r+=c*m,a+=c*c,i+=m*m;}let s=Math.sqrt(a*i);return s===0?0:r/s}var H=[{question:"The number of days it takes to build a new house has a variance of 386. A sample of 40 new homes shows an average building time of 83 days. With what confidence can we assert that the average building time for a new house is between 80 and 90 days?",subject:"high_school_statistics",choices:["15.4%","17.8%","20.0%","82.1%"],answer:3},{question:"According to trials on diabetes prevention, high-risk individuals can reduce their risk to develop diabetes by doing the following:",subject:"nutrition",choices:["Eating a very low carbohydrate diet","Consuming a diet high in monounsaturated fats","Losing 5-7% of body weight through a hypocaloric low fat diet and 30 minutes of daily activity","Initiating metformin 850 mg BID and practicing daily vigorous exercise"],answer:2},{question:"Which of the following is true regarding the complications of a large goitre?",subject:"clinical_knowledge",choices:["It causes stridor due to compression of the oesophagus","Dysphagia is an indication for surgery","It causes hoarseness due to compression of the trachea","It causes a more florid thyrotoxicosis than a smaller goitre"],answer:1},{question:"Doses of substances used in animal toxicity studies are usually many times greater than those experienced by people because:",subject:"nutrition",choices:["Animals are generally much less sensitive than people","Such tests can detect only very large risks because of the fact that only small numbers of animals can be used","It is difficult in such studies to determine whether the observed toxic effects were caused by the substance","It is the only way to ensure results are applicable to people"],answer:1},{question:"Rowena can paint a room in $14$ hours, while Ruby can paint it in $6$ hours. If Rowena paints for $x$ hours and Ruby paints for $y$ hours, they will finish half of the painting, while if Rowena paints for $y$ hours and Ruby paints for $x$ hours they will paint the whole room. Find the ordered pair $(x,y)$.",subject:"high_school_mathematics",choices:["(\\frac{11}{10}, \\frac{11}{10})","(\\frac{231}{20}, \\frac{21}{20})","(\\frac{231}{40}, \\frac{21}{40})","(1,1)"],answer:2},{question:"Which of the following statements would Macedo disagree with?",subject:"moral_disputes",choices:["States should give special weight to their own citizens.","Immigration policies can have powerful economic effects.","Self-governance is morally irrelevant to the immigration debate.","There are reasons to think U.S. immigration policy has had detrimental effects on income distribution among citizens."],answer:2},{question:"A 17-year-old girl is brought to the physician by her mother because she has not had a menstrual period for 6 months. The patient is unconcerned about the lack of menses. Menarche occurred at the age of 12 years, and menses had occurred at regular 28-day intervals until they became irregular 1 year ago. She is a member of her high school gymnastics team. She appears emaciated. She is 163 cm (5 ft 4 in) tall and weighs 40 kg (88 lb); BMI is 15 kg/m2 . Her pulse is 54/min, and blood pressure is 80/50 mm Hg. Which of the following is the most likely cause of this patient's amenorrhea?",subject:"professional_medicine",choices:["Hyperthyroidism","Hypogonadotropic hypogonadism","Hypothyroidism","Polycystic ovarian syndrome"],answer:1},{question:"The Yang-shao culture gave way to the Lung-Shan sometime after:",subject:"prehistory",choices:["6,000 B.P.","5,000 B.P.","4,000 B.P.","3,000 B.P."],answer:1},{question:"Cultural homogenization.",subject:"business_ethics",choices:["1,3,4","1,2,3","1,2,3,4","2,3,4"],answer:1},{question:"Of the ways of escaping moral arguments that he discusses, Hare claims:",subject:"philosophy",choices:["none of them are successful.","some, but not all of them are successful.","all are entirely successful.","all might be successful, but at a price."],answer:3},{question:"An employee of large manufacturing firm finds the work dull, and pursues the job only for the money. The employee performs minimally, and is not motivated so produce highest quantity or better quality. According to F. Herzberg's two-factor theory, the best way 10 increase this worker's self-motivation would be to",subject:"professional_psychology",choices:["offer a raise and incentive pay for greater productivity","redesign the job to provide a challenge and a sense of accomplishment","increase opportunities for informed social interaction","provide the employee with a job tide carrying greater prestige"],answer:1},{question:"In an e-commerce environment that requires that the information technology (IT) system be available on a continuous basis, more emphasis will be placed on which of the following aspects of the planning than in a traditional organization?",subject:"professional_accounting",choices:["Maintain appropriate written source documents so the data can be re-entered if it is lost or compromised","Maintain redundant systems for instant availability to assure the flow of transactions","Review additional expenses to obtain the required amount of business interruption insurance coverage for the organization","Assure that appropriate data backups are stored in an off-site location"],answer:1},{question:"The Space Shuttle orbits 300 km above the Earth\u2019s surface; the Earth\u2019s radius is 6400 km. What is the acceleration due to Earth\u2019s gravity experienced by the Space Shuttle?",subject:"high_school_physics",choices:["4.9 m/s^2","8.9 m/s^2","9.8 m/s^2","10.8 m/s^2"],answer:1},{question:"Statement 1 | The image of a group of 6 elements under a homomorphism may have 12 elements. Statement 2 | There is a homomorphism of some group of 6 elements into some group of 12 elements.",subject:"abstract_algebra",choices:["True, True","False, False","True, False","False, True"],answer:3},{question:"At which of the following locations does bile enter the digestive tract?",subject:"anatomy",choices:["Gastroesophageal sphincter","Duodenum","Ileocecum","Jejunum"],answer:1},{question:`This question refers to the following information.
|
|
2
2
|
Is it not unity alone that can weld us into an effective force, capable of creating our own progress and making our valuable contribution to world peace? Which independent African state will claim that its financial structure and banking institutions are fully harnessed to its national development? Which will claim that its material resources and human energies are available for its own national aspirations? We are fast learning that political independence is not enough to rid us of the consequences of colonial rule. We have been too busy nursing our separate states to understand fully the basic need for union, rooted in common purpose, common planning and common endeavour.
|
|
3
3
|
Ghana's president, Kwame Nkrumah, addressing the Organization of African Unity, 1963
|
|
4
4
|
The speaker in the passage above is espousing which of the following causes?`,subject:"high_school_world_history",choices:["Nationalism","Socialism","Pan-Africanism","Neocolonialism"],answer:2},{question:"Monte Alban is located in the ________ and was built by the _________.",subject:"prehistory",choices:["Valley of Mexico; Aztec.","Valley of Oaxaca; Zapotec.","Amazon floodplain; Olmec.","Yucat\xE1n Peninsula; Maya."],answer:1},{question:`Sauna use, sometimes referred to as "sauna bathing," is characterized by short-term passive exposure to extreme heat. This exposure elicits mild hyperthermia \u2013 an increase in the body's core temperature \u2013 that induces a thermoregulatory response involving neuroendocrine, cardiovascular, and cytoprotective mechanisms that work together to restore homeostasis and condition the body for future heat stressors\u2026 In recent decades, sauna bathing has emerged as a means to increase lifespan and improve overall health, based on compelling data from observational, interventional, and mechanistic studies. Of particular interest are the findings from studies of participants in the Kuopio Ischemic Heart Disease Risk Factor (KIHD) Study, an ongoing prospective population-based cohort study of health outcomes in more than 2,300 middle-aged men from eastern Finland, which identified strong links between sauna use and reduced death and disease\u2026 The KIHD findings showed that men who used the sauna two to three times per week were 27 percent less likely to die from cardiovascular-related causes than men who didn't use the sauna.[2] Furthermore, the benefits they experienced were found to be dose-dependent: Men who used the sauna roughly twice as often, about four to seven times per week, experienced roughly twice the benefits \u2013 and were 50 percent less likely to die from cardiovascular-related causes.[2] In addition, frequent sauna users were found to be 40 percent less likely to die from all causes of premature death. These findings held true even when considering age, activity levels, and lifestyle factors that might have influenced the men's health.[2]... The KIHD also revealed that frequent sauna use reduced the risk of developing dementia and Alzheimer's disease in a dose-dependent manner. Men who used the sauna two to three times per week had a 66 percent lower risk of developing dementia and a 65 percent lower risk of developing Alzheimer's disease, compared to men who used the sauna only one time per week\u2026 The health benefits associated with sauna use extended to other aspects of mental health, as well. Men participating in the KIHD study who used the sauna four to seven times per week were 77 percent less likely to develop psychotic disorders, regardless of the men's dietary habits, socioeconomic status, physical activity, and inflammatory status (as measured by C-reactive protein)\u2026Exposure to high temperature stresses the body, eliciting a rapid, robust response. The skin and core body temperatures increase markedly, and sweating ensues. The skin heats first, rising to 40\xB0C (104\xB0F), and then changes in core body temperature occur, rising slowly from 37\xB0C (98.6\xB0F, or normal) to 38\xB0C (100.4\xB0F) and then rapidly increasing to 39\xB0C (102.2\xB0F)\u2026 Cardiac output, a measure of the amount of work the heart performs in response to the body's need for oxygen, increases by 60 to 70 percent, while the heart rate (the number of beats per minute) increases and the stroke volume (the amount of blood pumped) remains unchanged.[5] During this time, approximately 50 to 70 percent of the body's blood flow is redistributed from the core to the skin to facilitate sweating. The average person loses approximately 0.5 kg of sweat while sauna bathing.[11] Acute heat exposure also induces a transient increase in overall plasma volume to mitigate the decrease in core blood volume. This increase in plasma volume not only provides a reserve source of fluid for sweating, but it also acts like the water in a car's radiator, cooling the body to prevent rapid increases in core body temperature and promoting heat tolerance\u2026 Repeated sauna use acclimates the body to heat and optimizes the body's response to future exposures, likely due to a biological phenomenon known as hormesis, a compensatory defense response following exposure to a mild stressor that is disproportionate to the magnitude of the stressor. Hormesis triggers a vast array of protective mechanisms that not only repair cell damage but also provide protection from subsequent exposures to more devastating stressors\u2026 The physiological responses to sauna use are remarkably similar to those experienced during moderate- to vigorous-intensity exercise. In fact, sauna use has been proposed as an alternative to exercise for people who are unable to engage in physical activity due to chronic disease or physical limitations.[13]
|
|
@@ -31,9 +31,9 @@ ${e.question}
|
|
|
31
31
|
${o}
|
|
32
32
|
|
|
33
33
|
Answer with only the letter (A, B, C, or D) of the correct choice.${t??""}
|
|
34
|
-
Answer:`}function wt(e){let t=e.replace(/<think>[\s\S]*?<\/think>/gi," "),o=t.search(/<think>/i);return o===-1?t:t.slice(0,o)}function Q(e,t){let o=wt(e).trim(),n=o.replace(/[*`_]/g,"").trim(),r=n.match(/(?:^|(?:[Aa]nswer|ANSWER)\s*(?:is)?\s*[:-]?\s*|(?:[Oo]ption|OPTION|[Cc]hoice|CHOICE)\s*[:-]?\s*)\(?([ABCD])\)?(?=[\s.,)!]|$)/);if(r)return de.indexOf(r[1]);let a=n.match(/^\(?([abcd])(?:\)|\.|$)/);if(a)return de.indexOf(a[1].toUpperCase());let i=o.toLowerCase();for(let s=0;s<t.length;s++)if(i.startsWith(t[s].toLowerCase().slice(0,Math.max(8,t[s].length))))return s;return null}async function ue(e,t,o){let n=H.slice(0,t),r=[],a=[],i=0,s=0;for(let l=0;l<n.length;l++){if(o?.abortSignal?.aborted)throw L();let c=n[l],d=(await e.doGenerate({prompt:Pe(c,o?.promptSuffix),maxTokens:Ee,temperature:0,abortSignal:o?.abortSignal})).text.slice(0,Ce),f=Q(d,c.choices);f!==null&&s++;let h=f===c.answer?1:0;i+=h,r.push(h),a.push(d),o?.onProgress?.(l+1,n.length);}return {taskId:`tinymmlu-${t}`,score:n.length===0?0:i/n.length,n:n.length,details:r,outputs:a,parseRate:n.length===0?0:s/n.length}}function vt(e,t){let o=0,n=0,r=0;for(let i=0;i<e.length;i++)o+=e[i]*t[i],n+=e[i]*e[i],r+=t[i]*t[i];let a=Math.sqrt(n)*Math.sqrt(r);return a===0?0:o/a}async function me(e,t,o){let n=ce.slice(0,t),r=[],a=[];for(let i=0;i<n.length;i++){if(o?.abortSignal?.aborted)throw L();let s=n[i],{embeddings:l}=await e.doEmbed({values:[s.s1,s.s2],abortSignal:o?.abortSignal});r.push(vt(l[0],l[1])),a.push(s.score),o?.onProgress?.(i+1,n.length);}return {taskId:`stsb-${t}`,score:r.length>=2?le(r,a):0,n:n.length,details:r.map(i=>Math.round(i*1e4)/1e4)}}var kt=2,Le=.2,St=[{maxBytes:5e8,max:4e3},{maxBytes:1e9,max:2500},{maxBytes:2e9,max:1500},{maxBytes:Number.POSITIVE_INFINITY,max:1e3}],At=2e3,It=[/swiftshader/i,/llvmpipe/i,/softpipe/i,/\bwarp\b/i,/microsoft basic render/i,/parallels/i,/vmware/i,/virtio/i,/virtualbox/i];function Be(e){let t=[],o=i=>{t.length<50&&t.push(i);};if(typeof e!="object"||e===null)return ["result must be an object"];let n=e;n.protocol!==j&&o(`protocol must be "${j}"`),n.schemaVersion!==2&&o(`schemaVersion must be ${2}`),(typeof n.runId!="string"||n.runId.length<8||n.runId.length>64)&&o("runId must be a string (8-64 chars)"),(typeof n.createdAt!="string"||Number.isNaN(Date.parse(n.createdAt)))&&o("createdAt must be an ISO date string");let r=n.harness;(!r||typeof r.name!="string"||typeof r.version!="string")&&o("harness {name, version} is required"),["quick","standard","thorough","custom"].includes(n.suite)||o("suite must be quick|standard|thorough|custom");let a=n.environment;if(!a||typeof a!="object")o("environment is required");else {let i=a.browser;(!i||typeof i.name!="string")&&o("environment.browser.name is required"),(!a.os||typeof a.os.platform!="string")&&o("environment.os.platform is required");}return Array.isArray(n.cells)?n.cells.length===0?o("cells must not be empty"):n.cells.length>500?o("cells exceeds the 500-cell limit"):n.cells.forEach((i,s)=>Mt(i,s,o)):o("cells must be an array"),Array.isArray(n.events)||o("events must be an array"),t}function Mt(e,t,o){if(typeof e!="object"||e===null){o(`cells[${t}] must be an object`);return}let n=e,r=`cells[${t}]`;typeof n.cellId!="string"&&o(`${r}.cellId must be a string`),typeof n.runtimeId!="string"&&o(`${r}.runtimeId must be a string`),typeof n.workloadId!="string"&&o(`${r}.workloadId must be a string`),["ok","invalid","error","skipped"].includes(n.status)||o(`${r}.status must be ok|invalid|error|skipped`);let a=n.model;(!a||typeof a.benchModelId!="string"||typeof a.providerModelId!="string")&&o(`${r}.model {benchModelId, providerModelId} is required`);let i=n.quality;if(i&&Array.isArray(i.outputs)&&i.outputs.some(s=>typeof s!="string"||s.length>500)&&o(`${r}.quality.outputs must be strings of at most 500 chars`),!Array.isArray(n.iterations)){o(`${r}.iterations must be an array`);return}n.iterations.forEach((s,l)=>{if(typeof s!="object"||s===null){o(`${r}.iterations[${l}] must be an object`);return}let c=s;(typeof c.startT!="number"||typeof c.endT!="number")&&o(`${r}.iterations[${l}] needs numeric startT/endT`),"chunks"in c&&!Array.isArray(c.chunks)&&o(`${r}.iterations[${l}].chunks must be an array`),"text"in c&&typeof c.text=="string"&&c.text.length>2e4&&o(`${r}.iterations[${l}].text exceeds 20000 chars`);});}function qe(e){return e.length>0&&"chunks"in e[0]}function J(e){let t=e.chunks.filter(r=>r.c>0);if(t.length<2)return false;let o=t[t.length-1].t-t[0].t,n=e.endT-e.startT;return n>0&&o/n>=Le}function X(e,t=.05,o){let n={cellId:e.cellId,status:e.status,highVariance:false};if(e.load&&(n.loadMs=e.load.endT-e.load.startT,n.loadCached=e.load.cached),e.quality&&(n.qualityScore=e.quality.score,e.quality.parseRate!==void 0&&(n.qualityParseRate=e.quality.parseRate)),e.iterations.length===0)return n;if(qe(e.iterations)){let a=e.iterations.every(J);n.streamIncremental=a;let i=[],s=[],l=[],c=[],m=[],d=[],f=[];for(let h of e.iterations){let y=h.chunks.reduce((g,k)=>g+k.c,0),p=h.endT-h.startT;if(p>0&&(d.push(p),y>0&&f.push(y/p*1e3)),c.push(y),!a)continue;let u=h.chunks.find(g=>g.c>0);if(!u)continue;let b=u.t-h.startT;i.push(b);let S=h.chunks[h.chunks.length-1],I=y-u.c,v=S.t-u.t;v>0&&I>0&&(s.push(I/v*1e3),l.push((h.chunks.length-1)/v*1e3)),o&&b>0&&m.push(o/b*1e3);}i.length>0&&(n.ttftMs=x(i)),s.length>0&&(n.decodeCharsPerSec=x(s)),l.length>0&&(n.decodeChunksPerSec=x(l)),c.length>0&&(n.generatedChars=x(c)),m.length>0&&(n.prefillTokPerSecApprox=x(m)),d.length>0&&(n.totalMs=x(d)),f.length>0&&(n.overallCharsPerSec=x(f));}else {let a=e.iterations,i=a.map(s=>s.endT-s.startT).filter(s=>s>0);i.length>0&&(a[0].count===1?n.singleLatencyMs=x(i):n.batchTextsPerSec=x(a.filter(s=>s.endT-s.startT>0).map(s=>s.count/(s.endT-s.startT)*1e3)));}let r=[n.ttftMs,n.decodeCharsPerSec,n.overallCharsPerSec,n.singleLatencyMs,n.batchTextsPerSec];return n.highVariance=r.some(a=>a!==void 0&&a.n>=2&&a.cv>t),n}function O(e,t=.05,o){let r=o??new Map([["chat-pp128-tg128",128],["chat-pp512-tg128",512]]);return e.cells.map(a=>X(a,t,r.get(a.workloadId)))}function je(e){let t=[],o=(s,l,c,m)=>t.push({code:s,message:l,severity:c,...m?{cellId:m}:{}});e.fingerprint?(e.fingerprint.mflops<=1||e.fingerprint.mflops>1e5||!Number.isFinite(e.fingerprint.checksum))&&o("fingerprint-implausible",`fingerprint mflops=${e.fingerprint.mflops}`,"reject"):o("fingerprint-missing","no hardware fingerprint in submission","reject");let n=e.environment.timerResolutionUs;for(let s of e.cells)if(s.status==="ok"){if(s.load&&s.load.endT<s.load.startT&&o("load-time-reversed","load endT precedes startT","reject",s.cellId),qe(s.iterations)){for(let d of s.iterations){let f=d.startT,h=true;for(let p of d.chunks)p.t<f&&(h=false),f=p.t;if(!h||d.endT<f){o("trace-not-monotonic","chunk timestamps are not monotonic","reject",s.cellId);break}let y=d.chunks.reduce((p,u)=>p+u.c,0);if(d.text.length!==y){o("text-chunk-mismatch",`text length ${d.text.length} != chunk sum ${y}`,"reject",s.cellId);break}}let l=X(s);s.iterations.some(d=>d.text.length<P)&&o("degenerate-generation",`an ok cell has a timed iteration with fewer than ${P} generated chars`,"reject",s.cellId);let c=s.model.sizeBytes??Number.POSITIVE_INFINITY,m=St.find(d=>c<=d.maxBytes);if(m&&l.decodeCharsPerSec&&l.decodeCharsPerSec.median>m.max&&o("decode-rate-envelope",`decode ${Math.round(l.decodeCharsPerSec.median)} chars/s exceeds envelope ${m.max} for model size`,"reject",s.cellId),m&&l.overallCharsPerSec&&l.overallCharsPerSec.median>m.max&&o("overall-rate-envelope",`overall ${Math.round(l.overallCharsPerSec.median)} chars/s exceeds envelope ${m.max} for model size`,"reject",s.cellId),l.ttftMs&&l.ttftMs.median<1&&o("ttft-implausible",`median TTFT ${l.ttftMs.median}ms < 1ms`,"reject",s.cellId),n!=null&&n>=4){let d=n/1e3,f=0,h=0;for(let y of s.iterations)for(let p of y.chunks)h++,Math.abs(p.t/d-Math.round(p.t/d))>.01&&f++;h>=20&&f/h>.5&&o("timer-grid",`${f}/${h} chunk timestamps off the ${n}us timer grid`,"warn",s.cellId);}}else if(s.quality?.taskId.startsWith("tinymmlu")&&s.quality.outputs){let{outputs:l,details:c,score:m,n:d}=s.quality;if(l.length!==d||!c||c.length!==d)o("quality-outputs-mismatch","quality outputs/details length disagrees with n","reject",s.cellId);else {let f=0,h=true;for(let y=0;y<d;y++){let p=H[y];if(!p)break;let u=Q(l[y],p.choices)===p.answer?1:0;f+=u,u!==c[y]&&(h=false);}(!h||Math.abs(f/d-m)>1e-9)&&o("quality-details-mismatch",`submitted MMLU score ${m} disagrees with recompute ${f/d} from raw outputs`,"reject",s.cellId);}}else if(s.iterations.length>0){let l=X(s);l.batchTextsPerSec&&l.batchTextsPerSec.median>At&&o("embed-rate-envelope",`embedding throughput ${Math.round(l.batchTextsPerSec.median)} texts/s exceeds envelope`,"reject",s.cellId),l.singleLatencyMs&&l.singleLatencyMs.median<.05&&o("embed-latency-implausible","sub-50us embedding latency","reject",s.cellId);}}let r=e.environment.gpu.vendor?.toLowerCase()??"",a=e.environment.os.platform.toLowerCase();r==="apple"&&a.includes("windows")&&o("env-cross-field","Apple GPU adapter with Windows platform","reject");let i=[e.environment.gpu.vendor,e.environment.gpu.architecture,e.environment.gpu.device,e.environment.gpu.description,e.environment.webglRenderer].filter(Boolean).join(" ");if(It.some(s=>s.test(i))){let s=e.cells.some(l=>l.status==="ok"&&/webgpu|^gpu$/.test(l.resolvedBackend));o("software-renderer",`GPU identity matches a software/virtual renderer: "${i.slice(0,120)}"`,s?"reject":"warn");}return t}function Rt(e){let t=Be(e);if(t.length>0)return {ok:false,shapeErrors:t,flags:[],summaries:[]};let o=O(e),n=je(e);if(e.clientSummaries){let r=new Map(o.map(a=>[a.cellId,a]));for(let a of e.clientSummaries){let i=r.get(a.cellId);if(i)for(let s of ["ttftMs","decodeCharsPerSec","totalMs","overallCharsPerSec","singleLatencyMs","batchTextsPerSec"]){let l=a[s]?.median,c=i[s]?.median;l!==void 0&&c!==void 0&&c!==0&&Math.abs(l-c)/Math.abs(c)>.01&&n.push({code:"client-summary-disagrees",cellId:a.cellId,message:`${s} client median ${l} vs recomputed ${c}`,severity:"reject"});}}}return {ok:n.every(r=>r.severity!=="reject"),shapeErrors:[],flags:n,summaries:o}}async function Tt(e){let{policy:t,hooks:o,abortSignal:n}=e,r=e.trace??new F;await r.attach(),r.record("suite-start",e.suite);let a=G(),i=[];try{o?.onPhase?.("environment");let s=await ie({userReportedDevice:e.userReportedDevice});o?.onEnvironment?.(s),o?.onPhase?.("fingerprint"),_(n);let l=e.skipFingerprint?null:await se(),c=a!=="none"?await N():null,m=xt(oe(e.cells)),d=e.cells.length,f=0;for(let y of m){_(n);let p=await _t(y,{...e,trace:r,memApi:a,baselineMemory:c,cellIndexRef:()=>f++,totalCells:d});i.push(...p),r.record("cooldown-start"),await U(t.cooldownMs,n).catch(u=>{if(u.name==="AbortError")throw u}),t.pressureGate&&await Pt(r,t.pressureGateTimeoutMs,n),r.record("cooldown-end");}r.record("suite-end");let h={protocol:j,schemaVersion:2,runId:qt(),createdAt:new Date().toISOString(),harness:e.harness,suite:e.suite,environment:s,fingerprint:l,cells:i,events:[...r.all]};return h.clientSummaries=O(h,t.highVarianceCv),h}finally{await r.dispose();}}function xt(e){let t=new Map;for(let o of e){let n=`${o.model.runtimeId}/${o.model.benchModelId}/${o.model.providerModelId}`,r=t.get(n);r||(r={key:n,model:o.model,workloads:[],skipped:[]},t.set(n,r)),o.skipReason?r.skipped.push({workload:o.workload,reason:o.skipReason}):r.workloads.push(o.workload);}return [...t.values()]}async function _t(e,t){let{model:o}=e,n=o.task==="embedding",r=n?t.embedAdapters.get(o.runtimeId):t.llmAdapters.get(o.runtimeId),a=[],i=p=>({cellId:`${o.runtimeId}/${o.benchModelId}/${p.id}`,runtimeId:o.runtimeId,runtimeVersion:r?.runtimeVersion,model:o,workloadId:p.id,workloadKind:p.kind,resolvedBackend:"unknown",load:null,iterations:[],status:"skipped"});for(let{workload:p,reason:u}of e.skipped){let b=i(p);b.invalidReasons=[u],a.push(D(b,t));}if(e.workloads.length===0)return a;if(!r){for(let p of e.workloads){let u=i(p);u.invalidReasons=[`no adapter registered for ${o.runtimeId}`],a.push(D(u,t));}return a}let s=await r.isAvailable();if(!s.ok){for(let p of e.workloads){let u=i(p);u.invalidReasons=[`runtime unavailable: ${s.reason??"unknown"}`],a.push(D(u,t));}return a}let l=null,c=null,m,d=null,f=[],h=`${o.runtimeId}/${o.benchModelId}/${e.workloads[0].id}`;for(let p=1;p<=Math.max(1,t.policy.maxAttempts);p++)try{_(t.abortSignal);let u=await r.isModelCached(o),b=[],S=w();t.hooks?.onActivity?.({cellId:h,phase:"load"}),l=await B((v,g)=>r.load(o,{abortSignal:v,onProgress:k=>{g(),typeof k.pct=="number"&&(b.length===0||k.pct-b[b.length-1].pct>=2)&&b.push({t:w(),pct:Math.round(k.pct*100)/100}),t.hooks?.onLoadProgress?.(h,k.pct),t.hooks?.onActivity?.({cellId:h,phase:"load",pct:k.pct});}}),{parent:t.abortSignal,stallMs:t.policy.loadStallMs,timeoutMs:t.policy.loadTimeoutMs,what:"load"});let I=w();if(c={cached:u,startT:S,endT:I,progress:b.length>0?Lt(b,50):void 0,declaredBytes:o.sizeBytes},t.memApi!=="none"&&(d=await N()),t.policy.warmupRuns>0){let v=w();for(let g=0;g<t.policy.warmupRuns;g++){_(t.abortSignal);let k=l;t.hooks?.onActivity?.({cellId:h,phase:"warmup",iteration:g+1,total:t.policy.warmupRuns,chars:0,chunks:0}),await B((M,C)=>n?k.model.doEmbed({values:["warmup probe"],abortSignal:M}):Ue(k.model,{prompt:"Reply with the single word: ready",maxTokens:4,temperature:0},M,(Ge,Ke)=>{C(),t.hooks?.onActivity?.({cellId:h,phase:"warmup",chars:Ge,chunks:Ke});}),{parent:t.abortSignal,stallMs:t.policy.chunkStallMs,timeoutMs:t.policy.iterationTimeoutMs,what:"warmup"}),t.hooks?.onActivity?.({cellId:h,phase:"warmup",iteration:g+1,total:t.policy.warmupRuns});}m=w()-v;}break}catch(u){if(u.name==="AbortError")throw l&&await V(l),u;l&&await V(l),l=null;let b=We(u);if(b.name==="TimeoutError"&&t.trace.record("cell-timeout",`${h}: ${b.message}`),p<Math.max(1,t.policy.maxAttempts)){f.push({error:b,at:w()}),t.trace.record("cell-retry",`${h} attempt ${p+1}`),t.hooks?.onCellRetry?.(h,p+1,b);continue}let S=t.memApi!=="none"?await N(5e3):null;for(let I of e.workloads){let v=i(I);v.status="error",v.load=c,v.error=b,f.length>0&&(v.attempts=[...f]),t.memApi!=="none"&&(v.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:d??void 0,atError:S??void 0}),a.push(D(v,t));}return a}if(!l)return a;let y=false;for(let p of e.workloads){_(t.abortSignal);let u=i(p);u.resolvedBackend=l.resolvedBackend,l.runtimeConfig&&(u.runtimeConfig={...l.runtimeConfig}),y||(u.load=c,u.warmupMs=m,f.length>0&&(u.attempts=[...f]),y=true);let b=t.cellIndexRef();t.hooks?.onCellStart?.(u.cellId,b,t.totalCells);let S=l,I=async()=>{switch(p.kind){case "llm-generate":await Et(u,S,p,t);break;case "embed-single":case "embed-batch":await Ct(u,S,p,t);break;case "quality-mmlu":{let g=p.items;u.quality=await B((k,M)=>ue(S.model,g,{abortSignal:k,onProgress:C=>{M(),t.hooks?.onIteration?.(u.cellId,C,g),t.hooks?.onActivity?.({cellId:u.cellId,phase:"quality",iteration:C,total:g});},promptSuffix:o.qualityPromptSuffix}),{parent:t.abortSignal,stallMs:t.policy.chunkStallMs,timeoutMs:t.policy.qualityTimeoutMs,what:"quality lane"}),u.status="ok";break}case "quality-sts":{let g=p.items;u.quality=await B((k,M)=>me(S.model,g,{abortSignal:k,onProgress:C=>{M(),t.hooks?.onIteration?.(u.cellId,C,g),t.hooks?.onActivity?.({cellId:u.cellId,phase:"quality",iteration:C,total:g});}}),{parent:t.abortSignal,stallMs:t.policy.chunkStallMs,timeoutMs:t.policy.qualityTimeoutMs,what:"quality lane"}),u.status="ok";break}}},v=Math.max(1,t.policy.maxAttempts);for(let g=1;g<=v;g++)try{await I();break}catch(k){if(k.name==="AbortError")throw await V(l),k;let M=We(k);if(M.name==="TimeoutError"&&t.trace.record("cell-timeout",`${u.cellId}: ${M.message}`),g<v){u.attempts=[...u.attempts??[],{error:M,at:w()}],u.iterations=[],u.quality=void 0,u.invalidReasons=void 0,u.status="skipped",t.trace.record("cell-retry",`${u.cellId} attempt ${g+1}`),t.hooks?.onCellRetry?.(u.cellId,g+1,M);continue}u.status="error",u.error=M;}if(t.memApi!=="none"&&(u.status==="ok"||u.status==="error")){let g=await N(5e3);u.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:d??void 0,...u.status==="ok"?{postRun:g??void 0}:{atError:g??void 0}};}a.push(D(u,t));}if(await V(l),t.policy.measureWarmReload&&c?.cached===false)try{_(t.abortSignal);let p=`${o.runtimeId}/${o.benchModelId}/warm-reload`;t.hooks?.onActivity?.({cellId:p,phase:"reload"});let u=w(),b=await B((v,g)=>r.load(o,{abortSignal:v,onProgress:k=>{g(),t.hooks?.onActivity?.({cellId:p,phase:"reload",pct:k.pct});}}),{parent:t.abortSignal,stallMs:t.policy.loadStallMs,timeoutMs:t.policy.loadTimeoutMs,what:"load"}),S=w();await V(b);let I={cellId:`${o.runtimeId}/${o.benchModelId}/warm-reload`,runtimeId:o.runtimeId,runtimeVersion:r.runtimeVersion,model:o,workloadId:"warm-reload",workloadKind:"llm-generate",resolvedBackend:b.resolvedBackend,...b.runtimeConfig?{runtimeConfig:{...b.runtimeConfig}}:{},load:{cached:!0,startT:u,endT:S,declaredBytes:o.sizeBytes},iterations:[],status:"ok"};a.push(D(I,t));}catch(p){if(p.name==="AbortError")throw p}return a}async function Et(e,t,o,n){let r=[],a=[];for(let i=0;i<n.policy.timedRuns;i++){let s=i+1;for(let l=0;;l++){_(n.abortSignal),n.hooks?.onIteration?.(e.cellId,s,n.policy.timedRuns),await De(n,e.cellId);let c=[];n.trace.isHidden&&c.push("started-hidden");let m=ee(n.trace);n.hooks?.onActivity?.({cellId:e.cellId,phase:"iteration",iteration:s,total:n.policy.timedRuns,chars:0,chunks:0});let d=w(),{chunks:f,text:h,providerUsage:y,finishReason:p}=await B((S,I)=>Ue(t.model,{prompt:o.prompt,systemPrompt:o.systemPrompt,maxTokens:o.maxTokens,temperature:o.temperature},S,(v,g)=>{I(),n.hooks?.onActivity?.({cellId:e.cellId,phase:"iteration",iteration:s,total:n.policy.timedRuns,chars:v,chunks:g});}),{parent:n.abortSignal,stallMs:n.policy.chunkStallMs,timeoutMs:n.policy.iterationTimeoutMs,what:`iteration ${s}`}),u=w();ee(n.trace)>m&&c.push("hidden-during-run"),h.length<P&&c.push("degenerate-output");let b={startT:d,chunks:f,endT:u,text:h,providerUsage:y?{...y,fidelity:re[e.runtimeId]}:void 0,finishReason:p,gates:c};if(Ne(c)&&l<Math.max(1,n.policy.maxAttempts)){a.push(b),n.trace.record("iteration-redo",`${e.cellId} iteration ${s}: ${c.join(",")}`);continue}r.push(b);break}}e.iterations=r,a.length>0&&(e.discardedIterations=a),Oe(e,r);}function Ne(e){return e.includes("started-hidden")||e.includes("hidden-during-run")}function Oe(e,t){let o=t.some(n=>n.gates.length>0);if(e.status=o?"invalid":"ok",o){let n=new Set;for(let r of t)for(let a of r.gates)n.add(a==="degenerate-output"?`degenerate output: fewer than ${P} generated chars in a timed iteration`:a==="started-hidden"||a==="hidden-during-run"?"tab hidden during a timed iteration (the tab did not return in time for a repeat)":"validity gate fired during a timed region");e.invalidReasons=[...n];}}async function De(e,t){if(!e.trace.isHidden)return true;e.hooks?.onActivity?.({cellId:t,phase:"waiting-visible"});let o=w()+e.policy.visibilityWaitMs;for(;e.trace.isHidden&&w()<o;)_(e.abortSignal),await U(Math.min(250,e.policy.visibilityWaitMs),e.abortSignal);return !e.trace.isHidden}async function Ct(e,t,o,n){let r=[],a=[];for(let i=0;i<n.policy.timedRuns;i++)for(let s=0;;s++){_(n.abortSignal),n.hooks?.onIteration?.(e.cellId,i+1,n.policy.timedRuns),await De(n,e.cellId);let l=[];n.trace.isHidden&&l.push("started-hidden");let c=ee(n.trace),m=w(),{embeddings:d}=await B(y=>t.model.doEmbed({values:o.texts,abortSignal:y}),{parent:n.abortSignal,stallMs:n.policy.iterationTimeoutMs,timeoutMs:n.policy.iterationTimeoutMs,what:`iteration ${i+1}`}),f=w();ee(n.trace)>c&&l.push("hidden-during-run"),n.hooks?.onActivity?.({cellId:e.cellId,phase:"iteration",iteration:i+1,total:n.policy.timedRuns});let h={startT:m,endT:f,count:o.texts.length,dimensions:d[0]?.length??t.model.dimensions,gates:l};if(Ne(l)&&s<Math.max(1,n.policy.maxAttempts)){a.push(h),n.trace.record("iteration-redo",`${e.cellId} iteration ${i+1}: ${l.join(",")}`);continue}r.push(h);break}e.iterations=r,a.length>0&&(e.discardedIterations=a),Oe(e,r);}async function Ue(e,t,o,n){let r=[],a="",i,s;if(e.doStream)for await(let l of e.doStream({...t,abortSignal:o})){let c=w();l.text.length>0&&(r.push({t:c,c:l.text.length}),a+=l.text,n?.(a.length,r.length)),l.done&&(i=l.usage,s=l.finishReason);}else {let l=await e.doGenerate({...t,abortSignal:o}),c=w();a=l.text,r.push({t:c,c:l.text.length}),n?.(a.length,r.length),i=l.usage,s=l.finishReason;}return {chunks:r,text:a,providerUsage:i,finishReason:s}}var Z=class extends Error{constructor(t){super(t),this.name="TimeoutError";}};async function B(e,t){let o=new AbortController,n=()=>o.abort(t.parent?.reason);t.parent?.aborted&&n(),t.parent?.addEventListener("abort",n,{once:true});let r=w(),a=r,i=false,s=()=>{},l=new Promise((h,y)=>{s=y;}),c=h=>{i||(i=true,o.abort(new Z(h)),s(new Z(h)));},d=setInterval(()=>{if(i)return;let h=w();if(h-a>=t.stallMs){c(t.what==="load"?`load made no progress for ${t.stallMs} ms`:`${t.what}: no stream progress for ${t.stallMs} ms`);return}h-r>=t.timeoutMs&&c(`${t.what}: exceeded the ${t.timeoutMs} ms budget`);},Math.max(10,Math.min(t.stallMs,t.timeoutMs)/4)),f=()=>{a=w();};try{return await Promise.race([e(o.signal,f),l])}finally{i=true,clearInterval(d),t.parent?.removeEventListener("abort",n);}}function ee(e){let t=0;for(let o of e.all)o.type==="visibility-hidden"&&t++;return t}async function Pt(e,t,o){let n=w()+t;for(;w()<n;){let r=e.pressureState;if(r===void 0||r==="nominal"||r==="fair")return;await U(1e3,o);}}function Lt(e,t){if(e.length<=t)return e;let o=[],n=(e.length-1)/(t-1);for(let r=0;r<t;r++)o.push(e[Math.round(r*n)]);return o}var Bt=4e3;function We(e){let t=e,o=t?.cause,n=o instanceof Error?o.message:typeof o=="string"?o:void 0,r=o instanceof Error&&o.name&&o.name!=="Error"?o.name:void 0,a=o instanceof Error&&typeof o.stack=="string"&&o.stack.length>0?o.stack.slice(0,Bt):void 0;return {name:t?.name??"Error",message:t?.message??String(e),...n!==void 0?{cause:n}:{},...r?{causeName:r}:{},...a?{causeStack:a}:{}}}function D(e,t){return t.hooks?.onCellFinish?.(e),e}async function V(e){try{await e.dispose();}catch{}}function _(e){if(e?.aborted)throw L()}function qt(){let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();let t=new Uint8Array(16);if(e?.getRandomValues)e.getRandomValues(t);else for(let n=0;n<16;n++)t[n]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let o=[...t].map(n=>n.toString(16).padStart(2,"0")).join("");return `${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}function Fe(e){return he(e)}function he(e){if(e===null||typeof e=="number"||typeof e=="boolean"||typeof e=="string")return JSON.stringify(e);if(typeof e>"u")return "null";if(Array.isArray(e))return `[${e.map(t=>he(t)).join(",")}]`;if(typeof e=="object")return `{${Object.entries(e).filter(([,o])=>o!==void 0).sort(([o],[n])=>o<n?-1:o>n?1:0).map(([o,n])=>`${JSON.stringify(o)}:${he(n)}`).join(",")}}`;throw new TypeError(`canonicalJson: unsupported value type ${typeof e}`)}async function $e(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("Web Crypto (crypto.subtle) is not available in this environment");let o=new TextEncoder().encode(e),n=await t.digest("SHA-256",o);return [...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function He(e){let{digest:t,...o}=e;return $e(Fe(o))}async function jt(e){return e.digest?await He(e)===e.digest:false}function fe(e){let t=e.environment,o=t.gpu.available?[t.gpu.vendor??"gpu",t.gpu.architecture].filter(Boolean).join("-"):"no-webgpu";return [t.os.platform.toLowerCase().replace(/\s+/g,"-"),o].join("/")}var ze=3;function Wt(e,t=ze){let o=new Map;for(let r of e){let a=fe(r),i=r.clientSummaries??O(r),s=new Map(i.map(l=>[l.cellId,l]));for(let l of r.cells){if(l.status!=="ok")continue;let c=s.get(l.cellId);if(!c)continue;let m=[a,l.runtimeId,l.model.benchModelId,l.workloadId].join("|"),d=o.get(m);d||(d={row:{deviceClass:a,runtimeId:l.runtimeId,benchModelId:l.model.benchModelId,modelName:l.model.displayName,workloadId:l.workloadId,resolvedBackends:[],browsers:[],highVariance:false},ttft:[],decode:[],overall:[],single:[],batch:[],loadCold:[],loadWarm:[],quality:[],parseRate:[],runIds:new Set},o.set(m,d)),d.runIds.add(r.runId),Ve(d.row.resolvedBackends,l.resolvedBackend),Ve(d.row.browsers,r.environment.browser.name),d.row.highVariance||=c.highVariance,c.ttftMs&&d.ttft.push(c.ttftMs.median),c.decodeCharsPerSec&&d.decode.push(c.decodeCharsPerSec.median),c.overallCharsPerSec&&d.overall.push(c.overallCharsPerSec.median),c.singleLatencyMs&&d.single.push(c.singleLatencyMs.median),c.batchTextsPerSec&&d.batch.push(c.batchTextsPerSec.median),c.loadMs!==void 0&&(c.loadCached?d.loadWarm:d.loadCold).push(c.loadMs),c.qualityScore!==void 0&&d.quality.push(c.qualityScore),c.qualityParseRate!==void 0&&d.parseRate.push(c.qualityParseRate);}}let n=[];for(let r of o.values())n.push({...r.row,submissions:r.runIds.size,ttftMs:E(r.ttft),decodeCharsPerSec:E(r.decode),overallCharsPerSec:E(r.overall),singleLatencyMs:E(r.single),batchTextsPerSec:E(r.batch),loadColdMs:E(r.loadCold),loadWarmMs:E(r.loadWarm),qualityScore:E(r.quality),qualityParseRate:E(r.parseRate),provisional:r.runIds.size<t});return n.sort((r,a)=>r.deviceClass.localeCompare(a.deviceClass)||r.benchModelId.localeCompare(a.benchModelId)||r.runtimeId.localeCompare(a.runtimeId)||r.workloadId.localeCompare(a.workloadId)),n}function Ve(e,t){t&&!e.includes(t)&&e.push(t);}function E(e){return e.length>0?q(Y(e)):void 0}function q(e){return Math.round(e*100)/100}function pe(e){let t=e==null?"":String(e);return /[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function Nt(e){let o=[["deviceClass","runtimeId","benchModelId","modelName","workloadId","submissions","ttftMs","decodeCharsPerSec","overallCharsPerSec","singleLatencyMs","batchTextsPerSec","loadColdMs","loadWarmMs","qualityScore","qualityParseRate","resolvedBackends","browsers","highVariance","provisional"].join(",")];for(let n of e)o.push([n.deviceClass,n.runtimeId,n.benchModelId,n.modelName,n.workloadId,n.submissions,n.ttftMs,n.decodeCharsPerSec,n.overallCharsPerSec,n.singleLatencyMs,n.batchTextsPerSec,n.loadColdMs,n.loadWarmMs,n.qualityScore,n.qualityParseRate,n.resolvedBackends.join(";"),n.browsers.join(";"),n.highVariance,n.provisional].map(pe).join(","));return o.join(`
|
|
34
|
+
Answer:`}function wt(e){let t=e.replace(/<think>[\s\S]*?<\/think>/gi," "),o=t.search(/<think>/i);return o===-1?t:t.slice(0,o)}function Q(e,t){let o=wt(e).trim(),n=o.replace(/[*`_]/g,"").trim(),r=n.match(/(?:^|(?:[Aa]nswer|ANSWER)\s*(?:is)?\s*[:-]?\s*|(?:[Oo]ption|OPTION|[Cc]hoice|CHOICE)\s*[:-]?\s*)\(?([ABCD])\)?(?=[\s.,)!]|$)/);if(r)return de.indexOf(r[1]);let a=n.match(/^\(?([abcd])(?:\)|\.|$)/);if(a)return de.indexOf(a[1].toUpperCase());let i=o.toLowerCase();for(let s=0;s<t.length;s++)if(i.startsWith(t[s].toLowerCase().slice(0,Math.max(8,t[s].length))))return s;return null}async function ue(e,t,o){let n=H.slice(0,t),r=[],a=[],i=0,s=0;for(let l=0;l<n.length;l++){if(o?.abortSignal?.aborted)throw L();let c=n[l],u=(await e.doGenerate({prompt:Pe(c,o?.promptSuffix),maxTokens:Ee,temperature:0,abortSignal:o?.abortSignal})).text.slice(0,Ce),f=Q(u,c.choices);f!==null&&s++;let h=f===c.answer?1:0;i+=h,r.push(h),a.push(u),o?.onProgress?.(l+1,n.length);}return {taskId:`tinymmlu-${t}`,score:n.length===0?0:i/n.length,n:n.length,details:r,outputs:a,parseRate:n.length===0?0:s/n.length}}function vt(e,t){let o=0,n=0,r=0;for(let i=0;i<e.length;i++)o+=e[i]*t[i],n+=e[i]*e[i],r+=t[i]*t[i];let a=Math.sqrt(n)*Math.sqrt(r);return a===0?0:o/a}async function me(e,t,o){let n=ce.slice(0,t),r=[],a=[];for(let i=0;i<n.length;i++){if(o?.abortSignal?.aborted)throw L();let s=n[i],{embeddings:l}=await e.doEmbed({values:[s.s1,s.s2],abortSignal:o?.abortSignal});r.push(vt(l[0],l[1])),a.push(s.score),o?.onProgress?.(i+1,n.length);}return {taskId:`stsb-${t}`,score:r.length>=2?le(r,a):0,n:n.length,details:r.map(i=>Math.round(i*1e4)/1e4)}}var kt=2,Le=.2,St=[{maxBytes:5e8,max:4e3},{maxBytes:1e9,max:2500},{maxBytes:2e9,max:1500},{maxBytes:Number.POSITIVE_INFINITY,max:1e3}],At=2e3,It=[/swiftshader/i,/llvmpipe/i,/softpipe/i,/\bwarp\b/i,/microsoft basic render/i,/parallels/i,/vmware/i,/virtio/i,/virtualbox/i];function Be(e){let t=[],o=i=>{t.length<50&&t.push(i);};if(typeof e!="object"||e===null)return ["result must be an object"];let n=e;n.protocol!==j&&o(`protocol must be "${j}"`),n.schemaVersion!==2&&o(`schemaVersion must be ${2}`),(typeof n.runId!="string"||n.runId.length<8||n.runId.length>64)&&o("runId must be a string (8-64 chars)"),(typeof n.createdAt!="string"||Number.isNaN(Date.parse(n.createdAt)))&&o("createdAt must be an ISO date string");let r=n.harness;(!r||typeof r.name!="string"||typeof r.version!="string")&&o("harness {name, version} is required"),["quick","standard","thorough","custom"].includes(n.suite)||o("suite must be quick|standard|thorough|custom");let a=n.environment;if(!a||typeof a!="object")o("environment is required");else {let i=a.browser;(!i||typeof i.name!="string")&&o("environment.browser.name is required"),(!a.os||typeof a.os.platform!="string")&&o("environment.os.platform is required");}return Array.isArray(n.cells)?n.cells.length===0?o("cells must not be empty"):n.cells.length>500?o("cells exceeds the 500-cell limit"):n.cells.forEach((i,s)=>Mt(i,s,o)):o("cells must be an array"),Array.isArray(n.events)||o("events must be an array"),t}function Mt(e,t,o){if(typeof e!="object"||e===null){o(`cells[${t}] must be an object`);return}let n=e,r=`cells[${t}]`;typeof n.cellId!="string"&&o(`${r}.cellId must be a string`),typeof n.runtimeId!="string"&&o(`${r}.runtimeId must be a string`),typeof n.workloadId!="string"&&o(`${r}.workloadId must be a string`),["ok","invalid","error","skipped"].includes(n.status)||o(`${r}.status must be ok|invalid|error|skipped`);let a=n.model;(!a||typeof a.benchModelId!="string"||typeof a.providerModelId!="string")&&o(`${r}.model {benchModelId, providerModelId} is required`);let i=n.quality;if(i&&Array.isArray(i.outputs)&&i.outputs.some(s=>typeof s!="string"||s.length>500)&&o(`${r}.quality.outputs must be strings of at most 500 chars`),!Array.isArray(n.iterations)){o(`${r}.iterations must be an array`);return}n.iterations.forEach((s,l)=>{if(typeof s!="object"||s===null){o(`${r}.iterations[${l}] must be an object`);return}let c=s;(typeof c.startT!="number"||typeof c.endT!="number")&&o(`${r}.iterations[${l}] needs numeric startT/endT`),"chunks"in c&&!Array.isArray(c.chunks)&&o(`${r}.iterations[${l}].chunks must be an array`),"text"in c&&typeof c.text=="string"&&c.text.length>2e4&&o(`${r}.iterations[${l}].text exceeds 20000 chars`);});}function qe(e){return e.length>0&&"chunks"in e[0]}function J(e){let t=e.chunks.filter(r=>r.c>0);if(t.length<2)return false;let o=t[t.length-1].t-t[0].t,n=e.endT-e.startT;return n>0&&o/n>=Le}function X(e,t=.05,o){let n={cellId:e.cellId,status:e.status,highVariance:false};if(e.load&&(n.loadMs=e.load.endT-e.load.startT,n.loadCached=e.load.cached),e.quality&&(n.qualityScore=e.quality.score,e.quality.parseRate!==void 0&&(n.qualityParseRate=e.quality.parseRate)),e.iterations.length===0)return n;if(qe(e.iterations)){let a=e.iterations.every(J);n.streamIncremental=a;let i=[],s=[],l=[],c=[],m=[],u=[],f=[];for(let h of e.iterations){let y=h.chunks.reduce((g,k)=>g+k.c,0),p=h.endT-h.startT;if(p>0&&(u.push(p),y>0&&f.push(y/p*1e3)),c.push(y),!a)continue;let d=h.chunks.find(g=>g.c>0);if(!d)continue;let b=d.t-h.startT;i.push(b);let S=h.chunks[h.chunks.length-1],M=y-d.c,v=S.t-d.t;v>0&&M>0&&(s.push(M/v*1e3),l.push((h.chunks.length-1)/v*1e3)),o&&b>0&&m.push(o/b*1e3);}i.length>0&&(n.ttftMs=x(i)),s.length>0&&(n.decodeCharsPerSec=x(s)),l.length>0&&(n.decodeChunksPerSec=x(l)),c.length>0&&(n.generatedChars=x(c)),m.length>0&&(n.prefillTokPerSecApprox=x(m)),u.length>0&&(n.totalMs=x(u)),f.length>0&&(n.overallCharsPerSec=x(f));}else {let a=e.iterations,i=a.map(s=>s.endT-s.startT).filter(s=>s>0);i.length>0&&(a[0].count===1?n.singleLatencyMs=x(i):n.batchTextsPerSec=x(a.filter(s=>s.endT-s.startT>0).map(s=>s.count/(s.endT-s.startT)*1e3)));}let r=[n.ttftMs,n.decodeCharsPerSec,n.overallCharsPerSec,n.singleLatencyMs,n.batchTextsPerSec];return n.highVariance=r.some(a=>a!==void 0&&a.n>=2&&a.cv>t),n}function O(e,t=.05,o){let r=o??new Map([["chat-pp128-tg128",128],["chat-pp512-tg128",512]]);return e.cells.map(a=>X(a,t,r.get(a.workloadId)))}function je(e){let t=[],o=(s,l,c,m)=>t.push({code:s,message:l,severity:c,...m?{cellId:m}:{}});e.fingerprint?(e.fingerprint.mflops<=1||e.fingerprint.mflops>1e5||!Number.isFinite(e.fingerprint.checksum))&&o("fingerprint-implausible",`fingerprint mflops=${e.fingerprint.mflops}`,"reject"):o("fingerprint-missing","no hardware fingerprint in submission","reject");let n=e.environment.timerResolutionUs;for(let s of e.cells)if(s.status==="ok"){if(s.load&&s.load.endT<s.load.startT&&o("load-time-reversed","load endT precedes startT","reject",s.cellId),qe(s.iterations)){for(let u of s.iterations){let f=u.startT,h=true;for(let p of u.chunks)p.t<f&&(h=false),f=p.t;if(!h||u.endT<f){o("trace-not-monotonic","chunk timestamps are not monotonic","reject",s.cellId);break}let y=u.chunks.reduce((p,d)=>p+d.c,0);if(u.text.length!==y){o("text-chunk-mismatch",`text length ${u.text.length} != chunk sum ${y}`,"reject",s.cellId);break}}let l=X(s);s.iterations.some(u=>u.text.length<P)&&o("degenerate-generation",`an ok cell has a timed iteration with fewer than ${P} generated chars`,"reject",s.cellId);let c=s.model.sizeBytes??Number.POSITIVE_INFINITY,m=St.find(u=>c<=u.maxBytes);if(m&&l.decodeCharsPerSec&&l.decodeCharsPerSec.median>m.max&&o("decode-rate-envelope",`decode ${Math.round(l.decodeCharsPerSec.median)} chars/s exceeds envelope ${m.max} for model size`,"reject",s.cellId),m&&l.overallCharsPerSec&&l.overallCharsPerSec.median>m.max&&o("overall-rate-envelope",`overall ${Math.round(l.overallCharsPerSec.median)} chars/s exceeds envelope ${m.max} for model size`,"reject",s.cellId),l.ttftMs&&l.ttftMs.median<1&&o("ttft-implausible",`median TTFT ${l.ttftMs.median}ms < 1ms`,"reject",s.cellId),n!=null&&n>=4){let u=n/1e3,f=0,h=0;for(let y of s.iterations)for(let p of y.chunks)h++,Math.abs(p.t/u-Math.round(p.t/u))>.01&&f++;h>=20&&f/h>.5&&o("timer-grid",`${f}/${h} chunk timestamps off the ${n}us timer grid`,"warn",s.cellId);}}else if(s.quality?.taskId.startsWith("tinymmlu")&&s.quality.outputs){let{outputs:l,details:c,score:m,n:u}=s.quality;if(l.length!==u||!c||c.length!==u)o("quality-outputs-mismatch","quality outputs/details length disagrees with n","reject",s.cellId);else {let f=0,h=true;for(let y=0;y<u;y++){let p=H[y];if(!p)break;let d=Q(l[y],p.choices)===p.answer?1:0;f+=d,d!==c[y]&&(h=false);}(!h||Math.abs(f/u-m)>1e-9)&&o("quality-details-mismatch",`submitted MMLU score ${m} disagrees with recompute ${f/u} from raw outputs`,"reject",s.cellId);}}else if(s.iterations.length>0){let l=X(s);l.batchTextsPerSec&&l.batchTextsPerSec.median>At&&o("embed-rate-envelope",`embedding throughput ${Math.round(l.batchTextsPerSec.median)} texts/s exceeds envelope`,"reject",s.cellId),l.singleLatencyMs&&l.singleLatencyMs.median<.05&&o("embed-latency-implausible","sub-50us embedding latency","reject",s.cellId);}}let r=e.environment.gpu.vendor?.toLowerCase()??"",a=e.environment.os.platform.toLowerCase();r==="apple"&&a.includes("windows")&&o("env-cross-field","Apple GPU adapter with Windows platform","reject");let i=[e.environment.gpu.vendor,e.environment.gpu.architecture,e.environment.gpu.device,e.environment.gpu.description,e.environment.webglRenderer].filter(Boolean).join(" ");if(It.some(s=>s.test(i))){let s=e.cells.some(l=>l.status==="ok"&&/webgpu|^gpu$/.test(l.resolvedBackend));o("software-renderer",`GPU identity matches a software/virtual renderer: "${i.slice(0,120)}"`,s?"reject":"warn");}return t}function Rt(e){let t=Be(e);if(t.length>0)return {ok:false,shapeErrors:t,flags:[],summaries:[]};let o=O(e),n=je(e);if(e.clientSummaries){let r=new Map(o.map(a=>[a.cellId,a]));for(let a of e.clientSummaries){let i=r.get(a.cellId);if(i)for(let s of ["ttftMs","decodeCharsPerSec","totalMs","overallCharsPerSec","singleLatencyMs","batchTextsPerSec"]){let l=a[s]?.median,c=i[s]?.median;l!==void 0&&c!==void 0&&c!==0&&Math.abs(l-c)/Math.abs(c)>.01&&n.push({code:"client-summary-disagrees",cellId:a.cellId,message:`${s} client median ${l} vs recomputed ${c}`,severity:"reject"});}}}return {ok:n.every(r=>r.severity!=="reject"),shapeErrors:[],flags:n,summaries:o}}async function Tt(e){let{policy:t,hooks:o,abortSignal:n}=e,r=e.trace??new F;await r.attach(),r.record("suite-start",e.suite);let a=G(),i=[];try{o?.onPhase?.("environment");let s=await ie({userReportedDevice:e.userReportedDevice});o?.onEnvironment?.(s),o?.onPhase?.("fingerprint"),E(n);let l=e.skipFingerprint?null:await se(),c=a!=="none"?await N():null,m=xt(oe(e.cells)),u=e.cells.length,f=0;for(let y of m){E(n);let p=await _t(y,{...e,trace:r,memApi:a,baselineMemory:c,cellIndexRef:()=>f++,totalCells:u});i.push(...p),p.some(d=>d.status!=="skipped")&&(r.record("cooldown-start"),await U(t.cooldownMs,n).catch(d=>{if(d.name==="AbortError")throw d}),t.pressureGate&&await Pt(r,t.pressureGateTimeoutMs,n),r.record("cooldown-end"));}r.record("suite-end");let h={protocol:j,schemaVersion:2,runId:qt(),createdAt:new Date().toISOString(),harness:e.harness,suite:e.suite,environment:s,fingerprint:l,cells:i,events:[...r.all]};return h.clientSummaries=O(h,t.highVarianceCv),h}finally{await r.dispose();}}function xt(e){let t=new Map;for(let o of e){let n=`${o.model.runtimeId}/${o.model.benchModelId}/${o.model.providerModelId}`,r=t.get(n);r||(r={key:n,model:o.model,workloads:[],skipped:[]},t.set(n,r)),o.skipReason?r.skipped.push({workload:o.workload,reason:o.skipReason}):r.workloads.push(o.workload);}return [...t.values()]}async function _t(e,t){let{model:o}=e,n=o.task==="embedding",r=n?t.embedAdapters.get(o.runtimeId):t.llmAdapters.get(o.runtimeId),a=[],i=p=>({cellId:`${o.runtimeId}/${o.benchModelId}/${p.id}`,runtimeId:o.runtimeId,runtimeVersion:r?.runtimeVersion,model:o,workloadId:p.id,workloadKind:p.kind,resolvedBackend:"unknown",load:null,iterations:[],status:"skipped"});for(let{workload:p,reason:d}of e.skipped){let b=i(p);b.invalidReasons=[d],a.push(D(b,t));}if(e.workloads.length===0)return a;if(!r){for(let p of e.workloads){let d=i(p);d.invalidReasons=[`no adapter registered for ${o.runtimeId}`],a.push(D(d,t));}return a}let s=await r.isAvailable();if(!s.ok){for(let p of e.workloads){let d=i(p);d.invalidReasons=[`runtime unavailable: ${s.reason??"unknown"}`],a.push(D(d,t));}return a}let l=null,c=null,m,u=null,f=[],h=`${o.runtimeId}/${o.benchModelId}/${e.workloads[0].id}`;for(let p=1;p<=Math.max(1,t.policy.maxAttempts);p++)try{E(t.abortSignal);let d=await r.isModelCached(o),b=[],S=w();t.hooks?.onActivity?.({cellId:h,phase:"load"}),l=await B((v,g)=>r.load(o,{abortSignal:v,onProgress:k=>{g(),typeof k.pct=="number"&&(b.length===0||k.pct-b[b.length-1].pct>=2)&&b.push({t:w(),pct:Math.round(k.pct*100)/100}),t.hooks?.onLoadProgress?.(h,k.pct),t.hooks?.onActivity?.({cellId:h,phase:"load",pct:k.pct});}}),{parent:t.abortSignal,stallMs:t.policy.loadStallMs,timeoutMs:t.policy.loadTimeoutMs,what:"load"});let M=w();if(c={cached:d,startT:S,endT:M,progress:b.length>0?Lt(b,50):void 0,declaredBytes:o.sizeBytes},t.memApi!=="none"&&(u=await N()),t.policy.warmupRuns>0){let v=w();for(let g=0;g<t.policy.warmupRuns;g++){E(t.abortSignal);let k=l;t.hooks?.onActivity?.({cellId:h,phase:"warmup",iteration:g+1,total:t.policy.warmupRuns,chars:0,chunks:0}),await B((A,_)=>n?k.model.doEmbed({values:["warmup probe"],abortSignal:A}):Ue(k.model,{prompt:"Reply with the single word: ready",maxTokens:4,temperature:0},A,(Ge,Ke)=>{_(),t.hooks?.onActivity?.({cellId:h,phase:"warmup",chars:Ge,chunks:Ke});}),{parent:t.abortSignal,stallMs:t.policy.chunkStallMs,timeoutMs:t.policy.iterationTimeoutMs,what:"warmup"}),t.hooks?.onActivity?.({cellId:h,phase:"warmup",iteration:g+1,total:t.policy.warmupRuns});}m=w()-v;}break}catch(d){if(d.name==="AbortError")throw l&&await V(l),d;l&&await V(l),l=null;let b=We(d);if(b.name==="TimeoutError"&&t.trace.record("cell-timeout",`${h}: ${b.message}`),p<Math.max(1,t.policy.maxAttempts)){f.push({error:b,at:w()}),t.trace.record("cell-retry",`${h} attempt ${p+1}`),t.hooks?.onCellRetry?.(h,p+1,b);continue}let S=t.memApi!=="none"?await N(5e3):null;for(let M of e.workloads){let v=i(M);v.status="error",v.load=c,v.error=b,f.length>0&&(v.attempts=[...f]),t.memApi!=="none"&&(v.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:u??void 0,atError:S??void 0}),a.push(D(v,t));}return a}if(!l)return a;let y=false;for(let p of e.workloads){E(t.abortSignal);let d=i(p);d.resolvedBackend=l.resolvedBackend,l.runtimeConfig&&(d.runtimeConfig={...l.runtimeConfig}),y||(d.load=c,d.warmupMs=m,f.length>0&&(d.attempts=[...f]),y=true);let b=t.cellIndexRef();t.hooks?.onCellStart?.(d.cellId,b,t.totalCells);let S=l,M=async()=>{switch(p.kind){case "llm-generate":await Et(d,S,p,t);break;case "embed-single":case "embed-batch":await Ct(d,S,p,t);break;case "quality-mmlu":{let g=p.items;d.quality=await B((k,A)=>ue(S.model,g,{abortSignal:k,onProgress:_=>{A(),t.hooks?.onIteration?.(d.cellId,_,g),t.hooks?.onActivity?.({cellId:d.cellId,phase:"quality",iteration:_,total:g});},promptSuffix:o.qualityPromptSuffix}),{parent:t.abortSignal,stallMs:t.policy.chunkStallMs,timeoutMs:t.policy.qualityTimeoutMs,what:"quality lane"}),d.status="ok";break}case "quality-sts":{let g=p.items;d.quality=await B((k,A)=>me(S.model,g,{abortSignal:k,onProgress:_=>{A(),t.hooks?.onIteration?.(d.cellId,_,g),t.hooks?.onActivity?.({cellId:d.cellId,phase:"quality",iteration:_,total:g});}}),{parent:t.abortSignal,stallMs:t.policy.chunkStallMs,timeoutMs:t.policy.qualityTimeoutMs,what:"quality lane"}),d.status="ok";break}}},v=Math.max(1,t.policy.maxAttempts);for(let g=1;g<=v;g++)try{await M();break}catch(k){if(k.name==="AbortError")throw await V(l),k;let A=We(k);if(A.name==="TimeoutError"&&t.trace.record("cell-timeout",`${d.cellId}: ${A.message}`),g<v){d.attempts=[...d.attempts??[],{error:A,at:w()}],d.iterations=[],d.quality=void 0,d.invalidReasons=void 0,d.status="skipped",t.trace.record("cell-retry",`${d.cellId} attempt ${g+1}`),t.hooks?.onCellRetry?.(d.cellId,g+1,A);continue}d.status="error",d.error=A;}if(t.memApi!=="none"&&(d.status==="ok"||d.status==="error")){let g=await N(5e3);d.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:u??void 0,...d.status==="ok"?{postRun:g??void 0}:{atError:g??void 0}};}a.push(D(d,t));}if(await V(l),t.policy.measureWarmReload&&c?.cached===false)try{E(t.abortSignal);let p=`${o.runtimeId}/${o.benchModelId}/warm-reload`;t.hooks?.onActivity?.({cellId:p,phase:"reload"});let d=w(),b=await B((k,A)=>r.load(o,{abortSignal:k,onProgress:_=>{A(),t.hooks?.onActivity?.({cellId:p,phase:"reload",pct:_.pct});}}),{parent:t.abortSignal,stallMs:t.policy.loadStallMs,timeoutMs:t.policy.loadTimeoutMs,what:"load"}),S=w(),M=b.resolvedBackend,v=b.runtimeConfig?{...b.runtimeConfig}:void 0;await V(b);let g={cellId:`${o.runtimeId}/${o.benchModelId}/warm-reload`,runtimeId:o.runtimeId,runtimeVersion:r.runtimeVersion,model:o,workloadId:"warm-reload",workloadKind:"llm-generate",resolvedBackend:M,...v?{runtimeConfig:v}:{},load:{cached:!0,startT:d,endT:S,declaredBytes:o.sizeBytes},iterations:[],status:"ok"};a.push(D(g,t));}catch(p){if(p.name==="AbortError")throw p}return a}async function Et(e,t,o,n){let r=[],a=[];for(let i=0;i<n.policy.timedRuns;i++){let s=i+1;for(let l=0;;l++){E(n.abortSignal),n.hooks?.onIteration?.(e.cellId,s,n.policy.timedRuns),await De(n,e.cellId);let c=[];n.trace.isHidden&&c.push("started-hidden");let m=ee(n.trace);n.hooks?.onActivity?.({cellId:e.cellId,phase:"iteration",iteration:s,total:n.policy.timedRuns,chars:0,chunks:0});let u=w(),{chunks:f,text:h,providerUsage:y,finishReason:p}=await B((S,M)=>Ue(t.model,{prompt:o.prompt,systemPrompt:o.systemPrompt,maxTokens:o.maxTokens,temperature:o.temperature},S,(v,g)=>{M(),n.hooks?.onActivity?.({cellId:e.cellId,phase:"iteration",iteration:s,total:n.policy.timedRuns,chars:v,chunks:g});}),{parent:n.abortSignal,stallMs:n.policy.chunkStallMs,timeoutMs:n.policy.iterationTimeoutMs,what:`iteration ${s}`}),d=w();ee(n.trace)>m&&c.push("hidden-during-run"),h.length<P&&c.push("degenerate-output");let b={startT:u,chunks:f,endT:d,text:h,providerUsage:y?{...y,fidelity:re[e.runtimeId]}:void 0,finishReason:p,gates:c};if(Ne(c)&&l<Math.max(1,n.policy.maxAttempts)){a.push(b),n.trace.record("iteration-redo",`${e.cellId} iteration ${s}: ${c.join(",")}`);continue}r.push(b);break}}e.iterations=r,a.length>0&&(e.discardedIterations=a),Oe(e,r);}function Ne(e){return e.includes("started-hidden")||e.includes("hidden-during-run")}function Oe(e,t){let o=t.some(n=>n.gates.length>0);if(e.status=o?"invalid":"ok",o){let n=new Set;for(let r of t)for(let a of r.gates)n.add(a==="degenerate-output"?`degenerate output: fewer than ${P} generated chars in a timed iteration`:a==="started-hidden"||a==="hidden-during-run"?"tab hidden during a timed iteration (the tab did not return in time for a repeat)":"validity gate fired during a timed region");e.invalidReasons=[...n];}}async function De(e,t){if(!e.trace.isHidden)return true;e.hooks?.onActivity?.({cellId:t,phase:"waiting-visible"});let o=w()+e.policy.visibilityWaitMs;for(;e.trace.isHidden&&w()<o;)E(e.abortSignal),await U(Math.min(250,e.policy.visibilityWaitMs),e.abortSignal);return !e.trace.isHidden}async function Ct(e,t,o,n){let r=[],a=[];for(let i=0;i<n.policy.timedRuns;i++)for(let s=0;;s++){E(n.abortSignal),n.hooks?.onIteration?.(e.cellId,i+1,n.policy.timedRuns),await De(n,e.cellId);let l=[];n.trace.isHidden&&l.push("started-hidden");let c=ee(n.trace),m=w(),{embeddings:u}=await B(y=>t.model.doEmbed({values:o.texts,abortSignal:y}),{parent:n.abortSignal,stallMs:n.policy.iterationTimeoutMs,timeoutMs:n.policy.iterationTimeoutMs,what:`iteration ${i+1}`}),f=w();ee(n.trace)>c&&l.push("hidden-during-run"),n.hooks?.onActivity?.({cellId:e.cellId,phase:"iteration",iteration:i+1,total:n.policy.timedRuns});let h={startT:m,endT:f,count:o.texts.length,dimensions:u[0]?.length??t.model.dimensions,gates:l};if(Ne(l)&&s<Math.max(1,n.policy.maxAttempts)){a.push(h),n.trace.record("iteration-redo",`${e.cellId} iteration ${i+1}: ${l.join(",")}`);continue}r.push(h);break}e.iterations=r,a.length>0&&(e.discardedIterations=a),Oe(e,r);}async function Ue(e,t,o,n){let r=[],a="",i,s;if(e.doStream)for await(let l of e.doStream({...t,abortSignal:o})){let c=w();l.text.length>0&&(r.push({t:c,c:l.text.length}),a+=l.text,n?.(a.length,r.length)),l.done&&(i=l.usage,s=l.finishReason);}else {let l=await e.doGenerate({...t,abortSignal:o}),c=w();a=l.text,r.push({t:c,c:l.text.length}),n?.(a.length,r.length),i=l.usage,s=l.finishReason;}return {chunks:r,text:a,providerUsage:i,finishReason:s}}var Z=class extends Error{constructor(t){super(t),this.name="TimeoutError";}};async function B(e,t){let o=new AbortController,n=()=>o.abort(t.parent?.reason);t.parent?.aborted&&n(),t.parent?.addEventListener("abort",n,{once:true});let r=w(),a=r,i=false,s=()=>{},l=new Promise((h,y)=>{s=y;}),c=h=>{i||(i=true,o.abort(new Z(h)),s(new Z(h)));},u=setInterval(()=>{if(i)return;let h=w();if(h-a>=t.stallMs){c(t.what==="load"?`load made no progress for ${t.stallMs} ms`:`${t.what}: no stream progress for ${t.stallMs} ms`);return}h-r>=t.timeoutMs&&c(`${t.what}: exceeded the ${t.timeoutMs} ms budget`);},Math.max(10,Math.min(t.stallMs,t.timeoutMs)/4)),f=()=>{a=w();};try{return await Promise.race([e(o.signal,f),l])}finally{i=true,clearInterval(u),t.parent?.removeEventListener("abort",n);}}function ee(e){let t=0;for(let o of e.all)o.type==="visibility-hidden"&&t++;return t}async function Pt(e,t,o){let n=w()+t;for(;w()<n;){let r=e.pressureState;if(r===void 0||r==="nominal"||r==="fair")return;await U(1e3,o);}}function Lt(e,t){if(e.length<=t)return e;let o=[],n=(e.length-1)/(t-1);for(let r=0;r<t;r++)o.push(e[Math.round(r*n)]);return o}var Bt=4e3;function We(e){let t=e,o=t?.cause,n=o instanceof Error?o.message:typeof o=="string"?o:void 0,r=o instanceof Error&&o.name&&o.name!=="Error"?o.name:void 0,a=o instanceof Error&&typeof o.stack=="string"&&o.stack.length>0?o.stack.slice(0,Bt):void 0;return {name:t?.name??"Error",message:t?.message??String(e),...n!==void 0?{cause:n}:{},...r?{causeName:r}:{},...a?{causeStack:a}:{}}}function D(e,t){return t.hooks?.onCellFinish?.(e),e}async function V(e){try{await e.dispose();}catch{}}function E(e){if(e?.aborted)throw L()}function qt(){let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();let t=new Uint8Array(16);if(e?.getRandomValues)e.getRandomValues(t);else for(let n=0;n<16;n++)t[n]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let o=[...t].map(n=>n.toString(16).padStart(2,"0")).join("");return `${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}function Fe(e){return he(e)}function he(e){if(e===null||typeof e=="number"||typeof e=="boolean"||typeof e=="string")return JSON.stringify(e);if(typeof e>"u")return "null";if(Array.isArray(e))return `[${e.map(t=>he(t)).join(",")}]`;if(typeof e=="object")return `{${Object.entries(e).filter(([,o])=>o!==void 0).sort(([o],[n])=>o<n?-1:o>n?1:0).map(([o,n])=>`${JSON.stringify(o)}:${he(n)}`).join(",")}}`;throw new TypeError(`canonicalJson: unsupported value type ${typeof e}`)}async function $e(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("Web Crypto (crypto.subtle) is not available in this environment");let o=new TextEncoder().encode(e),n=await t.digest("SHA-256",o);return [...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function He(e){let{digest:t,...o}=e;return $e(Fe(o))}async function jt(e){return e.digest?await He(e)===e.digest:false}function fe(e){let t=e.environment,o=t.gpu.available?[t.gpu.vendor??"gpu",t.gpu.architecture].filter(Boolean).join("-"):"no-webgpu";return [t.os.platform.toLowerCase().replace(/\s+/g,"-"),o].join("/")}var ze=3;function Wt(e,t=ze){let o=new Map;for(let r of e){let a=fe(r),i=r.clientSummaries??O(r),s=new Map(i.map(l=>[l.cellId,l]));for(let l of r.cells){if(l.status!=="ok")continue;let c=s.get(l.cellId);if(!c)continue;let m=[a,l.runtimeId,l.model.benchModelId,l.workloadId].join("|"),u=o.get(m);u||(u={row:{deviceClass:a,runtimeId:l.runtimeId,benchModelId:l.model.benchModelId,modelName:l.model.displayName,workloadId:l.workloadId,resolvedBackends:[],browsers:[],highVariance:false},ttft:[],decode:[],overall:[],single:[],batch:[],loadCold:[],loadWarm:[],quality:[],parseRate:[],runIds:new Set},o.set(m,u)),u.runIds.add(r.runId),Ve(u.row.resolvedBackends,l.resolvedBackend),Ve(u.row.browsers,r.environment.browser.name),u.row.highVariance||=c.highVariance,c.ttftMs&&u.ttft.push(c.ttftMs.median),c.decodeCharsPerSec&&u.decode.push(c.decodeCharsPerSec.median),c.overallCharsPerSec&&u.overall.push(c.overallCharsPerSec.median),c.singleLatencyMs&&u.single.push(c.singleLatencyMs.median),c.batchTextsPerSec&&u.batch.push(c.batchTextsPerSec.median),c.loadMs!==void 0&&(c.loadCached?u.loadWarm:u.loadCold).push(c.loadMs),c.qualityScore!==void 0&&u.quality.push(c.qualityScore),c.qualityParseRate!==void 0&&u.parseRate.push(c.qualityParseRate);}}let n=[];for(let r of o.values())n.push({...r.row,submissions:r.runIds.size,ttftMs:C(r.ttft),decodeCharsPerSec:C(r.decode),overallCharsPerSec:C(r.overall),singleLatencyMs:C(r.single),batchTextsPerSec:C(r.batch),loadColdMs:C(r.loadCold),loadWarmMs:C(r.loadWarm),qualityScore:C(r.quality),qualityParseRate:C(r.parseRate),provisional:r.runIds.size<t});return n.sort((r,a)=>r.deviceClass.localeCompare(a.deviceClass)||r.benchModelId.localeCompare(a.benchModelId)||r.runtimeId.localeCompare(a.runtimeId)||r.workloadId.localeCompare(a.workloadId)),n}function Ve(e,t){t&&!e.includes(t)&&e.push(t);}function C(e){return e.length>0?q(Y(e)):void 0}function q(e){return Math.round(e*100)/100}function pe(e){let t=e==null?"":String(e);return /[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function Nt(e){let o=[["deviceClass","runtimeId","benchModelId","modelName","workloadId","submissions","ttftMs","decodeCharsPerSec","overallCharsPerSec","singleLatencyMs","batchTextsPerSec","loadColdMs","loadWarmMs","qualityScore","qualityParseRate","resolvedBackends","browsers","highVariance","provisional"].join(",")];for(let n of e)o.push([n.deviceClass,n.runtimeId,n.benchModelId,n.modelName,n.workloadId,n.submissions,n.ttftMs,n.decodeCharsPerSec,n.overallCharsPerSec,n.singleLatencyMs,n.batchTextsPerSec,n.loadColdMs,n.loadWarmMs,n.qualityScore,n.qualityParseRate,n.resolvedBackends.join(";"),n.browsers.join(";"),n.highVariance,n.provisional].map(pe).join(","));return o.join(`
|
|
35
35
|
`)+`
|
|
36
|
-
`}function Ot(e){let o=[["runId","createdAt","suite","deviceClass","browser","browserVersion","os","gpuVendor","gpuArchitecture","cores","deviceMemoryGB","crossOriginIsolated","fingerprintMflops","runtimeId","runtimeVersion","benchModelId","providerModelId","quantization","sizeBytes","workloadId","resolvedBackend","iteration","ttftMs","decodeCharsPerSec","generatedChars","overallCharsPerSec","streamIncremental","durationMs","loadMs","loadCached","status"].join(",")];for(let n of e){let r=n.environment,a=[n.runId,n.createdAt,n.suite,fe(n),r.browser.name,r.browser.version,r.os.platform,r.gpu.vendor??"",r.gpu.architecture??"",r.hardware.cores??"",r.hardware.deviceMemoryGB??"",r.flags.crossOriginIsolated,n.fingerprint?q(n.fingerprint.mflops):""];for(let i of n.cells){let s=i.load?q(i.load.endT-i.load.startT):"",l=i.load?String(i.load.cached):"",c=[i.runtimeId,i.runtimeVersion??"",i.model.benchModelId,i.model.providerModelId,i.model.quantization??"",i.model.sizeBytes??"",i.workloadId,i.resolvedBackend];if(i.iterations.length===0){o.push([...a,...c,"","","","","","","",s,l,i.status].map(pe).join(","));continue}i.iterations.forEach((m,
|
|
36
|
+
`}function Ot(e){let o=[["runId","createdAt","suite","deviceClass","browser","browserVersion","os","gpuVendor","gpuArchitecture","cores","deviceMemoryGB","crossOriginIsolated","fingerprintMflops","runtimeId","runtimeVersion","benchModelId","providerModelId","quantization","sizeBytes","workloadId","resolvedBackend","iteration","ttftMs","decodeCharsPerSec","generatedChars","overallCharsPerSec","streamIncremental","durationMs","loadMs","loadCached","status"].join(",")];for(let n of e){let r=n.environment,a=[n.runId,n.createdAt,n.suite,fe(n),r.browser.name,r.browser.version,r.os.platform,r.gpu.vendor??"",r.gpu.architecture??"",r.hardware.cores??"",r.hardware.deviceMemoryGB??"",r.flags.crossOriginIsolated,n.fingerprint?q(n.fingerprint.mflops):""];for(let i of n.cells){let s=i.load?q(i.load.endT-i.load.startT):"",l=i.load?String(i.load.cached):"",c=[i.runtimeId,i.runtimeVersion??"",i.model.benchModelId,i.model.providerModelId,i.model.quantization??"",i.model.sizeBytes??"",i.workloadId,i.resolvedBackend];if(i.iterations.length===0){o.push([...a,...c,"","","","","","","",s,l,i.status].map(pe).join(","));continue}i.iterations.forEach((m,u)=>{let f="",h="",y="",p="",d="";if("chunks"in m){let b=m.chunks.reduce((g,k)=>g+k.c,0);y=String(b);let S=m.endT-m.startT;S>0&&b>0&&(p=String(q(b/S*1e3)));let M=J(m);d=String(M);let v=m.chunks.find(g=>g.c>0);if(M&&v){f=String(q(v.t-m.startT));let g=m.chunks[m.chunks.length-1],k=b-v.c,A=g.t-v.t;A>0&&(h=String(q(k/A*1e3)));}}o.push([...a,...c,u+1,f,h,y,p,d,q(m.endT-m.startT),s,l,i.status].map(pe).join(","));});}}return o.join(`
|
|
37
37
|
`)+`
|
|
38
38
|
`}export{j as BENCH_PROTOCOL_VERSION,W as BENCH_SCHEMA_VERSION,ye as EMBED_WORKLOADS,ne as GENERATION_BUDGET,ze as HEADLINE_MIN_SUBMISSIONS,be as LLM_WORKLOADS,P as MIN_GENERATED_CHARS,Ee as MMLU_MAX_TOKENS,Ce as MMLU_OUTPUT_CAP,kt as PLAUSIBILITY_RULES_VERSION,we as QUALITY_WORKLOADS,z as RUNTIME_EXECUTION_ORDER,Ze as RUN_POLICIES,Le as STREAM_COHERENCE_MIN_SPAN_RATIO,ce as STSB_SUBSET,H as TINY_MMLU,F as TraceRecorder,re as USAGE_FIDELITY,Je as WORKLOADS_BY_ID,Wt as aggregateRuns,Fe as canonicalJson,ie as captureEnvironment,je as checkPlausibility,He as computeRunDigest,Se as deriveDeviceType,ke as detectEngine,Me as detectWasmFeatures,fe as deviceClassOf,Pe as formatMMLUPrompt,bt as geomean,w as hrNow,ae as inferTimerResolutionUs,J as isIncrementalStream,$ as mean,Y as median,G as memoryApiAvailable,oe as orderCells,Ie as parseGpuModel,Q as parseMMLUAnswer,ve as parseUserAgent,K as quantile,Ae as resolveGpuModel,Nt as rowsToCSV,Tt as runBenchmarkSuite,se as runFingerprint,ue as runMMLUFidelity,me as runSTSQuality,Ot as runsToLongCSV,N as sampleMemoryBytes,$e as sha256Hex,U as sleep,le as spearman,_e as stddev,x as summarize,X as summarizeCell,O as summarizeRun,Be as validateRunShape,Rt as validateSubmission,jt as verifyRunDigest};//# sourceMappingURL=index.js.map
|
|
39
39
|
//# sourceMappingURL=index.js.map
|