@localmode/bench 0.6.1 → 0.7.1
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 +15 -0
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -21
- package/dist/index.d.ts +96 -21
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var j="localmode-bench/4",W=2;var Qe=["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(" "),Xe=["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,L=16,be=[{id:"chat-pp128-tg128",kind:"llm-generate",label:"Chat pp128/tg128",prompt:Qe,approxPromptTokens:128,maxTokens:ne,temperature:0},{id:"chat-pp512-tg128",kind:"llm-generate",label:"Long-context pp512/tg128",prompt:Xe,approxPromptTokens:512,maxTokens:ne,temperature:0}];function Je(){let t=["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"],e=[];for(let o=0;o<32;o++){let n=t[o%t.length];e.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 e}var ge=Je(),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}],Ze=new Map([...be,...ye,...we].map(t=>[t.id,t])),z=["transformers-wasm","transformers-webgpu","chrome-ai","webllm","mediapipe","litert","wllama-webgpu","wllama"];function oe(t){let e=new Map(z.map((o,n)=>[o,n]));return [...t].sort((o,n)=>(e.get(o.model.runtimeId)??z.length)-(e.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},et={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(t=64){if(typeof performance>"u")return null;let e=[],o=performance.now(),n=0;for(;e.length<t&&n<2e6;){let a=performance.now();a>o&&(e.push(a-o),o=a),n++;}if(e.length===0)return null;let r=Math.min(...e);return Math.round(r*1e3*100)/100}function F(t,e){return new Promise((o,n)=>{if(e?.aborted){n(x());return}let r=setTimeout(()=>{e?.removeEventListener("abort",a),o();},t);function a(){clearTimeout(r),n(x());}e?.addEventListener("abort",a,{once:true});})}function x(){if(typeof DOMException<"u")return new DOMException("Aborted","AbortError");let t=new Error("Aborted");return t.name="AbortError",t}var $=class{events=[];disposers=[];hidden=false;lastPressureState;wakeLockSentinel=null;record(e,o){this.events.push({t:w(),type:e,...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 e=globalThis.PressureObserver;if(e)try{let n=new e(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 e of this.disposers)e();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(t=25e3){let e=G();if(e==="uaSpecific")try{let o=await Promise.race([performance.measureUserAgentSpecificMemory(),new Promise(n=>setTimeout(()=>n(null),t))]);if(o&&typeof o.bytes=="number")return o.bytes}catch{}if(e!=="none"){let o=performance.memory;if(typeof o?.usedJSHeapSize=="number")return o.usedJSHeapSize}return null}var tt=["maxBufferSize","maxStorageBufferBindingSize","maxUniformBufferBindingSize","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension","maxBindGroups","maxStorageBuffersPerShaderStage","maxTextureDimension2D"];async function ie(t){let e=typeof navigator<"u"?navigator:void 0,o=e?.userAgent??"",{browser:n,os:r,uaData:a}=await nt(e),i=await it(e),s=lt(),l=await Me(),c=n.source==="ua-ch"?"Blink":ke(o);I(()=>{n.engine=c,e?.vendor&&(n.vendor=e.vendor),e&&typeof e.webdriver=="boolean"&&(n.webdriver=e.webdriver),e&&"pdfViewerEnabled"in e&&(n.pdfViewerEnabled=!!e.pdfViewerEnabled),e?.platform&&(r.navigatorPlatform=e.platform);});let m=dt(),d=ut();return {capturedAt:new Date().toISOString(),browser:n,os:r,hardware:{cores:e?.hardwareConcurrency??null,coresClamped:c==="WebKit"||c==="unknown",deviceMemoryGB:e&&"deviceMemory"in e?e.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 ct(e,i.available,s?.contextKind==="webgl2"),device:at(e,o,a),storage:await pt(e),power:await ft(e),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:mt(e),locale:ht(),languages:e?.languages?[...e.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:t?.userReportedDevice}}function I(t){try{return t()}catch{return}}async function nt(t){let e=t&&"userAgentData"in t?t.userAgentData:void 0;if(e)try{let n=await e.getHighEntropyValues(["platform","platformVersion","architecture","bitness","model","fullVersionList","wow64","formFactors"]),r=n.fullVersionList??e.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(e,{formFactorsHint:Array.isArray(n.formFactors)?n.formFactors:void 0})}}catch{}let o=t?.userAgent??"";return {...ve(o),uaData:e}}function ve(t){return {browser:ot(t),os:rt(t)}}function ot(t){let e=[["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 e){let r=t.match(n);if(r)return {name:o,version:r[1],source:"ua-parse"}}return {name:"unknown",version:"unknown",source:"ua-parse"}}function rt(t){let e="unknown";if(/Windows/.test(t)?e="Windows":/iPhone|iPad|iPod/.test(t)?e="iOS":/Mac OS X/.test(t)?e="macOS":/Android/.test(t)?e="Android":/CrOS/.test(t)?e="Chrome OS":/Linux/.test(t)&&(e="Linux"),e==="iOS"){let o=t.match(/OS (\d+(?:[_.]\d+)*) like Mac OS X/);if(o)return {platform:e,version:o[1].replace(/_/g,".")}}return {platform:e,version:"unknown-frozen"}}function ke(t){return t?/iPhone|iPad|iPod/.test(t)?"WebKit":/Gecko\/\d|Firefox\//.test(t)&&!/like Gecko/.test(t)?"Gecko":/Chrome\/|Chromium\/|Edg\//.test(t)?"Blink":/AppleWebKit\//.test(t)?"WebKit":"unknown":"unknown"}function Se(t){let{ua:e,maxTouchPoints:o,formFactors:n,mobile:r,platform:a}=t;if(a==="Android"||a==="iOS"||/Android|iPhone|iPad|iPod/.test(e))return /iPad/.test(e)?"tablet":/iPhone|iPod/.test(e)||/Mobile/.test(e)||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(e)?"tablet":/iPhone|iPod/.test(e)?"phone":/Macintosh/.test(e)&&o>1?"tablet":/Android/.test(e)?/Mobile/.test(e)?"phone":"tablet":/CrKey|SmartTV|Tizen|Web0S|BRAVIA|AppleTV/i.test(e)?"tv":/Quest|OculusBrowser|VR\b|XR\b/i.test(e)?"xr":r===true?"phone":/Windows|Macintosh|Linux|CrOS/.test(e)?"desktop":"unknown"}function at(t,e,o){if(t)return I(()=>{let n=typeof t.maxTouchPoints=="number"?t.maxTouchPoints:0,r=o?.formFactorsHint,a=o?.mobile,i=Se({ua:e,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 it(t){let e=t&&"gpu"in t?t.gpu:void 0;if(!e)return {available:false};try{let o=await Promise.race([e.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 tt){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(()=>e.getPreferredCanvasFormat?.()),wgslLanguageFeatures:I(()=>e.wgslLanguageFeatures?[...e.wgslLanguageFeatures].sort():void 0)}}catch{return {available:false}}}function R(t){return typeof t=="string"&&t.length>0?t:void 0}function T(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}var st=/swiftshader|llvmpipe|softpipe|software|mesa offscreen|microsoft basic render/i;function lt(){try{if(typeof document>"u")return null;let t=document.createElement("canvas"),e="webgl2",o=t.getContext("webgl2");if(o||(e="webgl",o=t.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:e,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"?st.test(a):void 0};return I(()=>o.getExtension("WEBGL_lose_context")?.loseContext()),i}catch{return null}}function Ae(t,e){let o=t.description?.trim();if(o){let n=o.toLowerCase();if(!(n===t.vendor?.toLowerCase()||n===t.architecture?.toLowerCase()))return o}return Ie(e)}function Ie(t){if(!t)return;let e=t.match(/^ANGLE \((.*)\)$/);if(!e)return t.trim()||void 0;let o=e[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 t=i=>{try{return WebAssembly.validate(new Uint8Array(i))}catch{return false}},e=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:t([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:t([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)),t([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:t([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:t([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:e([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:t([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:t([0,97,115,109,1,0,0,0,1,5,1,95,1,120,0]),memory64:t([0,97,115,109,1,0,0,0,5,3,1,4,1]),multiMemory:e([0,97,115,109,1,0,0,0,5,5,2,0,0,0,0]),multiValue:t([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:t([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:t([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:t([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:t([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:t([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:e([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:t([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 ct(t,e,o){if(!t)return;let n=globalThis,r=t,a=(c,m)=>I(()=>!!(c&&m in c))??false,i=await(async()=>{try{let c=t.storage;return c?.getDirectory?(await c.getDirectory(),!0):!1}catch{return false}})(),s=await(async()=>{try{let c=t.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:e,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 dt(){return I(()=>{let t=performance.memory;if(t)return {limit:T(t.jsHeapSizeLimit),used:T(t.usedJSHeapSize)}})}function ut(){if(typeof screen>"u")return null;try{let t=o=>typeof matchMedia=="function"?I(()=>matchMedia(o).matches):void 0,e=t("(prefers-color-scheme: dark)")?"dark":t("(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:t("(dynamic-range: high)"),wideGamut:t("(color-gamut: p3)"),isExtended:I(()=>screen.isExtended),prefersReducedMotion:t("(prefers-reduced-motion: reduce)"),prefersColorScheme:e}}catch{return null}}function mt(t){if(t)return I(()=>{let e=t.connection,o=typeof t.onLine=="boolean"?t.onLine:void 0;return e?{supported:!0,effectiveType:R(e.effectiveType),type:R(e.type),downlinkMbps:T(e.downlink),rttMs:T(e.rtt),saveData:typeof e.saveData=="boolean"?e.saveData:void 0,online:o}:{supported:!1,online:o}})}function ht(){return I(()=>{let t=Intl.DateTimeFormat().resolvedOptions();return {timeZone:R(t.timeZone),timeZoneOffsetMinutes:new Date().getTimezoneOffset(),locale:R(t.locale),calendar:R(t.calendar)}})}async function pt(t){try{if(!t?.storage?.estimate)return null;let e=await t.storage.estimate(),o=e.usageDetails;return {quotaBytes:e.quota??void 0,usageBytes:e.usage??void 0,usageDetails:o&&Object.keys(o).length>0?{...o}:void 0}}catch{return null}}async function ft(t){try{let e=t&&"getBattery"in t?t.getBattery:void 0;if(!e)return {batterySupported:!1};let o=await e.call(t),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 gt(t){let e=t>>>0;return ()=>(e=Math.imul(e,1664525)+1013904223>>>0,e/4294967295)}async function se(t){let e=t?.n??160,o=t?.minDurationMs??600,n=gt(780228),r=new Float32Array(e*e),a=new Float32Array(e*e);for(let f=0;f<e*e;f++)r[f]=n()-.5,a[f]=n()-.5;let i=new Float32Array(e*e),s=2*e*e*e,l=0,c=w(),m=0;for(;m<o;)bt(r,a,i,e),l++,m=w()-c,l%4===0&&await Promise.resolve();let d=0;for(let f=0;f<e*e;f+=97)d+=i[f];return {mflops:s*l/(m*1e3),n:e,iterations:l,durationMs:m,checksum:Math.fround(d)}}function bt(t,e,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+=t[r*n+s]*e[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(t){return [...t].sort((e,o)=>e-o)}function K(t,e){if(t.length===0)throw new RangeError("quantile() requires a non-empty sample");if(e<0||e>1)throw new RangeError(`quantile q must be in [0,1], got ${e}`);let o=xe(t),n=(o.length-1)*e,r=Math.floor(n),a=Math.ceil(n);return r===a?o[r]:o[r]+(o[a]-o[r])*(n-r)}function Y(t){return K(t,.5)}function H(t){if(t.length===0)throw new RangeError("mean() requires a non-empty sample");let e=0;for(let o of t)e+=o;return e/t.length}function _e(t){if(t.length<2)return 0;let e=H(t),o=0;for(let n of t)o+=(n-e)*(n-e);return Math.sqrt(o/(t.length-1))}function yt(t){if(t.length===0)throw new RangeError("geomean() requires a non-empty sample");let e=0;for(let o of t){if(o<=0)throw new RangeError(`geomean() requires positive values, got ${o}`);e+=Math.log(o);}return Math.exp(e/t.length)}function _(t){if(t.length===0)throw new RangeError("summarize() requires a non-empty sample");let e=t.length,o=H(t),n=_e(t),r=xe(t),a=e>=2?Re[Math.min(e-2,Re.length-1)]*n/Math.sqrt(e):0;return {n:e,median:Y(t),mean:o,sd:n,iqr:K(t,.75)-K(t,.25),min:r[0],max:r[e-1],ci95:a,cv:o===0?0:n/Math.abs(o)}}function le(t,e){if(t.length!==e.length)throw new RangeError("spearman() requires equal-length samples");if(t.length<2)throw new RangeError("spearman() requires n >= 2");let o=Te(t),n=Te(e);return wt(o,n)}function Te(t){let e=t.map((r,a)=>[r,a]).sort((r,a)=>r[0]-a[0]),o=new Array(t.length),n=0;for(;n<e.length;){let r=n;for(;r+1<e.length&&e[r+1][0]===e[n][0];)r++;let a=(n+r)/2+1;for(let i=n;i<=r;i++)o[e[i][1]]=a;n=r+1;}return o}function wt(t,e){let o=H(t),n=H(e),r=0,a=0,i=0;for(let l=0;l<t.length;l++){let c=t[l]-o,m=e[l]-n;r+=c*m,a+=c*c,i+=m*m;}let s=Math.sqrt(a*i);return s===0?0:r/s}var V=[{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",U=3,z=[2,3];var tt=["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(" "),nt=["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(" "),ae=128,L=16,Se=[{id:"chat-pp128-tg128",kind:"llm-generate",label:"Chat pp128/tg128",prompt:tt,approxPromptTokens:128,maxTokens:ae,temperature:0},{id:"chat-pp512-tg128",kind:"llm-generate",label:"Long-context pp512/tg128",prompt:nt,approxPromptTokens:512,maxTokens:ae,temperature:0}];function ot(){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 ke=ot(),Ae=[{id:"embed-single",kind:"embed-single",label:"Embedding single-query latency",texts:[ke[0]]},{id:"embed-batch32",kind:"embed-batch",label:"Embedding batch-32 throughput",texts:ke}],Ie=[{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}],rt=new Map([...Se,...Ae,...Ie].map(e=>[e.id,e])),G=["transformers-wasm","transformers-webgpu","chrome-ai","webllm","mediapipe","litert","wllama-webgpu","wllama"];function ie(e){let t=new Map(G.map((o,n)=>[o,n]));return [...e].sort((o,n)=>(t.get(o.model.runtimeId)??G.length)-(t.get(n.model.runtimeId)??G.length))}var re={loadStallMs:18e4,loadTimeoutMs:45*6e4,chunkStallMs:12e4,iterationTimeoutMs:10*6e4,qualityTimeoutMs:30*6e4,maxAttempts:2,visibilityWaitMs:10*6e4},at={quick:{warmupRuns:1,timedRuns:3,cooldownMs:5e3,pressureGate:true,pressureGateTimeoutMs:15e3,measureWarmReload:false,highVarianceCv:.05,...re},standard:{warmupRuns:1,timedRuns:3,cooldownMs:8e3,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05,...re},thorough:{warmupRuns:1,timedRuns:5,cooldownMs:1e4,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05,...re,iterationTimeoutMs:15*6e4,qualityTimeoutMs:45*6e4}};var se={"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 le(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 F(e,t){return new Promise((o,n)=>{if(t?.aborted){n(T());return}let r=setTimeout(()=>{t?.removeEventListener("abort",a),o();},e);function a(){clearTimeout(r),n(T());}t?.addEventListener("abort",a,{once:true});})}function T(){if(typeof DOMException<"u")return new DOMException("Aborted","AbortError");let e=new Error("Aborted");return e.name="AbortError",e}var $=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 K(){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 W(e=25e3){let t=K();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 it=["maxBufferSize","maxStorageBufferBindingSize","maxUniformBufferBindingSize","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension","maxBindGroups","maxStorageBuffersPerShaderStage","maxTextureDimension2D"];async function ce(e){let t=typeof navigator<"u"?navigator:void 0,o=t?.userAgent??"",{browser:n,os:r,uaData:a}=await st(t),i=await ht(t),s=ft(),l=await Ee(),c=n.source==="ua-ch"?"Blink":Re(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 d=bt(),p=yt();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:d?.limit,jsHeapUsedBytes:d?.used},gpu:i,webglRenderer:s?.renderer??null,webgl:s??void 0,gpuModel:xe(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 gt(t,i.available,s?.contextKind==="webgl2"),device:mt(t,o,a),storage:await kt(t),power:await St(t),pressure:{supported:typeof globalThis<"u"&&"PressureObserver"in globalThis},timerResolutionUs:le(),screen:p?{width:p.width,height:p.height,dpr:p.dpr}:null,display:p??void 0,network:wt(t),locale:vt(),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 st(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 {...Me(o),uaData:t}}function Me(e){return {browser:lt(e),os:ct(e)}}function lt(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 ct(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){let n=o[1].replace(/_/g,".");return n===dt&&!ut(e)?{platform:t,version:"unknown-frozen"}:{platform:t,version:n}}}return {platform:t,version:"unknown-frozen"}}var dt="18.7";function ut(e){if(/CriOS\//.test(e))return true;let t=e.match(/Version\/(\d+)/);return t!==null&&Number(t[1])<26}function Re(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 Te(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 mt(e,t,o){if(e)return I(()=>{let n=typeof e.maxTouchPoints=="number"?e.maxTouchPoints:0,r=o?.formFactorsHint,a=o?.mobile,i=Te({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 ht(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 it){let s=a[i];typeof s=="number"&&(r[i]=s);}return {available:!0,vendor:x(n.vendor),architecture:x(n.architecture),device:x(n.device),description:x(n.description),subgroupMinSize:R(n.subgroupMinSize),subgroupMaxSize:R(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 x(e){return typeof e=="string"&&e.length>0?e:void 0}function R(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var pt=/swiftshader|llvmpipe|softpipe|software|mesa offscreen|microsoft basic render/i;function ft(){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:x(r),renderer:x(a),version:x(o.getParameter(o.VERSION)),shadingLanguageVersion:x(o.getParameter(o.SHADING_LANGUAGE_VERSION)),maxTextureSize:R(o.getParameter(o.MAX_TEXTURE_SIZE)),maxRenderbufferSize:R(o.getParameter(o.MAX_RENDERBUFFER_SIZE)),maxVertexUniformVectors:R(o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS)),maxFragmentUniformVectors:R(o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS)),extensionCount:I(()=>o.getSupportedExtensions()?.length),softwareRenderer:typeof a=="string"?pt.test(a):void 0};return I(()=>o.getExtension("WEBGL_lose_context")?.loseContext()),i}catch{return null}}function xe(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 _e(t)}function _e(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 Ee(){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 gt(e,t,o){if(!e)return;let n=globalThis,r=e,a=(c,d)=>I(()=>!!(c&&d 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 d=n[c];return d?.availability?await Promise.race([d.availability(),new Promise(p=>setTimeout(()=>p("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(d=>setTimeout(()=>d("timeout"),2e3))]):void 0}catch{return "error"}})(),languageDetectorApi:await l("LanguageDetector")}}function bt(){return I(()=>{let e=performance.memory;if(e)return {limit:R(e.jsHeapSizeLimit),used:R(e.usedJSHeapSize)}})}function yt(){if(typeof screen>"u")return null;try{let e=t=>typeof matchMedia=="function"?I(()=>matchMedia(t).matches):void 0;return {width:screen.width,height:screen.height,availWidth:R(screen.availWidth),availHeight:R(screen.availHeight),dpr:typeof devicePixelRatio<"u"?devicePixelRatio:1,colorDepth:R(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)}}catch{return null}}function wt(e){if(e)return I(()=>{let t=e.connection,o=typeof e.onLine=="boolean"?e.onLine:void 0;return t?{supported:!0,effectiveType:x(t.effectiveType),type:x(t.type),downlinkMbps:R(t.downlink),rttMs:R(t.rtt),saveData:typeof t.saveData=="boolean"?t.saveData:void 0,online:o}:{supported:!1,online:o}})}function vt(){return I(()=>({locale:x(Intl.DateTimeFormat().resolvedOptions().locale)}))}function Y(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,Math.round(e*4)/4))}async function kt(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 St(e){try{let t=e&&"getBattery"in e?e.getBattery:void 0;if(!t)return {batterySupported:!1};let o=await t.call(e);return {batterySupported:!0,charging:o.charging,level:Y(o.level)}}catch{return {batterySupported:false}}}function At(e){let t=e>>>0;return ()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295)}async function de(e){let t=e?.n??160,o=e?.minDurationMs??600,n=At(780228),r=new Float32Array(t*t),a=new Float32Array(t*t);for(let m=0;m<t*t;m++)r[m]=n()-.5,a[m]=n()-.5;let i=new Float32Array(t*t),s=2*t*t*t,l=0,c=w(),d=0;for(;d<o;)It(r,a,i,t),l++,d=w()-c,l%4===0&&await Promise.resolve();let p=0;for(let m=0;m<t*t;m+=97)p+=i[m];return {mflops:s*l/(d*1e3),n:t,iterations:l,durationMs:d,checksum:Math.fround(p)}}function It(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 Pe=[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 Le(e){return [...e].sort((t,o)=>t-o)}function Q(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=Le(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 X(e){return Q(e,.5)}function H(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 Be(e){if(e.length<2)return 0;let t=H(e),o=0;for(let n of e)o+=(n-t)*(n-t);return Math.sqrt(o/(e.length-1))}function Mt(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 _(e){if(e.length===0)throw new RangeError("summarize() requires a non-empty sample");let t=e.length,o=H(e),n=Be(e),r=Le(e),a=t>=2?Pe[Math.min(t-2,Pe.length-1)]*n/Math.sqrt(t):0;return {n:t,median:X(e),mean:o,sd:n,iqr:Q(e,.75)-Q(e,.25),min:r[0],max:r[t-1],ci95:a,cv:o===0?0:n/Math.abs(o)}}function ue(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=Ce(e),n=Ce(t);return Rt(o,n)}function Ce(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 Rt(e,t){let o=H(e),n=H(t),r=0,a=0,i=0;for(let l=0;l<e.length;l++){let c=e[l]-o,d=t[l]-n;r+=c*d,a+=c*c,i+=d*d;}let s=Math.sqrt(a*i);return s===0?0:r/s}var V=[{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]
|
|
@@ -24,16 +24,16 @@ B: Izzy plays Minecraft.
|
|
|
24
24
|
C: Emily stops working.
|
|
25
25
|
D: Russell makes dinner.
|
|
26
26
|
E: Ashleigh stops by.
|
|
27
|
-
~C \u2228 D`,subject:"formal_logic",choices:["If Emily doesn't stop working then Russell makes dinner.","Emily stops working unless Russell makes dinner.","Emily stops working unless Russell doesn't make dinner.","Emily doesn't stop working unless Russell makes dinner."],answer:3},{question:"The weight percent of sodium hydroxide dissolved in water is 50%. What is the mole fraction of sodium hydroxide?",subject:"high_school_chemistry",choices:["31.00%","0.164","0.311","0.5"],answer:2},{question:"In a certain region, the electric field varies with the radius away from origin by the equation Er = \u20136r^2 + 4r + 3, where r is given in meters and E in N/C. The potential difference between the origin and the point (3, 4) is",subject:"high_school_physics",choices:["\u2013165 V","\u2013120 V","64 V","185 V"],answer:3}];var
|
|
28
|
-
`);return `The following is a multiple choice question about ${
|
|
27
|
+
~C \u2228 D`,subject:"formal_logic",choices:["If Emily doesn't stop working then Russell makes dinner.","Emily stops working unless Russell makes dinner.","Emily stops working unless Russell doesn't make dinner.","Emily doesn't stop working unless Russell makes dinner."],answer:3},{question:"The weight percent of sodium hydroxide dissolved in water is 50%. What is the mole fraction of sodium hydroxide?",subject:"high_school_chemistry",choices:["31.00%","0.164","0.311","0.5"],answer:2},{question:"In a certain region, the electric field varies with the radius away from origin by the equation Er = \u20136r^2 + 4r + 3, where r is given in meters and E in N/C. The potential difference between the origin and the point (3, 4) is",subject:"high_school_physics",choices:["\u2013165 V","\u2013120 V","64 V","185 V"],answer:3}];var me=[{s1:"A girl is styling her hair.",s2:"A girl is brushing her hair.",score:2.5},{s1:"A group of men play soccer on the beach.",s2:"A group of boys are playing soccer on the beach.",score:3.6},{s1:"One woman is measuring another woman's ankle.",s2:"A woman measures another woman's ankle.",score:5},{s1:"A man is cutting up a cucumber.",s2:"A man is slicing a cucumber.",score:4.2},{s1:"A man is playing a harp.",s2:"A man is playing a keyboard.",score:1.5},{s1:"A woman is cutting onions.",s2:"A woman is cutting tofu.",score:1.8},{s1:"A man is riding an electric bicycle.",s2:"A man is riding a bicycle.",score:3.5},{s1:"A man is playing the drums.",s2:"A man is playing the guitar.",score:2.2},{s1:"A man is playing guitar.",s2:"A lady is playing the guitar.",score:2.2},{s1:"A man is playing a guitar.",s2:"A man is playing a trumpet.",score:1.714},{s1:"A man is playing a guitar.",s2:"A man is playing a trumpet.",score:1.714},{s1:"A man is cutting an onion.",s2:"A man cuts an onion.",score:5},{s1:"A man is cycling.",s2:"A man is talking.",score:.6},{s1:"A man is slicing open a fish.",s2:"A man is cutting up a fish.",score:4.4},{s1:"A man is slicing a tomato.",s2:"A man is slicing a bun.",score:2},{s1:"A man is playing a guitar.",s2:"A man is playing a keyboard.",score:1.8},{s1:"A baby panda goes down a slide.",s2:"A panda slides down a slide.",score:4.4},{s1:"A man is singing and playing a guitar.",s2:"A man is playing a guitar.",score:3.6},{s1:"A man attacks a woman.",s2:"A man slaps a woman.",score:3.6},{s1:"A man is driving a car.",s2:"A man is riding a horse.",score:1.2},{s1:"A woman is cutting tofu.",s2:"A woman is cutting an onion.",score:2.4},{s1:"The woman is styling her hair.",s2:"The woman is slicing herbs.",score:.2},{s1:"Two zebras play in an open field.",s2:"Two zebras are playing in a field.",score:4.2},{s1:"A man is cutting a potato.",s2:"A man is slicing some potato.",score:4.4},{s1:"A man is slicing an onion.",s2:"A woman is slicing a pumpkin.",score:2.25},{s1:"A man is dancing.",s2:"A man and woman is dancing.",score:2},{s1:"A man is riding a motorcycle.",s2:"A woman is riding a horse.",score:.75},{s1:"A woman is slicing garlics.",s2:"A woman is slicing an onion.",score:2.2},{s1:"A man is speaking.",s2:"A man is cooking.",score:.8},{s1:"A little boy is singing and playing a guitar.",s2:"A man is singing and playing the guitar.",score:2.2},{s1:"A turtle is swimming in water.",s2:"A turtle is walking underwater.",score:3.2},{s1:"A young woman is putting stickers all over her face.",s2:"A woman is applying stickers to her face.",score:4.8},{s1:"A woman is wrapping tofu.",s2:"A woman is balling dough.",score:1.4},{s1:"A cat is eating some corn.",s2:"A cat is eating corn on the cob.",score:4.25},{s1:"A man is eating a food.",s2:"A man is eating a piece of bread.",score:3.4},{s1:"A man is playing a guitar.",s2:"A man is eating pasta.",score:.533},{s1:"A man is kicking pots of water.",s2:"A man is picking flowers.",score:.4},{s1:"A man is cutting a pipe with scissors.",s2:"A man is cutting carpet with a knife.",score:1.2},{s1:"A woman is dancing in the rain.",s2:"A woman dances in the rain out side.",score:5},{s1:"A woman is taking a bath.",s2:"A woman is riding a horse.",score:.538},{s1:"A man mixes vegetables in a pot.",s2:"A person is stirring vegetables in a pot.",score:3.75},{s1:"A woman is talking on a cell phone.",s2:"A man and woman are talking on the phone.",score:3},{s1:"A man is playing a guitar.",s2:"A man is singing while playing the guitar.",score:3.6},{s1:"A man is playing a guitar.",s2:"A man is driving a car.",score:.5},{s1:"A man is cutting apple by his hand.",s2:"A man is cutting carpet with a knife.",score:1.5},{s1:"A man is opening a door.",s2:"A man is cutting an onion.",score:.8},{s1:"A man is slicing a tomato.",s2:"A man is riding a horse.",score:.8},{s1:"A man is cutting paper with a sword.",s2:"A woman is cutting a tomato.",score:.6},{s1:"A boy studies a calendar.",s2:"A boy is looking at a calendar.",score:4.4},{s1:"The ballerina is dancing.",s2:"A man is dancing.",score:1.75},{s1:"A woman is dancing.",s2:"A woman is playing violin.",score:.4},{s1:"A woman is slicing some tomatoes.",s2:"A woman is chopping a potato.",score:1.4},{s1:"A woman is water skiing.",s2:"A woman is slicing fish.",score:.4},{s1:"A man is playing a flute.",s2:"A man is riding a scooter.",score:.8},{s1:"A man is playing the piano.",s2:"A man played the guitar.",score:2},{s1:"A woman is picking a can.",s2:"A man is playing a guitar.",score:.133},{s1:"A man puts three pieces of meat into a pan.",s2:"A man is putting meat in a pan.",score:4},{s1:"A woman is cutting an onion.",s2:"A woman is cleaning a garden.",score:.267},{s1:"Some men are sawing.",s2:"Men are sawing logs.",score:3.4},{s1:"A car is driven down the road.",s2:"A girl is walking down a road.",score:1.2},{s1:"The man is kissing and hugging the woman.",s2:"A man is hugging and kissing a woman.",score:5},{s1:"A train is moving.",s2:"A man is doing yoga.",score:0},{s1:"Someone is slicing an onion.",s2:"A woman is cutting onion.",score:3.8},{s1:"A woman is playing in the ocean.",s2:"A woman is preparing shrimp to cook.",score:.75},{s1:"A person is playing an electronic keyboard.",s2:"A kid is playing keyboard.",score:3.4},{s1:"A man is holding a leaf.",s2:"A monkey is fighting a man.",score:0},{s1:"A woman is peeling shrimp.",s2:"A man is squeezing water.",score:.2},{s1:"A man is sitting and smoking.",s2:"A man is smoking a cigarette.",score:4},{s1:"A man is playing a guitar.",s2:"A woman is riding a horse.",score:.5},{s1:"A man is standing in front of the window and looking outside.",s2:"A man is staring out the window.",score:3.8},{s1:"A skunk is looking here and there.",s2:"A skunk looks at the camera.",score:2.4},{s1:"A man is playing the guitar and singing.",s2:"A man sings with a guitar.",score:4.75},{s1:"A woman opens a window.",s2:"A man is crawling.",score:0},{s1:"People are dancing outside.",s2:"A group of people are dancing.",score:3.75},{s1:"The man is using a camera to hammer a nail.",s2:"Someone is banging a camera lense against a nail.",score:2.6},{s1:"A woman is filing her nails.",s2:"A man is peeling a carrot.",score:0},{s1:"A boy is crawling into a dog house.",s2:"A boy is playing a wooden flute.",score:.75},{s1:"A woman is swimming underwater.",s2:"A man is slicing some carrots.",score:0},{s1:"A machine is sharpening a pencil.",s2:"The machine shaved the end of the pencil.",score:3.8},{s1:"A monkey is playing drums.",s2:"A gorilla plays the drums.",score:2.8},{s1:"A man is opening a box and taking out paper.",s2:"A woman is peeling a potato.",score:0},{s1:"A woman is dancing.",s2:"A woman plays the clarinet.",score:.8},{s1:"A person is drawing on a large touchscreen.",s2:"A man is drawing on a digital dry erase board.",score:3},{s1:"The men played follow the leader on the grass.",s2:"The rhino grazed on the grass.",score:1},{s1:"A woman is cracking eggs.",s2:"A man is talking to a woman.",score:0},{s1:"A woman peels garlic with her hands.",s2:"The woman is slicing herbs.",score:1},{s1:"The polar bears fought over the kill.",s2:"Polar bears are fighting each other.",score:3.4},{s1:"A man is doing trick with play cards.",s2:"A man is performing a card trick.",score:5},{s1:"The cat is licking a bottle.",s2:"A cat plays with a small bottle.",score:2.333},{s1:"A person is slicing an onion.",s2:"A person cuts ginger.",score:1.4},{s1:"A person is peeling a potato with a potato peeler.",s2:"A man is cutting tomatoes with a cleaver.",score:.75},{s1:"Two women are dancing and singing in front of a crowd.",s2:"The women are singing and dancing.",score:3.538},{s1:"A man is seasoning some carrots.",s2:"A woman is slicing garlic.",score:.8},{s1:"Two men pushed carts through the woods.",s2:"Two men are pushing carts.",score:3.5},{s1:"A man is playing a football.",s2:"A man is maneuvering a soccer ball with his feet.",score:2},{s1:"The lady peeled the potatoe.",s2:"A woman is peeling a potato.",score:4.75},{s1:"A woman is slicing some tofu.",s2:"A woman is cutting a block of tofu into small cubes.",score:4},{s1:"Someone typed on a keyboard.",s2:"Someone is typing.",score:4.5},{s1:"Three young men run, jump, and kick off of a Coke machine.",s2:"Three men are jumping off a wall.",score:1.5},{s1:"A young Asian girl is applying eyeliner.",s2:"A girl is putting on eye makeup.",score:2.4}];var he=["A","B","C","D"],qe=48,je=400;function We(e,t){let o=e.choices.map((n,r)=>`${he[r]}. ${n}`).join(`
|
|
28
|
+
`);return `The following is a multiple choice question about ${e.subject.replace(/_/g," ")}.
|
|
29
29
|
|
|
30
|
-
${
|
|
30
|
+
${e.question}
|
|
31
31
|
${o}
|
|
32
32
|
|
|
33
|
-
Answer with only the letter (A, B, C, or D) of the correct choice.${
|
|
34
|
-
Answer:`}function vt(t){let e=t.replace(/<think>[\s\S]*?<\/think>/gi," "),o=e.search(/<think>/i);return o===-1?e:e.slice(0,o)}function Q(t,e){let o=vt(t).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<e.length;s++)if(i.startsWith(e[s].toLowerCase().slice(0,Math.max(8,e[s].length))))return s;return null}async function ue(t,e,o){let n=V.slice(0,e),r=[],a=[],i=0,s=0;for(let l=0;l<n.length;l++){if(o?.abortSignal?.aborted)throw x();let c=n[l],d=(await t.doGenerate({prompt:Ee(c,o?.promptSuffix),maxTokens:Pe,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-${e}`,score:n.length===0?0:i/n.length,n:n.length,details:r,outputs:a,parseRate:n.length===0?0:s/n.length}}function kt(t,e){let o=0,n=0,r=0;for(let i=0;i<t.length;i++)o+=t[i]*e[i],n+=t[i]*t[i],r+=e[i]*e[i];let a=Math.sqrt(n)*Math.sqrt(r);return a===0?0:o/a}async function me(t,e,o){let n=ce.slice(0,e),r=[],a=[];for(let i=0;i<n.length;i++){if(o?.abortSignal?.aborted)throw x();let s=n[i],{embeddings:l}=await t.doEmbed({values:[s.s1,s.s2],abortSignal:o?.abortSignal});r.push(kt(l[0],l[1])),a.push(s.score),o?.onProgress?.(i+1,n.length);}return {taskId:`stsb-${e}`,score:r.length>=2?le(r,a):0,n:n.length,details:r.map(i=>Math.round(i*1e4)/1e4)}}var St=2,Le=.2,At=[{maxBytes:5e8,max:4e3},{maxBytes:1e9,max:2500},{maxBytes:2e9,max:1500},{maxBytes:Number.POSITIVE_INFINITY,max:1e3}],It=2e3,Mt=[/swiftshader/i,/llvmpipe/i,/softpipe/i,/\bwarp\b/i,/microsoft basic render/i,/parallels/i,/vmware/i,/virtio/i,/virtualbox/i];function Be(t){let e=[],o=i=>{e.length<50&&e.push(i);};if(typeof t!="object"||t===null)return ["result must be an object"];let n=t;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)=>Rt(i,s,o)):o("cells must be an array"),Array.isArray(n.events)||o("events must be an array"),e}function Rt(t,e,o){if(typeof t!="object"||t===null){o(`cells[${e}] must be an object`);return}let n=t,r=`cells[${e}]`;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(t){return t.length>0&&"chunks"in t[0]}function J(t){let e=t.chunks.filter(r=>r.c>0);if(e.length<2)return false;let o=e[e.length-1].t-e[0].t,n=t.endT-t.startT;return n>0&&o/n>=Le}function X(t,e=.05,o){let n={cellId:t.cellId,status:t.status,highVariance:false};if(t.load&&(n.loadMs=t.load.endT-t.load.startT,n.loadCached=t.load.cached),t.quality&&(n.qualityScore=t.quality.score,t.quality.parseRate!==void 0&&(n.qualityParseRate=t.quality.parseRate)),t.iterations.length===0)return n;if(qe(t.iterations)){let a=t.iterations.every(J);n.streamIncremental=a;let i=[],s=[],l=[],c=[],m=[],d=[],f=[];for(let h of t.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],M=y-u.c,v=S.t-u.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=_(i)),s.length>0&&(n.decodeCharsPerSec=_(s)),l.length>0&&(n.decodeChunksPerSec=_(l)),c.length>0&&(n.generatedChars=_(c)),m.length>0&&(n.prefillTokPerSecApprox=_(m)),d.length>0&&(n.totalMs=_(d)),f.length>0&&(n.overallCharsPerSec=_(f));}else {let a=t.iterations,i=a.map(s=>s.endT-s.startT).filter(s=>s>0);i.length>0&&(a[0].count===1?n.singleLatencyMs=_(i):n.batchTextsPerSec=_(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>e),n}function O(t,e=.05,o){let r=o??new Map([["chat-pp128-tg128",128],["chat-pp512-tg128",512]]);return t.cells.map(a=>X(a,e,r.get(a.workloadId)))}function je(t){let e=[],o=(s,l,c,m)=>e.push({code:s,message:l,severity:c,...m?{cellId:m}:{}});t.fingerprint?(t.fingerprint.mflops<=1||t.fingerprint.mflops>1e5||!Number.isFinite(t.fingerprint.checksum))&&o("fingerprint-implausible",`fingerprint mflops=${t.fingerprint.mflops}`,"reject"):o("fingerprint-missing","no hardware fingerprint in submission","reject");let n=t.environment.timerResolutionUs;for(let s of t.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<L)&&o("degenerate-generation",`an ok cell has a timed iteration with fewer than ${L} generated chars`,"reject",s.cellId);let c=s.model.sizeBytes??Number.POSITIVE_INFINITY,m=At.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=V[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>It&&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=t.environment.gpu.vendor?.toLowerCase()??"",a=t.environment.os.platform.toLowerCase();r==="apple"&&a.includes("windows")&&o("env-cross-field","Apple GPU adapter with Windows platform","reject");let i=[t.environment.gpu.vendor,t.environment.gpu.architecture,t.environment.gpu.device,t.environment.gpu.description,t.environment.webglRenderer].filter(Boolean).join(" ");if(Mt.some(s=>s.test(i))){let s=t.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 e}function Tt(t){let e=Be(t);if(e.length>0)return {ok:false,shapeErrors:e,flags:[],summaries:[]};let o=O(t),n=je(t);if(t.clientSummaries){let r=new Map(o.map(a=>[a.cellId,a]));for(let a of t.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 xt(t){let{policy:e,hooks:o,abortSignal:n}=t,r=t.trace??new $;await r.attach(),r.record("suite-start",t.suite);let a=G(),i=[];try{o?.onPhase?.("environment");let s=await ie({userReportedDevice:t.userReportedDevice});o?.onEnvironment?.(s),o?.onPhase?.("fingerprint"),C(n);let l=t.skipFingerprint?null:await se(),c=a!=="none"?await N():null,m=_t(oe(t.cells)),d=t.cells.length,f=0;for(let y of m){C(n);let p=await Pt(y,{...t,trace:r,memApi:a,baselineMemory:c,cellIndexRef:()=>f++,totalCells:d});i.push(...p),p.some(u=>u.status!=="skipped")&&(r.record("cooldown-start"),await F(e.cooldownMs,n).catch(u=>{if(n?.aborted)throw u}),e.pressureGate&&await Lt(r,e.pressureGateTimeoutMs,n),r.record("cooldown-end"));}r.record("suite-end");let h={protocol:j,schemaVersion:2,runId:jt(),createdAt:new Date().toISOString(),harness:t.harness,suite:t.suite,environment:s,fingerprint:l,cells:i,events:[...r.all]};return h.clientSummaries=O(h,e.highVarianceCv),h}finally{await r.dispose();}}function _t(t){let e=new Map;for(let o of t){let n=`${o.model.runtimeId}/${o.model.benchModelId}/${o.model.providerModelId}`,r=e.get(n);r||(r={key:n,model:o.model,workloads:[],skipped:[]},e.set(n,r)),o.skipReason?r.skipped.push({workload:o.workload,reason:o.skipReason}):r.workloads.push(o.workload);}return [...e.values()]}async function Pt(t,e){let{model:o}=t,n=o.task==="embedding",r=n?e.embedAdapters.get(o.runtimeId):e.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 t.skipped){let b=i(p);b.invalidReasons=[u],a.push(D(b,e));}if(t.workloads.length===0)return a;if(!r){for(let p of t.workloads){let u=i(p);u.invalidReasons=[`no adapter registered for ${o.runtimeId}`],a.push(D(u,e));}return a}let s=await r.isAvailable();if(!s.ok){for(let p of t.workloads){let u=i(p);u.invalidReasons=[`runtime unavailable: ${s.reason??"unknown"}`],a.push(D(u,e));}return a}let l=null,c=null,m,d=null,f=[],h=`${o.runtimeId}/${o.benchModelId}/${t.workloads[0].id}`;for(let p=1;p<=Math.max(1,e.policy.maxAttempts);p++)try{C(e.abortSignal);let u=await r.isModelCached(o),b=[],S=w();e.hooks?.onActivity?.({cellId:h,phase:"load"}),l=await B((v,g)=>Ne(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}),e.hooks?.onLoadProgress?.(h,k.pct),e.hooks?.onActivity?.({cellId:h,phase:"load",pct:k.pct});}}),v),{parent:e.abortSignal,stallMs:e.policy.loadStallMs,timeoutMs:e.policy.loadTimeoutMs,what:"load"});let M=w();if(c={cached:u,startT:S,endT:M,progress:b.length>0?Bt(b,50):void 0,declaredBytes:o.sizeBytes},e.memApi!=="none"&&(d=await N()),e.policy.warmupRuns>0){let v=w();for(let g=0;g<e.policy.warmupRuns;g++){C(e.abortSignal);let k=l;e.hooks?.onActivity?.({cellId:h,phase:"warmup",iteration:g+1,total:e.policy.warmupRuns,chars:0,chunks:0}),await B((A,P)=>n?k.model.doEmbed({values:["warmup probe"],abortSignal:A}):Fe(k.model,{prompt:"Reply with the single word: ready",maxTokens:4,temperature:0},A,(Ke,Ye)=>{P(),e.hooks?.onActivity?.({cellId:h,phase:"warmup",chars:Ke,chunks:Ye});}),{parent:e.abortSignal,stallMs:e.policy.chunkStallMs,timeoutMs:e.policy.iterationTimeoutMs,what:"warmup"}),e.hooks?.onActivity?.({cellId:h,phase:"warmup",iteration:g+1,total:e.policy.warmupRuns});}m=w()-v;}break}catch(u){if(e.abortSignal?.aborted)throw l&&await U(l),x();l&&await U(l),l=null;let b=We(u);if(b.name==="TimeoutError"&&e.trace.record("cell-timeout",`${h}: ${b.message}`),p<Math.max(1,e.policy.maxAttempts)){f.push({error:b,at:w()}),e.trace.record("cell-retry",`${h} attempt ${p+1}`),e.hooks?.onCellRetry?.(h,p+1,b);continue}let S=e.memApi!=="none"?await N(5e3):null;for(let M of t.workloads){let v=i(M);v.status="error",v.load=c,v.error=b,f.length>0&&(v.attempts=[...f]),e.memApi!=="none"&&(v.memory={api:e.memApi,baseline:e.baselineMemory??void 0,postLoad:d??void 0,atError:S??void 0}),a.push(D(v,e));}return a}if(!l)return a;let y=false;for(let p of t.workloads){C(e.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=e.cellIndexRef();e.hooks?.onCellStart?.(u.cellId,b,e.totalCells);let S=l,M=async()=>{switch(p.kind){case "llm-generate":await Ct(u,S,p,e);break;case "embed-single":case "embed-batch":await Et(u,S,p,e);break;case "quality-mmlu":{let g=p.items;u.quality=await B((k,A)=>ue(S.model,g,{abortSignal:k,onProgress:P=>{A(),e.hooks?.onIteration?.(u.cellId,P,g),e.hooks?.onActivity?.({cellId:u.cellId,phase:"quality",iteration:P,total:g});},promptSuffix:o.qualityPromptSuffix}),{parent:e.abortSignal,stallMs:e.policy.chunkStallMs,timeoutMs:e.policy.qualityTimeoutMs,what:"quality lane"}),u.status="ok";break}case "quality-sts":{let g=p.items;u.quality=await B((k,A)=>me(S.model,g,{abortSignal:k,onProgress:P=>{A(),e.hooks?.onIteration?.(u.cellId,P,g),e.hooks?.onActivity?.({cellId:u.cellId,phase:"quality",iteration:P,total:g});}}),{parent:e.abortSignal,stallMs:e.policy.chunkStallMs,timeoutMs:e.policy.qualityTimeoutMs,what:"quality lane"}),u.status="ok";break}}},v=Math.max(1,e.policy.maxAttempts);for(let g=1;g<=v;g++)try{await M();break}catch(k){if(e.abortSignal?.aborted)throw await U(l),x();let A=We(k);if(A.name==="TimeoutError"&&e.trace.record("cell-timeout",`${u.cellId}: ${A.message}`),g<v){u.attempts=[...u.attempts??[],{error:A,at:w()}],u.iterations=[],u.quality=void 0,u.invalidReasons=void 0,u.status="skipped",e.trace.record("cell-retry",`${u.cellId} attempt ${g+1}`),e.hooks?.onCellRetry?.(u.cellId,g+1,A);continue}u.status="error",u.error=A;}if(e.memApi!=="none"&&(u.status==="ok"||u.status==="error")){let g=await N(5e3);u.memory={api:e.memApi,baseline:e.baselineMemory??void 0,postLoad:d??void 0,...u.status==="ok"?{postRun:g??void 0}:{atError:g??void 0}};}a.push(D(u,e));}if(await U(l),e.policy.measureWarmReload&&c?.cached===false)try{C(e.abortSignal);let p=`${o.runtimeId}/${o.benchModelId}/warm-reload`;e.hooks?.onActivity?.({cellId:p,phase:"reload"});let u=w(),b=await B((k,A)=>Ne(r.load(o,{abortSignal:k,onProgress:P=>{A(),e.hooks?.onActivity?.({cellId:p,phase:"reload",pct:P.pct});}}),k),{parent:e.abortSignal,stallMs:e.policy.loadStallMs,timeoutMs:e.policy.loadTimeoutMs,what:"load"}),S=w(),M=b.resolvedBackend,v=b.runtimeConfig?{...b.runtimeConfig}:void 0;await U(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:u,endT:S,declaredBytes:o.sizeBytes},iterations:[],status:"ok"};a.push(D(g,e));}catch{if(e.abortSignal?.aborted)throw x()}return a}async function Ct(t,e,o,n){let r=[],a=[];for(let i=0;i<n.policy.timedRuns;i++){let s=i+1;for(let l=0;;l++){C(n.abortSignal),n.hooks?.onIteration?.(t.cellId,s,n.policy.timedRuns),await Ue(n,t.cellId);let c=[];n.trace.isHidden&&c.push("started-hidden");let m=ee(n.trace);n.hooks?.onActivity?.({cellId:t.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,M)=>Fe(e.model,{prompt:o.prompt,systemPrompt:o.systemPrompt,maxTokens:o.maxTokens,temperature:o.temperature},S,(v,g)=>{M(),n.hooks?.onActivity?.({cellId:t.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<L&&c.push("degenerate-output");let b={startT:d,chunks:f,endT:u,text:h,providerUsage:y?{...y,fidelity:re[t.runtimeId]}:void 0,finishReason:p,gates:c};if(Oe(c)&&l<Math.max(1,n.policy.maxAttempts)){a.push(b),n.trace.record("iteration-redo",`${t.cellId} iteration ${s}: ${c.join(",")}`);continue}r.push(b);break}}t.iterations=r,a.length>0&&(t.discardedIterations=a),De(t,r);}function Oe(t){return t.includes("started-hidden")||t.includes("hidden-during-run")}function De(t,e){let o=e.some(n=>n.gates.length>0);if(t.status=o?"invalid":"ok",o){let n=new Set;for(let r of e)for(let a of r.gates)n.add(a==="degenerate-output"?`degenerate output: fewer than ${L} 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");t.invalidReasons=[...n];}}async function Ue(t,e){if(!t.trace.isHidden)return true;t.hooks?.onActivity?.({cellId:e,phase:"waiting-visible"});let o=w()+t.policy.visibilityWaitMs;for(;t.trace.isHidden&&w()<o;)C(t.abortSignal),await F(Math.min(250,t.policy.visibilityWaitMs),t.abortSignal);return !t.trace.isHidden}async function Et(t,e,o,n){let r=[],a=[];for(let i=0;i<n.policy.timedRuns;i++)for(let s=0;;s++){C(n.abortSignal),n.hooks?.onIteration?.(t.cellId,i+1,n.policy.timedRuns),await Ue(n,t.cellId);let l=[];n.trace.isHidden&&l.push("started-hidden");let c=ee(n.trace),m=w(),{embeddings:d}=await B(y=>e.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:t.cellId,phase:"iteration",iteration:i+1,total:n.policy.timedRuns});let h={startT:m,endT:f,count:o.texts.length,dimensions:d[0]?.length??e.model.dimensions,gates:l};if(Oe(l)&&s<Math.max(1,n.policy.maxAttempts)){a.push(h),n.trace.record("iteration-redo",`${t.cellId} iteration ${i+1}: ${l.join(",")}`);continue}r.push(h);break}t.iterations=r,a.length>0&&(t.discardedIterations=a),De(t,r);}async function Fe(t,e,o,n){let r=[],a="",i,s;if(t.doStream)for await(let l of t.doStream({...e,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 t.doGenerate({...e,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(e){super(e),this.name="TimeoutError";}};async function B(t,e){let o=new AbortController,n=()=>{},r=new Promise((h,y)=>{n=y;}),a=()=>{o.abort(e.parent?.reason),n(x());};e.parent?.aborted&&a(),e.parent?.addEventListener("abort",a,{once:true});let i=w(),s=i,l=false,c=h=>{l||(l=true,o.abort(new Z(h)),n(new Z(h)));},d=setInterval(()=>{if(l)return;let h=w();if(h-s>=e.stallMs){c(e.what==="load"?`load made no progress for ${e.stallMs} ms`:`${e.what}: no stream progress for ${e.stallMs} ms`);return}h-i>=e.timeoutMs&&c(`${e.what}: exceeded the ${e.timeoutMs} ms budget`);},Math.max(10,Math.min(e.stallMs,e.timeoutMs)/4)),f=()=>{s=w();};try{let h=t(o.signal,f);return h.catch(()=>{}),await Promise.race([h,r])}finally{l=true,clearInterval(d),e.parent?.removeEventListener("abort",a);}}function ee(t){let e=0;for(let o of t.all)o.type==="visibility-hidden"&&e++;return e}async function Lt(t,e,o){let n=w()+e;for(;w()<n;){let r=t.pressureState;if(r===void 0||r==="nominal"||r==="fair")return;await F(1e3,o);}}function Bt(t,e){if(t.length<=e)return t;let o=[],n=(t.length-1)/(e-1);for(let r=0;r<e;r++)o.push(t[Math.round(r*n)]);return o}var qt=4e3;function We(t){let e=t,o=e?.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,qt):void 0;return {name:e?.name??"Error",message:e?.message??String(t),...n!==void 0?{cause:n}:{},...r?{causeName:r}:{},...a?{causeStack:a}:{}}}function D(t,e){return e.hooks?.onCellFinish?.(t),t}async function Ne(t,e){let o=await t;if(e.aborted)throw await U(o),x();return o}async function U(t){try{await t.dispose();}catch{}}function C(t){if(t?.aborted)throw x()}function jt(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let o=[...e].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 $e(t){return he(t)}function he(t){if(t===null||typeof t=="number"||typeof t=="boolean"||typeof t=="string")return JSON.stringify(t);if(typeof t>"u")return "null";if(Array.isArray(t))return `[${t.map(e=>he(e)).join(",")}]`;if(typeof t=="object")return `{${Object.entries(t).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 t}`)}async function He(t){let e=globalThis.crypto?.subtle;if(!e)throw new Error("Web Crypto (crypto.subtle) is not available in this environment");let o=new TextEncoder().encode(t),n=await e.digest("SHA-256",o);return [...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function Ve(t){let{digest:e,...o}=t;return He($e(o))}async function Wt(t){return t.digest?await Ve(t)===t.digest:false}function fe(t){let e=t.environment,o=e.gpu.available?[e.gpu.vendor??"gpu",e.gpu.architecture].filter(Boolean).join("-"):"no-webgpu";return [e.os.platform.toLowerCase().replace(/\s+/g,"-"),o].join("/")}var Ge=3;function Nt(t,e=Ge){let o=new Map;for(let r of t){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),ze(d.row.resolvedBackends,l.resolvedBackend),ze(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<e});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 ze(t,e){e&&!t.includes(e)&&t.push(e);}function E(t){return t.length>0?q(Y(t)):void 0}function q(t){return Math.round(t*100)/100}function pe(t){let e=t==null?"":String(t);return /[",\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function Ot(t){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 t)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(`
|
|
33
|
+
Answer with only the letter (A, B, C, or D) of the correct choice.${t??""}
|
|
34
|
+
Answer:`}function Tt(e){let t=e.replace(/<think>[\s\S]*?<\/think>/gi," "),o=t.search(/<think>/i);return o===-1?t:t.slice(0,o)}function J(e,t){let o=Tt(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 he.indexOf(r[1]);let a=n.match(/^\(?([abcd])(?:\)|\.|$)/);if(a)return he.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 pe(e,t,o){let n=V.slice(0,t),r=[],a=[],i=0,s=0;for(let l=0;l<n.length;l++){if(o?.abortSignal?.aborted)throw T();let c=n[l],p=(await e.doGenerate({prompt:We(c,o?.promptSuffix),maxTokens:qe,temperature:0,abortSignal:o?.abortSignal})).text.slice(0,je),m=J(p,c.choices);m!==null&&s++;let h=m===c.answer?1:0;i+=h,r.push(h),a.push(p),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 xt(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 fe(e,t,o){let n=me.slice(0,t),r=[],a=[];for(let i=0;i<n.length;i++){if(o?.abortSignal?.aborted)throw T();let s=n[i],{embeddings:l}=await e.doEmbed({values:[s.s1,s.s2],abortSignal:o?.abortSignal});r.push(xt(l[0],l[1])),a.push(s.score),o?.onProgress?.(i+1,n.length);}return {taskId:`stsb-${t}`,score:r.length>=2?ue(r,a):0,n:n.length,details:r.map(i=>Math.round(i*1e4)/1e4)}}var _t=2,Ne=.2,Et=[{maxBytes:5e8,max:4e3},{maxBytes:1e9,max:2500},{maxBytes:2e9,max:1500},{maxBytes:Number.POSITIVE_INFINITY,max:1e3}],Pt=2e3,Ct=[/swiftshader/i,/llvmpipe/i,/softpipe/i,/\bwarp\b/i,/microsoft basic render/i,/parallels/i,/vmware/i,/virtio/i,/virtualbox/i];function Oe(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}"`),z.includes(n.schemaVersion)||o(`schemaVersion must be one of ${z.join(", ")}`),(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)=>Lt(i,s,o)):o("cells must be an array"),Array.isArray(n.events)||o("events must be an array"),t}function Lt(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 De(e){return e.length>0&&"chunks"in e[0]}function ee(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>=Ne}function Z(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(De(e.iterations)){let a=e.iterations.every(ee);n.streamIncremental=a;let i=[],s=[],l=[],c=[],d=[],p=[],m=[];for(let h of e.iterations){let y=h.chunks.reduce((g,k)=>g+k.c,0),f=h.endT-h.startT;if(f>0&&(p.push(f),y>0&&m.push(y/f*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],M=y-u.c,v=S.t-u.t;v>0&&M>0&&(s.push(M/v*1e3),l.push((h.chunks.length-1)/v*1e3)),o&&b>0&&d.push(o/b*1e3);}i.length>0&&(n.ttftMs=_(i)),s.length>0&&(n.decodeCharsPerSec=_(s)),l.length>0&&(n.decodeChunksPerSec=_(l)),c.length>0&&(n.generatedChars=_(c)),d.length>0&&(n.prefillTokPerSecApprox=_(d)),p.length>0&&(n.totalMs=_(p)),m.length>0&&(n.overallCharsPerSec=_(m));}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=_(i):n.batchTextsPerSec=_(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 N(e,t=.05,o){let r=o??new Map([["chat-pp128-tg128",128],["chat-pp512-tg128",512]]);return e.cells.map(a=>Z(a,t,r.get(a.workloadId)))}function Ue(e){let t=[],o=(s,l,c,d)=>t.push({code:s,message:l,severity:c,...d?{cellId:d}:{}});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),De(s.iterations)){for(let p of s.iterations){let m=p.startT,h=true;for(let f of p.chunks)f.t<m&&(h=false),m=f.t;if(!h||p.endT<m){o("trace-not-monotonic","chunk timestamps are not monotonic","reject",s.cellId);break}let y=p.chunks.reduce((f,u)=>f+u.c,0);if(p.text.length!==y){o("text-chunk-mismatch",`text length ${p.text.length} != chunk sum ${y}`,"reject",s.cellId);break}}let l=Z(s);s.iterations.some(p=>p.text.length<L)&&o("degenerate-generation",`an ok cell has a timed iteration with fewer than ${L} generated chars`,"reject",s.cellId);let c=s.model.sizeBytes??Number.POSITIVE_INFINITY,d=Et.find(p=>c<=p.maxBytes);if(d&&l.decodeCharsPerSec&&l.decodeCharsPerSec.median>d.max&&o("decode-rate-envelope",`decode ${Math.round(l.decodeCharsPerSec.median)} chars/s exceeds envelope ${d.max} for model size`,"reject",s.cellId),d&&l.overallCharsPerSec&&l.overallCharsPerSec.median>d.max&&o("overall-rate-envelope",`overall ${Math.round(l.overallCharsPerSec.median)} chars/s exceeds envelope ${d.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 p=n/1e3,m=0,h=0;for(let y of s.iterations)for(let f of y.chunks)h++,Math.abs(f.t/p-Math.round(f.t/p))>.01&&m++;h>=20&&m/h>.5&&o("timer-grid",`${m}/${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:d,n:p}=s.quality;if(l.length!==p||!c||c.length!==p)o("quality-outputs-mismatch","quality outputs/details length disagrees with n","reject",s.cellId);else {let m=0,h=true;for(let y=0;y<p;y++){let f=V[y];if(!f)break;let u=J(l[y],f.choices)===f.answer?1:0;m+=u,u!==c[y]&&(h=false);}(!h||Math.abs(m/p-d)>1e-9)&&o("quality-details-mismatch",`submitted MMLU score ${d} disagrees with recompute ${m/p} from raw outputs`,"reject",s.cellId);}}else if(s.iterations.length>0){let l=Z(s);l.batchTextsPerSec&&l.batchTextsPerSec.median>Pt&&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(Ct.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 Bt(e){let t=Oe(e);if(t.length>0)return {ok:false,shapeErrors:t,flags:[],summaries:[]};let o=N(e),n=Ue(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 qt(e){let{policy:t,hooks:o,abortSignal:n}=e,r=e.trace??new $;await r.attach(),r.record("suite-start",e.suite);let a=K(),i=[];try{o?.onPhase?.("environment");let s=await ce({userReportedDevice:e.userReportedDevice});o?.onEnvironment?.(s),o?.onPhase?.("fingerprint"),P(n);let l=e.skipFingerprint?null:await de(),c=a!=="none"?await W():null,d=jt(ie(e.cells)),p=e.cells.length,m=0;for(let y of d){P(n);let f=await Wt(y,{...e,trace:r,memApi:a,baselineMemory:c,cellIndexRef:()=>m++,totalCells:p});i.push(...f),f.some(u=>u.status!=="skipped")&&(r.record("cooldown-start"),await F(t.cooldownMs,n).catch(u=>{if(n?.aborted)throw u}),t.pressureGate&&await Dt(r,t.pressureGateTimeoutMs,n),r.record("cooldown-end"));}r.record("suite-end");let h={protocol:j,schemaVersion:3,runId:$t(),createdAt:new Date().toISOString(),harness:e.harness,suite:e.suite,environment:s,fingerprint:l,cells:i,events:[...r.all]};return h.clientSummaries=N(h,t.highVarianceCv),h}finally{await r.dispose();}}function jt(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 Wt(e,t){let{model:o}=e,n=o.task==="embedding",r=n?t.embedAdapters.get(o.runtimeId):t.llmAdapters.get(o.runtimeId),a=[],i=f=>({cellId:`${o.runtimeId}/${o.benchModelId}/${f.id}`,runtimeId:o.runtimeId,runtimeVersion:r?.runtimeVersion,model:o,workloadId:f.id,workloadKind:f.kind,resolvedBackend:"unknown",load:null,iterations:[],status:"skipped"});for(let{workload:f,reason:u}of e.skipped){let b=i(f);b.invalidReasons=[u],a.push(O(b,t));}if(e.workloads.length===0)return a;if(!r){for(let f of e.workloads){let u=i(f);u.invalidReasons=[`no adapter registered for ${o.runtimeId}`],a.push(O(u,t));}return a}let s=await r.isAvailable();if(!s.ok){for(let f of e.workloads){let u=i(f);u.invalidReasons=[`runtime unavailable: ${s.reason??"unknown"}`],a.push(O(u,t));}return a}let l=null,c=null,d,p=null,m=[],h=`${o.runtimeId}/${o.benchModelId}/${e.workloads[0].id}`;for(let f=1;f<=Math.max(1,t.policy.maxAttempts);f++)try{P(t.abortSignal);let u=await r.isModelCached(o),b=[],S=w();t.hooks?.onActivity?.({cellId:h,phase:"load"}),l=await B((v,g)=>$e(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});}}),v),{parent:t.abortSignal,stallMs:t.policy.loadStallMs,timeoutMs:t.policy.loadTimeoutMs,what:"load"});let M=w();if(c={cached:u,startT:S,endT:M,progress:b.length>0?Ut(b,50):void 0,declaredBytes:o.sizeBytes},t.memApi!=="none"&&(p=await W()),t.policy.warmupRuns>0){let v=w();for(let g=0;g<t.policy.warmupRuns;g++){P(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,E)=>n?k.model.doEmbed({values:["warmup probe"],abortSignal:A}):Ge(k.model,{prompt:"Reply with the single word: ready",maxTokens:4,temperature:0},A,(Ze,et)=>{E(),t.hooks?.onActivity?.({cellId:h,phase:"warmup",chars:Ze,chunks:et});}),{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});}d=w()-v;}break}catch(u){if(t.abortSignal?.aborted)throw l&&await D(l),T();l&&await D(l),l=null;let b=Fe(u);if(b.name==="TimeoutError"&&t.trace.record("cell-timeout",`${h}: ${b.message}`),f<Math.max(1,t.policy.maxAttempts)){m.push({error:b,at:w()}),t.trace.record("cell-retry",`${h} attempt ${f+1}`),t.hooks?.onCellRetry?.(h,f+1,b);continue}let S=t.memApi!=="none"?await W(5e3):null;for(let M of e.workloads){let v=i(M);v.status="error",v.load=c,v.error=b,m.length>0&&(v.attempts=[...m]),t.memApi!=="none"&&(v.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:p??void 0,atError:S??void 0}),a.push(O(v,t));}return a}if(!l)return a;let y=false;for(let f of e.workloads){P(t.abortSignal);let u=i(f);u.resolvedBackend=l.resolvedBackend,l.runtimeConfig&&(u.runtimeConfig={...l.runtimeConfig}),y||(u.load=c,u.warmupMs=d,m.length>0&&(u.attempts=[...m]),y=true);let b=t.cellIndexRef();t.hooks?.onCellStart?.(u.cellId,b,t.totalCells);let S=l,M=async()=>{switch(f.kind){case "llm-generate":await Nt(u,S,f,t);break;case "embed-single":case "embed-batch":await Ot(u,S,f,t);break;case "quality-mmlu":{let g=f.items;u.quality=await B((k,A)=>pe(S.model,g,{abortSignal:k,onProgress:E=>{A(),t.hooks?.onIteration?.(u.cellId,E,g),t.hooks?.onActivity?.({cellId:u.cellId,phase:"quality",iteration:E,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=f.items;u.quality=await B((k,A)=>fe(S.model,g,{abortSignal:k,onProgress:E=>{A(),t.hooks?.onIteration?.(u.cellId,E,g),t.hooks?.onActivity?.({cellId:u.cellId,phase:"quality",iteration:E,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 M();break}catch(k){if(t.abortSignal?.aborted)throw await D(l),T();let A=Fe(k);if(A.name==="TimeoutError"&&t.trace.record("cell-timeout",`${u.cellId}: ${A.message}`),g<v){u.attempts=[...u.attempts??[],{error:A,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,A);continue}u.status="error",u.error=A;}if(t.memApi!=="none"&&(u.status==="ok"||u.status==="error")){let g=await W(5e3);u.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:p??void 0,...u.status==="ok"?{postRun:g??void 0}:{atError:g??void 0}};}a.push(O(u,t));}if(await D(l),t.policy.measureWarmReload&&c?.cached===false)try{P(t.abortSignal);let f=`${o.runtimeId}/${o.benchModelId}/warm-reload`;t.hooks?.onActivity?.({cellId:f,phase:"reload"});let u=w(),b=await B((k,A)=>$e(r.load(o,{abortSignal:k,onProgress:E=>{A(),t.hooks?.onActivity?.({cellId:f,phase:"reload",pct:E.pct});}}),k),{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 D(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:u,endT:S,declaredBytes:o.sizeBytes},iterations:[],status:"ok"};a.push(O(g,t));}catch{if(t.abortSignal?.aborted)throw T()}return a}async function Nt(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++){P(n.abortSignal),n.hooks?.onIteration?.(e.cellId,s,n.policy.timedRuns),await ze(n,e.cellId);let c=[];n.trace.isHidden&&c.push("started-hidden");let d=ne(n.trace);n.hooks?.onActivity?.({cellId:e.cellId,phase:"iteration",iteration:s,total:n.policy.timedRuns,chars:0,chunks:0});let p=w(),{chunks:m,text:h,providerUsage:y,finishReason:f}=await B((S,M)=>Ge(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}`}),u=w();ne(n.trace)>d&&c.push("hidden-during-run"),h.length<L&&c.push("degenerate-output");let b={startT:p,chunks:m,endT:u,text:h,providerUsage:y?{...y,fidelity:se[e.runtimeId]}:void 0,finishReason:f,gates:c};if(He(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),Ve(e,r);}function He(e){return e.includes("started-hidden")||e.includes("hidden-during-run")}function Ve(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 ${L} 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 ze(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;)P(e.abortSignal),await F(Math.min(250,e.policy.visibilityWaitMs),e.abortSignal);return !e.trace.isHidden}async function Ot(e,t,o,n){let r=[],a=[];for(let i=0;i<n.policy.timedRuns;i++)for(let s=0;;s++){P(n.abortSignal),n.hooks?.onIteration?.(e.cellId,i+1,n.policy.timedRuns),await ze(n,e.cellId);let l=[];n.trace.isHidden&&l.push("started-hidden");let c=ne(n.trace),d=w(),{embeddings:p}=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}`}),m=w();ne(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:d,endT:m,count:o.texts.length,dimensions:p[0]?.length??t.model.dimensions,gates:l};if(He(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),Ve(e,r);}async function Ge(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 te=class extends Error{constructor(t){super(t),this.name="TimeoutError";}};async function B(e,t){let o=new AbortController,n=()=>{},r=new Promise((h,y)=>{n=y;}),a=()=>{o.abort(t.parent?.reason),n(T());};t.parent?.aborted&&a(),t.parent?.addEventListener("abort",a,{once:true});let i=w(),s=i,l=false,c=h=>{l||(l=true,o.abort(new te(h)),n(new te(h)));},p=setInterval(()=>{if(l)return;let h=w();if(h-s>=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-i>=t.timeoutMs&&c(`${t.what}: exceeded the ${t.timeoutMs} ms budget`);},Math.max(10,Math.min(t.stallMs,t.timeoutMs)/4)),m=()=>{s=w();};try{let h=e(o.signal,m);return h.catch(()=>{}),await Promise.race([h,r])}finally{l=true,clearInterval(p),t.parent?.removeEventListener("abort",a);}}function ne(e){let t=0;for(let o of e.all)o.type==="visibility-hidden"&&t++;return t}async function Dt(e,t,o){let n=w()+t;for(;w()<n;){let r=e.pressureState;if(r===void 0||r==="nominal"||r==="fair")return;await F(1e3,o);}}function Ut(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 Ft=4e3;function Fe(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,Ft):void 0;return {name:t?.name??"Error",message:t?.message??String(e),...n!==void 0?{cause:n}:{},...r?{causeName:r}:{},...a?{causeStack:a}:{}}}function O(e,t){return t.hooks?.onCellFinish?.(e),e}async function $e(e,t){let o=await e;if(t.aborted)throw await D(o),T();return o}async function D(e){try{await e.dispose();}catch{}}function P(e){if(e?.aborted)throw T()}function $t(){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 be(e){return ge(e)}function ge(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=>ge(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)}:${ge(n)}`).join(",")}}`;throw new TypeError(`canonicalJson: unsupported value type ${typeof e}`)}async function ye(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 Ke(e){let{digest:t,nonce:o,...n}=e;return ye(be(n))}async function Ye(e){let{digest:t,...o}=e;return ye(be(o))}async function Ht(e){return e.digest?await Ke(e)===e.digest?true:e.nonce!==void 0?await Ye(e)===e.digest:false:false}function Vt(e){let t=[],o={...e,environment:{...e.environment}};"nonce"in o&&(delete o.nonce,t.push("nonce"));let n=o.environment;if(n.locale&&typeof n.locale=="object"){let a={...n.locale};for(let i of ["timeZone","timeZoneOffsetMinutes","calendar"])i in a&&(delete a[i],t.push(`environment.locale.${i}`));n.locale=a;}if("languages"in n&&(delete n.languages,t.push("environment.languages")),n.power&&typeof n.power=="object"){let a={...n.power};for(let i of ["chargingTimeSec","dischargingTimeSec"])i in a&&(delete a[i],t.push(`environment.power.${i}`));if(typeof a.level=="number"){let i=Y(a.level);i!==a.level&&(a.level=i,t.push("environment.power.level (coarsened)"));}n.power=a;}if(n.display&&typeof n.display=="object"){let a={...n.display};for(let i of ["prefersReducedMotion","prefersColorScheme"])i in a&&(delete a[i],t.push(`environment.display.${i}`));n.display=a;}let r=t.some(a=>a!=="nonce");return r&&o.schemaVersion<3&&(o.schemaVersion=3,t.push("schemaVersion (raised)")),{run:o,changed:r,removed:t}}function oe(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("/")}function ve(e,t){let o=t?.trim();if(!o||e.endsWith("/no-webgpu")||/or similar/i.test(o)||!/\d/.test(o))return e;let n=o.toLowerCase().replace(/\((tm|r|c)\)/g,"").replace(/^mesa\s+/,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return n?`${e.split("/")[0]}/${n}`:e}function Xe(e){return ve(oe(e),e.environment.gpuModel)}var Je=3;function zt(e,t=Je){let o=new Map;for(let r of e){let a=oe(r),i=ve(a,r.environment.gpuModel),s=r.clientSummaries??N(r),l=new Map(s.map(c=>[c.cellId,c]));for(let c of r.cells){if(c.status!=="ok")continue;let d=l.get(c.cellId);if(!d)continue;let p=[i,c.runtimeId,c.model.benchModelId,c.workloadId].join("|"),m=o.get(p);m||(m={row:{deviceClass:a,deviceSubclass:i,runtimeId:c.runtimeId,benchModelId:c.model.benchModelId,modelName:c.model.displayName,workloadId:c.workloadId,resolvedBackends:[],browsers:[],highVariance:false},ttft:[],decode:[],overall:[],single:[],batch:[],loadCold:[],loadWarm:[],quality:[],parseRate:[],runIds:new Set},o.set(p,m)),m.runIds.add(r.runId),Qe(m.row.resolvedBackends,c.resolvedBackend),Qe(m.row.browsers,r.environment.browser.name),m.row.highVariance||=d.highVariance,d.ttftMs&&m.ttft.push(d.ttftMs.median),d.decodeCharsPerSec&&m.decode.push(d.decodeCharsPerSec.median),d.overallCharsPerSec&&m.overall.push(d.overallCharsPerSec.median),d.singleLatencyMs&&m.single.push(d.singleLatencyMs.median),d.batchTextsPerSec&&m.batch.push(d.batchTextsPerSec.median),d.loadMs!==void 0&&(d.loadCached?m.loadWarm:m.loadCold).push(d.loadMs),d.qualityScore!==void 0&&m.quality.push(d.qualityScore),d.qualityParseRate!==void 0&&m.parseRate.push(d.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.deviceSubclass.localeCompare(a.deviceSubclass)||r.benchModelId.localeCompare(a.benchModelId)||r.runtimeId.localeCompare(a.runtimeId)||r.workloadId.localeCompare(a.workloadId)),n}function Qe(e,t){t&&!e.includes(t)&&e.push(t);}function C(e){return e.length>0?q(X(e)):void 0}function q(e){return Math.round(e*100)/100}function we(e){let t=e==null?"":String(e);return /[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function Gt(e){let o=[["deviceClass","deviceSubclass","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.deviceSubclass,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(we).join(","));return o.join(`
|
|
35
35
|
`)+`
|
|
36
|
-
`}function
|
|
36
|
+
`}function Kt(e){let o=[["runId","createdAt","suite","deviceClass","deviceSubclass","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,oe(n),Xe(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(we).join(","));continue}i.iterations.forEach((d,p)=>{let m="",h="",y="",f="",u="";if("chunks"in d){let b=d.chunks.reduce((g,k)=>g+k.c,0);y=String(b);let S=d.endT-d.startT;S>0&&b>0&&(f=String(q(b/S*1e3)));let M=ee(d);u=String(M);let v=d.chunks.find(g=>g.c>0);if(M&&v){m=String(q(v.t-d.startT));let g=d.chunks[d.chunks.length-1],k=b-v.c,A=g.t-v.t;A>0&&(h=String(q(k/A*1e3)));}}o.push([...a,...c,p+1,m,h,y,f,u,q(d.endT-d.startT),s,l,i.status].map(we).join(","));});}}return o.join(`
|
|
37
37
|
`)+`
|
|
38
|
-
`}export{j as BENCH_PROTOCOL_VERSION,
|
|
38
|
+
`}export{z as ACCEPTED_SCHEMA_VERSIONS,j as BENCH_PROTOCOL_VERSION,U as BENCH_SCHEMA_VERSION,Ae as EMBED_WORKLOADS,ae as GENERATION_BUDGET,Je as HEADLINE_MIN_SUBMISSIONS,Se as LLM_WORKLOADS,L as MIN_GENERATED_CHARS,qe as MMLU_MAX_TOKENS,je as MMLU_OUTPUT_CAP,_t as PLAUSIBILITY_RULES_VERSION,Ie as QUALITY_WORKLOADS,G as RUNTIME_EXECUTION_ORDER,at as RUN_POLICIES,Ne as STREAM_COHERENCE_MIN_SPAN_RATIO,me as STSB_SUBSET,V as TINY_MMLU,$ as TraceRecorder,se as USAGE_FIDELITY,rt as WORKLOADS_BY_ID,zt as aggregateRuns,be as canonicalJson,ce as captureEnvironment,Ue as checkPlausibility,Y as coarseBatteryLevel,Ye as computeLegacyRunDigest,Ke as computeRunDigest,Te as deriveDeviceType,Re as detectEngine,Ee as detectWasmFeatures,oe as deviceClassOf,Xe as deviceSubclassOf,We as formatMMLUPrompt,Mt as geomean,w as hrNow,le as inferTimerResolutionUs,ee as isIncrementalStream,H as mean,X as median,K as memoryApiAvailable,ie as orderCells,_e as parseGpuModel,J as parseMMLUAnswer,Me as parseUserAgent,Q as quantile,ve as refineDeviceClass,xe as resolveGpuModel,Gt as rowsToCSV,qt as runBenchmarkSuite,de as runFingerprint,pe as runMMLUFidelity,fe as runSTSQuality,Kt as runsToLongCSV,W as sampleMemoryBytes,Vt as scrubRunForPublication,ye as sha256Hex,F as sleep,ue as spearman,Be as stddev,_ as summarize,Z as summarizeCell,N as summarizeRun,Oe as validateRunShape,Bt as validateSubmission,Ht as verifyRunDigest};//# sourceMappingURL=index.js.map
|
|
39
39
|
//# sourceMappingURL=index.js.map
|