Spaces:
Running on Zero
Running on Zero
Beta r2: traceable run receipts and focused UI fixes
Browse filesFiles changed (11)
- BETA_TESTING.md+17
- FEEDBACK.mdAdded+24
- FRONTEND_SOURCE.json+3-3
- RELEASE_MANIFEST.json+10-8
- app.py+2-1
- build_info.pyAdded+20
- client.js+31-15
- index.html+10-9
- server.py+4-1
- training_config.py+1-1
- worker.py+2-1
74 unmodified lines75767774 unmodified linesprivate trained network, a proprietary game-extracted track, tokens, job accesskeys, or full unrelated logs to an ordinary bug report. Use public/generatedfixtures or describe the network shape and sensor/output contract.74 unmodified lines757677787980818283848586878889909192939474 unmodified linesprivate trained network, a proprietary game-extracted track, tokens, job accesskeys, or full unrelated logs to an ordinary bug report. Use public/generatedfixtures or describe the network shape and sensor/output contract.## Local 2026-10-13 candidate (not deployed)Content-addressed build IDs now appear in capabilities and exported run/batch receipts;reports include upstream simulator revision and packaged binary SHA-256 values.A single run has its own receipt export. `/feedback` supplies a private-feedbacktemplate; no public issue destination or invitation is activated.The native train-scratch adapter requires positive mutation even when continuing anuploaded network. The form and server now reject zero before native dispatch.Any GPU dispatch error attempts to discard its pending ticket; a missing ticketis not evidence that an already dispatched run stopped.This candidate requires an explicitly approved deployment followed by hostedCPU/GPU and real-account checks before tester invitations. Local checks andtraining experiments against the previous live build are recorded outside thispackage in the sibling sprint receipt. They do not qualify this candidate as deployed.
123456789101112131415161718192021222324# Supervised beta feedback draft
This form is a local template. It does not submit a message or upload files.Share a completed copy with the person who invited you, using the agreed private channel.A public issue destination has not been activated for this candidate.
- App URL:- Build ID (from an exported run or batch receipt):- Browser and version:- Operating system:- CPU or GPU:- Track name, network shape, and sensor/output types:- Exact steps to reproduce:- Expected behavior:- Observed behavior:- Did a retry work? Did the page confirm server-copy deletion?
Attach the exported receipt only after reviewing it. It contains settings, file hashes,metrics, and build identity; no network weights or job access keys. Batch receipts alsocontain your recipe and batch names. Redact those names if they are private.Do not attach tokens, job keys, private networks, proprietary tracks, or unrelated logs.A cropped screenshot and a generated example are usually sufficient.
For a GPU rejection, include the visible error and cleanup message; never paste a token.12345678910{"source": "Runner r14 single-engine browser UI; selected .track tile renderer added from simulator atlas","source_sha256": "65d1e5f2c4e19b4951b828e82510005ab99a5270cf3dcb9f4eaa0fa1af8c40f8","output_sha256": "dea8ee713484a551421883599af8ffbcd91cab7a31087699e6711c5bd1fc5412","scope": "Frontend only; no engine, private data, track assets, API calls or storage copied","status": "Hosted single-engine UI audited; star evaluation remains unconnected","track_atlas_sha256": "d97c8900e3e5fb17734b5bd61d1f4f4b196d9be30af9848e2e273ae7e4079ae4","client_sha256": "ee070dcb67d62c9ee7905ecdd744192a7b35f0925c17f7235c7b50fe5ca463ca","track_map_sha256": "ab5374aa49c7ccec90a787ee8c56cd71beb56b903bf2bbc322783e6f43c009f0"}12345678910{"source": "Runner r14 single-engine browser UI; selected .track tile renderer added from simulator atlas","source_sha256": "65d1e5f2c4e19b4951b828e82510005ab99a5270cf3dcb9f4eaa0fa1af8c40f8","output_sha256": "315058a08c31ec512108473904f559087080edb684c02f4d594cbe5032c77791","scope": "Frontend only; no engine, private data, track assets, API calls or storage copied","status": "Local beta sprint candidate; not deployed","track_atlas_sha256": "d97c8900e3e5fb17734b5bd61d1f4f4b196d9be30af9848e2e273ae7e4079ae4","client_sha256": "cc18e5ce4405ccc7cecc3ab6cc6d7b2abddcc6cfac69f47825c546b8d7c1bcf1","track_map_sha256": "ab5374aa49c7ccec90a787ee8c56cd71beb56b903bf2bbc322783e6f43c009f0"}
1 unmodified line2345678910111 unmodified line1314151617181920212223242524 unmodified lines5051525354555657585960616263646566676869707172731 unmodified line"backend": "cpu+zerogpu","files": {".gitattributes": "c2ad16718fc51c888d32efc88c8f6e23ebe5fcf6f48e2954f896ba9770f24d72","BETA_TESTING.md": "4868acab039a805b659c3830ebf96bc9427c6d3b5d2a911ff00e22762483ea22","BINARY_PROVENANCE.json": "1116e1757afc6c8629cb2d957e3d77380fe4f7e3186c3832d16a5a08abce6aa8","DATA_POLICY.md": "0daf1b835bf829c0974e6b566cb5a605c6f52dba4517cfd54bed044e8eaf4264","FRONTEND_SOURCE.json": "4c82ae314b7fafe7cca76f4f0f0c2d80a4a5d46d6b761bd2c908c512de1a178e","GODOT_LICENSE": "fb2b3bb82c60f1e76841ba2122eb902f8e39c151476fe21ce10c9a05d1045304","IMPORTER_BUILD_RECEIPT.json": "4ba5c533cc617105478e4d85c83f456a7dfa68b1388049624619871ba9e42e9d","LICENSE": "53d5851b6440feeae36f72a5f57fcab37858c48b7084765ece4b0c54b9a28ed8",1 unmodified line"STORAGE_BOUNDARY.md": "9a1ffb5854230690dba3f0895f9a8e570716de47be2c553de13a6892dd740015","TRACK_LIBRARY.md": "7e4829c5e0933bfb317c21d7441ad0ba2ee00ab7f9f1635549452d504aa0777b","UPSTREAM.json": "40a2f31fa9abc11e47e247c56909b93b587d1f5be524ab158b24f1f9eed93765","app.py": "f0aacacfcd68ac3223e215af691e84f01c7c1983505088b768d38500f258d56b","app_release.py": "7482559c667a665fd3cb6aa8af6c78422a822b515e14589db8306f7fd4860a8b","assets/formula_template.json": "80f745df82bb7be45af52785fd582460bcddc63c5a4e1d8375d85b3122db4c6b","assets/track-atlas.json": "d97c8900e3e5fb17734b5bd61d1f4f4b196d9be30af9848e2e273ae7e4079ae4","bin/altd-sim": "2f2f2144ae14b0ef599ca8510f95712da00243c6875881491d384b394e7499f7","bin/extract_saved_track": "3a7733c45b4301a786fcbfe92660a1c484749272da5f608d62f34878bd4ff31a","bin/libaltd_gpu.so": "279d6353b4c691686d6aeeae6abfd4a82b959e9b604f079a6c45f9823b48a87a","builtin_tracks.py": "2ecc2b1d00fe15701b0271d71e1e68d2e7e59c596330879494055f9b2a99c242","builtin_tracks/catalog.json": "65006e70a87a5a53e3738166b0895bc4db9f99767dd891d917b68029abb4e80a","builtin_tracks/tracks/Replica A01 Beginner.track": "ca5749537450430794e2eade2e0ac72fa141a4f225e13e2f8ef842abb948ff15",24 unmodified lines"builtin_tracks/tracks/Replica R08 Demolition Derby.track": "6f11a9ffbcb477c9d19964566b1b612d2a94675605246e93e21f27bbbdb357ef","builtin_tracks/tracks/Replica R09 Eau Noir.track": "3ec0a78478cca1a4f0d2d98ac81f40783928adf271b70f0c32d295a6da2cdaa9","builtin_tracks/tracks/Replica The Champions Trial.track": "a3bfb76422affc774b44c739b0636d08acb901fa7615b9adcb52c069f79834e1","client.js": "ee070dcb67d62c9ee7905ecdd744192a7b35f0925c17f7235c7b50fe5ca463ca","delivery.py": "07453999c3831a16e8b1fcc2b4ae5fb28beb7d3952a3fae8de65d16eb6f11e5b","gpu_tickets.py": "b81aadb5ed42cec9212d44da7e7bbb7b413c5bd517383cac0b49ec9b4d659c92","hf-auth.js": "b59691ce2c517f193a5d5141538ebe61c961bb163cefa1fcf09b414c388984c1","hf_identity.py": "6993d0238ada835606dbdc3275c17a3fe5a5cac5ad2156ab78230acf2d051eba","index.html": "dea8ee713484a551421883599af8ffbcd91cab7a31087699e6711c5bd1fc5412","requirements.txt": "9b532747e51bd052e82090ece860d6dafe027407f4512dc74272c148ea104c22","server.py": "91cb5f18442fe38ed5cbd35b74faa326596a0c9d1cf197276ed89657a55d1fbd","track-library.js": "351ec4c026b49420ce963f4310cb000d9e987fd28e6dac5ecd0176509340f6e6","track-map.js": "ab5374aa49c7ccec90a787ee8c56cd71beb56b903bf2bbc322783e6f43c009f0","training_config.py": "2b9768876fdc60b16afb45b98023c6c31666e30f7c56f1292f6071775e6da0c5","vendor/gradio-client/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","vendor/gradio-client/dist/index.min.js": "fdd776db8633354f118fe2908c980592283968737e6b91dc3aa86d648da5c3fd","vendor/gradio-client/package.json": "96c5b9e6d3587fb7bd8e5bb28775ece222de1043045afc4e6389c88db137ad0e","vendor/hf-oauth/LICENSE": "d6e7b19451c1b3d1d66353bb4b1274138953b3bfd9ae60c56e77b1f548796982","vendor/hf-oauth/index.js": "53282844000a171011e547f6472a3846bb4cecb5071adafea079fcac3a2aee7e","vendor/hf-oauth/package.json": "fafd4d8891023a1961546a7d3bc25cd24f64923a2ebfc449fe6d516a2949bda8","worker.py": "934fb941a7f73a82c9bbcff5f3290103d4dd55e66542e71d56ae8fe7101f0e57"},"interface": "single-engine-runner-with-map","upstream_revision": "d8ab74c25df70b6a86ed101080e33d5fb785ea6f"1 unmodified line234567891011121 unmodified line141516171819202122232425262724 unmodified lines5253545556575859606162636465666768697071727374751 unmodified line"backend": "cpu+zerogpu","files": {".gitattributes": "c2ad16718fc51c888d32efc88c8f6e23ebe5fcf6f48e2954f896ba9770f24d72","BETA_TESTING.md": "9d6447c876a2b2b1d3dbb7637858c79a4c669d8582d8cc2a6a335ea8cc4297c1","BINARY_PROVENANCE.json": "1116e1757afc6c8629cb2d957e3d77380fe4f7e3186c3832d16a5a08abce6aa8","DATA_POLICY.md": "0daf1b835bf829c0974e6b566cb5a605c6f52dba4517cfd54bed044e8eaf4264","FEEDBACK.md": "17127b693eb52cccf1707be24b9bced82b77c0eec174b1f696cc9a3feb33dd67","FRONTEND_SOURCE.json": "d9bf9402693f514956ec99432b6da2ccf73f17c7c26dd400123b6b9fb27bf31e","GODOT_LICENSE": "fb2b3bb82c60f1e76841ba2122eb902f8e39c151476fe21ce10c9a05d1045304","IMPORTER_BUILD_RECEIPT.json": "4ba5c533cc617105478e4d85c83f456a7dfa68b1388049624619871ba9e42e9d","LICENSE": "53d5851b6440feeae36f72a5f57fcab37858c48b7084765ece4b0c54b9a28ed8",1 unmodified line"STORAGE_BOUNDARY.md": "9a1ffb5854230690dba3f0895f9a8e570716de47be2c553de13a6892dd740015","TRACK_LIBRARY.md": "7e4829c5e0933bfb317c21d7441ad0ba2ee00ab7f9f1635549452d504aa0777b","UPSTREAM.json": "40a2f31fa9abc11e47e247c56909b93b587d1f5be524ab158b24f1f9eed93765","app.py": "271c13c152e916c704c9c311a4a2800ef98e3787e6557be9eab8c851de0e1fb4","app_release.py": "7482559c667a665fd3cb6aa8af6c78422a822b515e14589db8306f7fd4860a8b","assets/formula_template.json": "80f745df82bb7be45af52785fd582460bcddc63c5a4e1d8375d85b3122db4c6b","assets/track-atlas.json": "d97c8900e3e5fb17734b5bd61d1f4f4b196d9be30af9848e2e273ae7e4079ae4","bin/altd-sim": "2f2f2144ae14b0ef599ca8510f95712da00243c6875881491d384b394e7499f7","bin/extract_saved_track": "3a7733c45b4301a786fcbfe92660a1c484749272da5f608d62f34878bd4ff31a","bin/libaltd_gpu.so": "279d6353b4c691686d6aeeae6abfd4a82b959e9b604f079a6c45f9823b48a87a","build_info.py": "93d331c0405cd10076a544f87761bb4a00f6556bbbdab8abc12e070c4661bd78","builtin_tracks.py": "2ecc2b1d00fe15701b0271d71e1e68d2e7e59c596330879494055f9b2a99c242","builtin_tracks/catalog.json": "65006e70a87a5a53e3738166b0895bc4db9f99767dd891d917b68029abb4e80a","builtin_tracks/tracks/Replica A01 Beginner.track": "ca5749537450430794e2eade2e0ac72fa141a4f225e13e2f8ef842abb948ff15",24 unmodified lines"builtin_tracks/tracks/Replica R08 Demolition Derby.track": "6f11a9ffbcb477c9d19964566b1b612d2a94675605246e93e21f27bbbdb357ef","builtin_tracks/tracks/Replica R09 Eau Noir.track": "3ec0a78478cca1a4f0d2d98ac81f40783928adf271b70f0c32d295a6da2cdaa9","builtin_tracks/tracks/Replica The Champions Trial.track": "a3bfb76422affc774b44c739b0636d08acb901fa7615b9adcb52c069f79834e1","client.js": "cc18e5ce4405ccc7cecc3ab6cc6d7b2abddcc6cfac69f47825c546b8d7c1bcf1","delivery.py": "07453999c3831a16e8b1fcc2b4ae5fb28beb7d3952a3fae8de65d16eb6f11e5b","gpu_tickets.py": "b81aadb5ed42cec9212d44da7e7bbb7b413c5bd517383cac0b49ec9b4d659c92","hf-auth.js": "b59691ce2c517f193a5d5141538ebe61c961bb163cefa1fcf09b414c388984c1","hf_identity.py": "6993d0238ada835606dbdc3275c17a3fe5a5cac5ad2156ab78230acf2d051eba","index.html": "315058a08c31ec512108473904f559087080edb684c02f4d594cbe5032c77791","requirements.txt": "9b532747e51bd052e82090ece860d6dafe027407f4512dc74272c148ea104c22","server.py": "de98db424b96a4fbab7ce5b98ee42a94e846e2b3f317593e2346c5f87489ede8","track-library.js": "351ec4c026b49420ce963f4310cb000d9e987fd28e6dac5ecd0176509340f6e6","track-map.js": "ab5374aa49c7ccec90a787ee8c56cd71beb56b903bf2bbc322783e6f43c009f0","training_config.py": "a0dd095e0de8c5a964ace66954f346e5d7b861db3d34cd2feaceedc5ecb80bad","vendor/gradio-client/LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","vendor/gradio-client/dist/index.min.js": "fdd776db8633354f118fe2908c980592283968737e6b91dc3aa86d648da5c3fd","vendor/gradio-client/package.json": "96c5b9e6d3587fb7bd8e5bb28775ece222de1043045afc4e6389c88db137ad0e","vendor/hf-oauth/LICENSE": "d6e7b19451c1b3d1d66353bb4b1274138953b3bfd9ae60c56e77b1f548796982","vendor/hf-oauth/index.js": "53282844000a171011e547f6472a3846bb4cecb5071adafea079fcac3a2aee7e","vendor/hf-oauth/package.json": "fafd4d8891023a1961546a7d3bc25cd24f64923a2ebfc449fe6d516a2949bda8","worker.py": "b30e12135f27f870a5094d98c19039262fcb5498f7582bdf4dce89cf11db520e"},"interface": "single-engine-runner-with-map","upstream_revision": "d8ab74c25df70b6a86ed101080e33d5fb785ea6f"
18 unmodified lines19202122232429 unmodified lines5455565758596018 unmodified linesfrom server import create_appfrom worker import run_native,track_input,network_inputfrom training_config import validate_configfrom hf_identity import visitor_identitydef build_app(cuda_call):29 unmodified lines@app.get('/api/capabilities')def capabilities():return {'cpu':True,'gpu':True,'default':'cpu','gpu_transport':'gradio-ticket','configurable_training':True}@app.get('/gradio-client.js')def javascript_client():18 unmodified lines1920212223242529 unmodified lines5556575859606118 unmodified linesfrom server import create_appfrom worker import run_native,track_input,network_inputfrom training_config import validate_configfrom build_info import build_identityfrom hf_identity import visitor_identitydef build_app(cuda_call):29 unmodified lines@app.get('/api/capabilities')def capabilities():return {'cpu':True,'gpu':True,'default':'cpu','gpu_transport':'gradio-ticket','configurable_training':True,'build':build_identity()}@app.get('/gradio-client.js')def javascript_client():
1234567891011121314151617181920"""Content-addressed package identity; no environment or credentials in reports."""import hashlibimport jsonfrom pathlib import Path
ROOT = Path(__file__).resolve().parent
def build_identity(): manifest = json.loads((ROOT / 'RELEASE_MANIFEST.json').read_text()) upstream = json.loads((ROOT / 'UPSTREAM.json').read_text()) members = json.dumps(manifest['files'], sort_keys=True, separators=(',', ':')).encode() return { 'schema_version': 1, 'build_id': 'ald-beta-' + hashlib.sha256(members).hexdigest(), 'source_repository': upstream['repository'], 'simulator_source_revision': upstream['commit'], 'math_profile': upstream['math_profile'], 'package_role': upstream['role'], 'binary_sha256': {name: digest for name, digest in manifest['files'].items() if name.startswith('bin/')}, }9 unmodified lines10111213141511 unmodified lines272829303132334 unmodified lines38394041424320 unmodified lines646566676869707172737475764 unmodified lines818283848586878889909192939495969739 unmodified lines1371381391401411427 unmodified lines15015115215315415515615728 unmodified lines18618718818919019141 unmodified lines23323423523623723823924024124224324424524629 unmodified lines27627727827928028110 unmodified lines2922932949 unmodified lineslet batchActive = false;let batchStopRequested = false;let batchReceipt = null;// Display context affects quota guidance, never whether GPU can be selected.const hostedStandalone = location.hostname.endsWith('.hf.space') && window.self === window.top;const say = text => { $('status').textContent = text; };11 unmodified lineswindow.HFAuth?.setBusy(busy || !!job);window.setTrainingBusy?.(busy || !!job);window.setEditorBusy?.(busy || !!job);$('run').disabled = busy || !!job || !capabilitiesReady;$('backend').disabled = busy || !!job || !capabilitiesReady;$('download').disabled = busy || !job;$('erase').disabled = busy || !job;4 unmodified lines$('network').disabled=busy || !!job;if($('batch_start'))$('batch_start').disabled=busy || !!job || !capabilitiesReady;if($('batch_stop'))$('batch_stop').disabled=!batchActive || batchStopRequested;if($('batch_export'))$('batch_export').disabled=busy || !batchReceipt;}function saveLocal() {20 unmodified lines}const headers = () => ({'X-Job-Key':job.key});const networkSource=()=>stagedNetwork || $('network').files[0];$('network').onchange=()=>{stagedNetwork=null;if($('networkChoice'))$('networkChoice').textContent='Uploaded file selected.';};window.TrainingClient={isBusy:()=>busy||!!job,useNetwork(file){if(busy||job)throw Error('Finish or delete the current result before changing the network');stagedNetwork=file;$('network').value='';if($('networkChoice'))$('networkChoice').textContent='Browser editor input: '+file.name+'. Not uploaded yet.';}};async function submit(body){4 unmodified linesconst result=await gradioClient.predict('/gpu_train',[prepared.ticket]);return result.data[0];} catch(error) {if(isGpuQuotaError(error)){let cleanup='If dispatch did not start, staged inputs expire within two minutes.';try {const response=await request('/api/gpu/prepare/'+encodeURIComponent(prepared.ticket),{method:'DELETE'});cleanup=(await response.json()).deleted===true? 'Staged inputs were deleted.': 'No pending upload remains for this request.';} catch {}throw Error(displayError(error)+' '+cleanup);}throw error;}}return (await request('/api/process',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)})).json();39 unmodified linesconst started=performance.now();$('runState').textContent='RUNNING — waiting for server confirmation';$('runState').style.color='#ffd073';showDetails(null);const tick=()=>{$('runSummary').textContent='Backend: '+$('backend').value.toUpperCase()+'\nElapsed: '+((performance.now()-started)/1000).toFixed(1)+' s\nCompletion is not yet confirmed.';};tick(); const progress=setInterval(tick,250);7 unmodified lines$('runState').textContent='COMPLETE — candidate ready to download';$('runState').style.color='#62dfb1';const r=job.report;const metric=n=>typeof n==='number'?n.toFixed(3):'Not reported';$('runSummary').textContent=r?['Backend: '+job.backend.toUpperCase(),'Track: '+(trackInfo?.source==='builtin'?trackInfo.display_name:'Custom upload'),'Generations: '+r.generations_completed+' / '+r.generations_requested+' · Population: '+r.population,28 unmodified lines// The browser has the complete validated result. Disk-save success cannot be observed.localResult=new Blob([bytes]); saveLocal();const acknowledgment=await acknowledge(job,receipt);if (acknowledgment.deleted) { $('runState').textContent='COMPLETE — result received; server copy deleted'; job=null; say('Result received by browser. Server result deleted. Save your local download; server retrieval is no longer available.'); }else say('Result received by browser. The server copy is available for another download until its five-minute deadline; use Delete now to remove it sooner.');} catch (error) { say(error.message+' If receipt acknowledgment failed, use Delete now; automatic expiry still applies.'); }41 unmodified linesline.textContent='Step '+step.step+' · '+step.slot+' · '+step.name+' · completed · '+step.report.generations_completed+' generations · server copy deleted';$('batch_history').append(line);}});batchReceipt={version:1,state:result.state,plan,track:trackLibrary?.info()??{source:'upload'},history,elapsed_seconds:(Date.now()-started)/1000};$('batch_status').textContent=result.state.toUpperCase()+' · '+history.length+' / '+plan.runs.length+' runs. '+(localResult?'Last received candidate is available on Drive & view.':'No candidate received.');$('runState').textContent='BATCH '+result.state.toUpperCase()+' — '+history.length+' / '+plan.runs.length+' runs; server copies deleted';$('runState').style.color=result.state==='completed'?'#62dfb1':'#ffd073';$('runSummary').textContent='Backend: '+backend.toUpperCase()+'\nCompleted steps: '+history.length+'\nUse Save received result again for the last candidate. A completed batch does not establish improved driving.';say('Batch results are in browser memory only; no server result remains for completed steps.');}catch(error){batchReceipt={version:1,state:'error',plan:plan??null,history,error:error.message,elapsed_seconds:(Date.now()-started)/1000};$('batch_status').textContent='ERROR · '+history.length+' confirmed steps. '+displayError(error);$('runState').textContent='BATCH ERROR — '+history.length+' completed steps';$('runState').style.color='#ffb5a2';29 unmodified linestry {const capabilities=await (await request('/api/capabilities',{signal:controller.signal})).json();if(capabilities.cpu!==true)throw new Error('CPU unavailable');gpuTransport=capabilities.gpu_transport??null;$('gpuOption').disabled=!capabilities.gpu;$('backendNote').textContent=capabilities.gpu?(hostedStandalone?'CPU is anonymous. GPU may use a limited anonymous allowance or your optional HF account allowance.':'CPU is anonymous. GPU requires an available HF allowance.'):'CPU training is ready; no sign-in or GPU allowance needed.';10 unmodified lines}$('retry').onclick=()=>{if(!busy&&!job)connect();};connect();9 unmodified lines101112131415161711 unmodified lines293031323334354 unmodified lines4041424344454620 unmodified lines67686970717273747576777879804 unmodified lines858687888990919293949596979839 unmodified lines1381391401411421431447 unmodified lines15215315415515615715815916016128 unmodified lines19019119219319419519641 unmodified lines23823924024124224324424524624724824925025129 unmodified lines28128228328428528628728828929029110 unmodified lines3023033043053063073083093109 unmodified lineslet batchActive = false;let batchStopRequested = false;let batchReceipt = null;let runReceipt = null;let appBuild = null;// Display context affects quota guidance, never whether GPU can be selected.const hostedStandalone = location.hostname.endsWith('.hf.space') && window.self === window.top;const say = text => { $('status').textContent = text; };11 unmodified lineswindow.HFAuth?.setBusy(busy || !!job);window.setTrainingBusy?.(busy || !!job);window.setEditorBusy?.(busy || !!job);$('run').disabled = busy || !!job || !capabilitiesReady || !networkSource();$('backend').disabled = busy || !!job || !capabilitiesReady;$('download').disabled = busy || !job;$('erase').disabled = busy || !job;4 unmodified lines$('network').disabled=busy || !!job;if($('batch_start'))$('batch_start').disabled=busy || !!job || !capabilitiesReady;if($('batch_stop'))$('batch_stop').disabled=!batchActive || batchStopRequested;if($('run_export'))$('run_export').disabled=busy || !runReceipt;if($('batch_export'))$('batch_export').disabled=busy || !batchReceipt;}function saveLocal() {20 unmodified lines}const headers = () => ({'X-Job-Key':job.key});const networkSource=()=>stagedNetwork || $('network').files[0];$('network').onchange=()=>{stagedNetwork=null;if($('networkChoice'))$('networkChoice').textContent='Uploaded file selected.';buttons();};window.TrainingClient={isBusy:()=>busy||!!job,useNetwork(file){if(busy||job)throw Error('Finish or delete the current result before changing the network');stagedNetwork=file;$('network').value='';if($('networkChoice'))$('networkChoice').textContent='Browser editor input: '+file.name+'. Not uploaded yet.';buttons();}};async function submit(body){4 unmodified linesconst result=await gradioClient.predict('/gpu_train',[prepared.ticket]);return result.data[0];} catch(error) {let cleanup='Pending inputs expire within two minutes. A connection error does not confirm whether training started.';try {const response=await request('/api/gpu/prepare/'+encodeURIComponent(prepared.ticket),{method:'DELETE'});cleanup=(await response.json()).deleted===true? 'Pending inputs were deleted before dispatch.': 'No pending inputs remain. This does not confirm that a dispatched run stopped.';} catch {}throw Error(displayError(error)+' '+cleanup);}}return (await request('/api/process',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)})).json();39 unmodified linesconst started=performance.now();$('runState').textContent='RUNNING — waiting for server confirmation';$('runState').style.color='#ffd073';runReceipt=null;showDetails(null);const tick=()=>{$('runSummary').textContent='Backend: '+$('backend').value.toUpperCase()+'\nElapsed: '+((performance.now()-started)/1000).toFixed(1)+' s\nCompletion is not yet confirmed.';};tick(); const progress=setInterval(tick,250);7 unmodified lines$('runState').textContent='COMPLETE — candidate ready to download';$('runState').style.color='#62dfb1';const r=job.report;runReceipt={version:1,state:'completed',build:r?.build??appBuild,backend:job.backend,output_sha256:job.sha256,report:r};const metric=n=>typeof n==='number'?n.toFixed(3):'Not reported';$('runSummary').textContent=r?['Build: '+(r.build?.build_id??'Not reported'),'Backend: '+job.backend.toUpperCase(),'Track: '+(trackInfo?.source==='builtin'?trackInfo.display_name:'Custom upload'),'Generations: '+r.generations_completed+' / '+r.generations_requested+' · Population: '+r.population,28 unmodified lines// The browser has the complete validated result. Disk-save success cannot be observed.localResult=new Blob([bytes]); saveLocal();const acknowledgment=await acknowledge(job,receipt);if(runReceipt)runReceipt.delivery={received_and_hash_verified:true,server_copy_deleted:acknowledgment.deleted===true};if (acknowledgment.deleted) { $('runState').textContent='COMPLETE — result received; server copy deleted'; job=null; say('Result received by browser. Server result deleted. Save your local download; server retrieval is no longer available.'); }else say('Result received by browser. The server copy is available for another download until its five-minute deadline; use Delete now to remove it sooner.');} catch (error) { say(error.message+' If receipt acknowledgment failed, use Delete now; automatic expiry still applies.'); }41 unmodified linesline.textContent='Step '+step.step+' · '+step.slot+' · '+step.name+' · completed · '+step.report.generations_completed+' generations · server copy deleted';$('batch_history').append(line);}});batchReceipt={version:1,build:appBuild,state:result.state,plan,track:trackLibrary?.info()??{source:'upload'},history,elapsed_seconds:(Date.now()-started)/1000};$('batch_status').textContent=result.state.toUpperCase()+' · '+history.length+' / '+plan.runs.length+' runs. '+(localResult?'Last received candidate is available on Drive & view.':'No candidate received.');$('runState').textContent='BATCH '+result.state.toUpperCase()+' — '+history.length+' / '+plan.runs.length+' runs; server copies deleted';$('runState').style.color=result.state==='completed'?'#62dfb1':'#ffd073';$('runSummary').textContent='Backend: '+backend.toUpperCase()+'\nCompleted steps: '+history.length+'\nUse Save received result again for the last candidate. A completed batch does not establish improved driving.';say('Batch results are in browser memory only; no server result remains for completed steps.');}catch(error){batchReceipt={version:1,build:appBuild,state:'error',plan:plan??null,history,error:error.message,elapsed_seconds:(Date.now()-started)/1000};$('batch_status').textContent='ERROR · '+history.length+' confirmed steps. '+displayError(error);$('runState').textContent='BATCH ERROR — '+history.length+' completed steps';$('runState').style.color='#ffb5a2';29 unmodified linestry {const capabilities=await (await request('/api/capabilities',{signal:controller.signal})).json();if(capabilities.cpu!==true)throw new Error('CPU unavailable');appBuild=capabilities.build??null;if($('buildLabel')){$('buildLabel').textContent='Build: '+(appBuild?.build_id?.slice(0,25)??'Unavailable — include the app URL in feedback');$('buildLabel').title=appBuild?.build_id??'';}gpuTransport=capabilities.gpu_transport??null;$('gpuOption').disabled=!capabilities.gpu;$('backendNote').textContent=capabilities.gpu?(hostedStandalone?'CPU is anonymous. GPU may use a limited anonymous allowance or your optional HF account allowance.':'CPU is anonymous. GPU requires an available HF allowance.'):'CPU training is ready; no sign-in or GPU allowance needed.';10 unmodified lines}$('retry').onclick=()=>{if(!busy&&!job)connect();};connect();if($('run_export'))$('run_export').onclick=()=>{if(!runReceipt)return;const url=URL.createObjectURL(new Blob([JSON.stringify(runReceipt,null,2)],{type:'application/json'}));const a=document.createElement('a');a.href=url;a.download='ald-run-receipt.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);};
123456789101112131415161718192021222324252627282941 unmodified lines71727374757677<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>AI Learns To Drive</title><style>:root{color-scheme:dark;font:16px system-ui;background:#0c1420;color:#e5edf5}body{max-width:1400px;margin:auto;padding:22px}h1{font-size:32px;margin:0}h2{font-size:21px;margin:0 0 14px}small,.hint{color:#a2b4c8;line-height:1.6}.grid{display:grid;grid-template-columns:minmax(360px,.9fr) minmax(0,1.25fr);gap:24px}.card{background:#152233;border:1px solid #2a3d52;border-radius:16px;padding:22px;margin-top:20px}label{display:block;margin:12px 0 5px}input,select,button{font:inherit;background:#0c1725;color:#e5edf5;border:1px solid #49627c;border-radius:7px;padding:9px}input[type=number],select{width:100%;box-sizing:border-box}input[type=file]{max-width:100%;box-sizing:border-box}button{cursor:pointer}button.primary{background:#62dfb1;color:#102522;font-weight:700}button:disabled{opacity:.4;cursor:default}.row{display:grid;grid-template-columns:1fr 1fr;gap:15px}.reward{display:grid;grid-template-columns:1.7fr 1fr 70px 30px;gap:5px;margin:8px 0}.reward input{width:70px;box-sizing:border-box}a{color:#7ce4c3}canvas{width:100%;background:#09111b;border-radius:10px}#status{white-space:pre-wrap;line-height:1.7}table{width:100%;text-align:left;border-collapse:collapse;font-size:14px}td,th{padding:9px;border-bottom:1px solid #2a3d52}.pill{display:inline-block;background:#284539;border-radius:20px;padding:5px 12px;color:#91efc6;margin:6px 0}#error{color:#ffb5a2;white-space:pre-wrap}.toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding-bottom:16px;border-bottom:1px solid #2a3d52;margin-bottom:15px}.run-card{position:sticky;top:20px}details{margin-top:18px;border-top:1px solid #2a3d52;padding-top:14px}summary{cursor:pointer;font-weight:600;color:#c6d9e9}details[open]>summary{margin-bottom:12px}[hidden]{display:none!important}#map_note{font-size:14px}#runs{max-height:380px;overflow:auto}.table-scroll{overflow:auto}@media(max-width:850px){.grid{grid-template-columns:1fr}#drive .grid>section:nth-child(2){order:-1}.run-card{position:static}body{padding:16px}}.tabs{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}.tabs button[aria-selected=true]{background:#62dfb1;color:#102522}.library{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px}.library input[type=text]{width:100%;box-sizing:border-box}.queue-row{display:flex;gap:8px;margin:8px 0}.queue-row select{flex:1}.pane{min-width:0}.map{min-height:300px;background:#09111b;border-radius:12px;padding:10px}.map canvas{display:block;width:100%;height:auto;max-height:320px;object-fit:contain}.map-legend{display:flex;gap:18px;flex-wrap:wrap;margin:10px 0;color:#c6d9e9;font-size:14px}pre{white-space:pre-wrap;overflow-wrap:anywhere}input[type=text]{width:100%;box-sizing:border-box}#libraries .row label>input,#libraries .row label>select{display:block;margin-top:6px}#editor_parameters input{max-width:240px} .eyebrow{color:#62dfb1;font-size:12px;letter-spacing:.18em;font-weight:800}.intro{font-size:19px;color:#b9cddd;max-width:820px;margin:10px 0 0}header{padding:12px 0 4px}header h1{font-size:clamp(30px,4vw,45px);letter-spacing:-.03em;margin-top:7px}.about{max-width:850px;font-size:14px;margin-top:15px}.about p{line-height:1.65}.card{box-shadow:0 10px 35px #050a1280}.tabs{position:sticky;top:0;z-index:3;background:#0c1420eF;padding:12px 0;border-bottom:1px solid #2a3d52}.tabs button{border-radius:12px;padding:11px 15px}.map-status{margin:7px 0;color:#dbe9f1;font-size:14px}#run{background:#62dfb1;color:#102522;font-weight:800;width:100%;margin-top:12px;padding:13px}.privacy-note{font-size:13px;line-height:1.5;color:#a2b4c8}.keep-result{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid #3b566b;border-radius:10px;background:#102030;line-height:1.4}.keep-result input{margin:3px 0 0;flex:none} .terrain{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:4px;background:#607e96}.terrain.dirt{background:#b89561}.terrain.ice{background:#b9d9ed}.terrain.start{background:#66e5aa}</style><header><div class="eyebrow">AI LEARNS TO DRIVE · TRAINING LAB</div><h1>Train, inspect, repeat.</h1><p class="intro">Pick a track and network, run a bounded training session, and keep your recipes in this browser.</p><details class="about"><summary>About this beta and its data handling</summary><p>Simulator by <a href="https://github.com/Zorro909/driving_sim_rs">Zorro909</a>; interface and hosting by <a href="https://github.com/seeker-cyber-maker/driving_sim_rs">TiGa</a>. Inspired by the <a href="https://store.steampowered.com/app/3312030/AI_Learns_To_Drive/">game by ActivationFunction</a>. Built-in tracks are reconstructed replicas. Star challenges are not evaluated here.</p><p>Uploaded files are used for the requested run. Results are held briefly in application memory and deleted after verified download or expiry. Browser recipes contain settings only. <a href="/policy" target="_blank" rel="noopener">Read the data policy</a>.</p></details></header><nav class="tabs" aria-label="Lab sections"><button data-tab="drive" aria-selected="true">1 · Drive & view</button><button data-tab="training" aria-selected="false">2 · Training runs & presets</button><button data-tab="batch" aria-selected="false">3 · Batches</button><button data-tab="editor" aria-selected="false">4 · Network editor</button></nav><div id="drive" class="pane"><div class="grid"><section class="card"><h2>Simulation</h2><p>Training uses the settings on the Training runs & presets tab. Formula networks, steering and acceleration; speed and raycast sensors. Supported networks: Formula, steering and acceleration, speed/raycast sensors, 2–4 layers with up to 16 nodes.</p><p id="computeBlock"><label for="backend">Compute</label><select id="backend" disabled><option value="cpu">CPU — no GPU allowance</option><option id="gpuOption" value="gpu" disabled>GPU — uses GPU allowance</option></select></p><p id="backendNote" class="hint">Checking available backends…</p><div id="connectionRecovery" hidden><button id="retry" type="button">Reconnect to app</button><p class="hint">Checks server availability. Does not restart training, sign you in, or reset GPU allowance.</p></div><div id="gpuAccount" aria-label="Optional GPU account"><p><button id="hfSignIn" type="button" disabled>Sign in with HF for account GPU allowance</button><span id="hfAccount" hidden></span> <button id="hfSignOut" type="button" disabled hidden>Disconnect account</button></p><p id="hfIdentity" role="status" class="hint">CPU needs no sign-in. Checking optional GPU account connection…</p><details><summary>Account help & troubleshooting</summary><p>CPU works without an account. HF sign-in identifies GPU requests; it does not guarantee available allowance. Sign in before choosing files: sign-in reloads this page and clears selected files and unsaved edits. Saved recipes remain.</p><p>Your account token stays in page memory. Refreshing or closing this page disconnects the app. Disconnecting here does not sign you out of the HF website or delete job data.</p><button id="hfVerify" type="button" disabled hidden>Check account connection — no GPU used</button><p class="hint">Checks which account the GPU submission service sees. Runs automatically before GPU training; it does not check your remaining allowance.</p></details></div><p><label for="trackPresetDrive">Track selection</label><select id="trackPresetDrive" data-track-library disabled><option value="">Upload a custom track</option></select></p><p data-track-status role="status" class="hint">Loading built-in replica tracks…</p><p class="hint">Built-in replicas are reconstructed editor-format layouts, not editor-authored or official packaged files. Star conditions are not evaluated.</p><p><label>Track (.track) <input id="track" type="file" accept=".track"></label></p><p><label>Formula network (.evolution) <input id="network" type="file" accept=".evolution"></label></p><p id="networkChoice" role="status">Choose an uploaded file or use a network from the browser editor.</p><p class="privacy-note">Uploads are processed for this run. By default, the server copy is deleted after the browser verifies the download.</p><label class="keep-result"><input id="keepServer" type="checkbox"> Keep this result on the server for up to five minutes so I can download it again</label><p class="privacy-note">This is optional and resets after each run. All results expire after five minutes. <a href="/policy" target="_blank" rel="noopener">Data policy</a></p><button id="run" disabled>Run training</button></section><section class="card"><h2>Selected track & terrain</h2><p id="mapStatus" class="map-status" role="status">Loading selected track…</p><div class="map"><canvas id="trackMap" width="1000" height="500" role="img" aria-label="Selected track tile layout and terrain"></canvas></div><div class="map-legend"><span><i class="terrain asphalt"></i> Asphalt</span><span><i class="terrain dirt"></i> Dirt</span><span><i class="terrain ice"></i> Ice</span><span><i class="terrain start"></i> Start</span></div><p id="mapLegend" class="hint"></p><h2>Run & results</h2><button id="download" disabled>Download result</button> <button id="erase" disabled>Delete server-side job data now</button><p><button id="saveLocal" disabled>Save received result again (browser only)</button> <button id="forgetLocal" disabled>Discard browser result</button></p><p>The browser keeps the received result in memory until discarded, replaced by a new run, or this page is closed. It is not saved to browser storage.</p><h3 id="runState" role="status" aria-live="polite">READY — no run started</h3><pre id="runSummary" style="white-space:pre-wrap;line-height:1.7" aria-live="polite"></pre><p id="deadline"></p><p id="status" role="status">Ready. Inputs remain on this device until you run the test.</p><details><summary>Effective training settings</summary><pre id="effectiveSettings"></pre></details><details><summary>Generation results</summary><pre id="generationHistory"></pre></details><details><summary>Star challenges — not evaluated</summary><p>The current runner has star-challenge reporting. Its evaluator and required statistics have not been ported to HF; no star result is inferred from a completed test.</p></details></section></div></div><section id="training" class="pane" hidden><div class="card"><h2>Training settings</h2><p class="hint">Choose the track on Drive & view. Choose the training settings and reward mix here, then start the run on Drive & view. Recipes and batch sequences are saved in this browser.</p><p><label for="trackPresetTraining">Training track</label><select id="trackPresetTraining" data-track-library disabled><option value="">Upload a custom track</option></select></p><p data-track-status role="status" class="hint">Loading built-in replica tracks…</p><div id="training_controls"><label for="training_ticks">Simulated ticks per generation</label><input id="training_ticks" type="number" min="1" max="18000" value="60"><small>60 ticks = one simulated second. Current preview limit: population × generations × ticks ≤ 4,000,000; execution timeout 25 seconds.</small><div class="row"><div><label for="population">Population</label><input id="population" type="number" min="1" max="128" value="8" disabled><small>1–128 cars in this beta.</small></div><div><label for="generations">Generations</label><input id="generations" type="number" min="1" max="1000" value="30" disabled><small>1–1,000; try 20–50 before review.</small></div></div><label id="mutation_label" for="mutation">Mutation rate</label><input id="mutation" type="number" min="0" max="4.2" step="0.01" value="0.1" disabled><small>Mutation settings are passed to the upstream simulator.</small><details id="native_settings"><summary>Native evolution settings</summary><label for="preset">Recommended starting recipe</label><select id="preset" disabled><option value="custom">Custom / keep current settings</option><option value="starter">First laps · mutation 0.3, decay 0.0005</option><option value="explore">Wide exploration · mutation 0.5, decay 0.0005</option><option value="refine">Established driver · mutation 0.1, decay 0.0001</option><option value="speed">Lap refinement · mutation 0.05, decay 0</option></select><small>Starting hypotheses, not proven optimums. Change stages after stable improvement.</small>41 unmodified linesfor(const [key,choices] of [['schedule',['fixed','linear','geometric']],['selection',['best','tournament','roulette']],['crossover',['none','single_point','uniform']],['control_hz',[60,30,15]]])if(!choices.includes(clean[key]))throw Error('Invalid '+key);for(const key of ['adaptive_mutation','collision','idle'])if(typeof clean[key]!=='boolean')throw Error('Invalid '+key);if(clean.parents>clean.population||clean.elite>clean.population)throw Error('Parents/elites exceed population');if(clean.schedule==='geometric'&&(!clean.mutation||!clean.mutation_end))throw Error('Geometric rates must be positive');if(!Array.isArray(clean.rewards)||!clean.rewards.length||clean.rewards.length>5)throw Error('Use one to five rewards');const seen=new Set();clean.rewards=clean.rewards.map(r=>{12345678910111213141516171819202122232425262728293041 unmodified lines72737475767778<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>AI Learns To Drive</title><style>:root{color-scheme:dark;font:16px system-ui;background:#0c1420;color:#e5edf5}body{max-width:1400px;margin:auto;padding:22px}h1{font-size:32px;margin:0}h2{font-size:21px;margin:0 0 14px}small,.hint{color:#a2b4c8;line-height:1.6}.grid{display:grid;grid-template-columns:minmax(360px,.9fr) minmax(0,1.25fr);gap:24px}.card{background:#152233;border:1px solid #2a3d52;border-radius:16px;padding:22px;margin-top:20px}label{display:block;margin:12px 0 5px}input,select,button{font:inherit;background:#0c1725;color:#e5edf5;border:1px solid #49627c;border-radius:7px;padding:9px}input[type=number],select{width:100%;box-sizing:border-box}input[type=file]{max-width:100%;box-sizing:border-box}button{cursor:pointer}button.primary{background:#62dfb1;color:#102522;font-weight:700}button:disabled{opacity:.4;cursor:default}.row{display:grid;grid-template-columns:1fr 1fr;gap:15px}.reward{display:grid;grid-template-columns:1.7fr 1fr 70px 30px;gap:5px;margin:8px 0}.reward input{width:70px;box-sizing:border-box}a{color:#7ce4c3}canvas{width:100%;background:#09111b;border-radius:10px}#status{white-space:pre-wrap;line-height:1.7}table{width:100%;text-align:left;border-collapse:collapse;font-size:14px}td,th{padding:9px;border-bottom:1px solid #2a3d52}.pill{display:inline-block;background:#284539;border-radius:20px;padding:5px 12px;color:#91efc6;margin:6px 0}#error{color:#ffb5a2;white-space:pre-wrap}.toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding-bottom:16px;border-bottom:1px solid #2a3d52;margin-bottom:15px}.run-card{position:sticky;top:20px}details{margin-top:18px;border-top:1px solid #2a3d52;padding-top:14px}summary{cursor:pointer;font-weight:600;color:#c6d9e9}details[open]>summary{margin-bottom:12px}[hidden]{display:none!important}#map_note{font-size:14px}#runs{max-height:380px;overflow:auto}.table-scroll{overflow:auto}@media(max-width:850px){.grid{grid-template-columns:minmax(0,1fr)}.card{min-width:0}.run-card{position:static}body{padding:16px}}.tabs{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}.tabs button[aria-selected=true]{background:#62dfb1;color:#102522}.library{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px}.library input[type=text]{width:100%;box-sizing:border-box}.queue-row{display:flex;gap:8px;margin:8px 0}.queue-row select{flex:1}.pane{min-width:0}.map{min-height:300px;background:#09111b;border-radius:12px;padding:10px}.map canvas{display:block;width:100%;height:auto;max-height:320px;object-fit:contain}.map-legend{display:flex;gap:18px;flex-wrap:wrap;margin:10px 0;color:#c6d9e9;font-size:14px}pre{white-space:pre-wrap;overflow-wrap:anywhere}input[type=text]{width:100%;box-sizing:border-box}#libraries .row label>input,#libraries .row label>select{display:block;margin-top:6px}#editor_parameters input{max-width:240px} .eyebrow{color:#62dfb1;font-size:12px;letter-spacing:.18em;font-weight:800}.intro{font-size:19px;color:#b9cddd;max-width:820px;margin:10px 0 0}header{padding:12px 0 4px}header h1{font-size:clamp(30px,4vw,45px);letter-spacing:-.03em;margin-top:7px}.about{max-width:850px;font-size:14px;margin-top:15px}.about p{line-height:1.65}.card{box-shadow:0 10px 35px #050a1280}.tabs{position:sticky;top:0;z-index:3;background:#0c1420eF;padding:12px 0;border-bottom:1px solid #2a3d52}.tabs button{border-radius:12px;padding:11px 15px}.map-status{margin:7px 0;color:#dbe9f1;font-size:14px}#run{background:#62dfb1;color:#102522;font-weight:800;width:100%;margin-top:12px;padding:13px}.privacy-note{font-size:13px;line-height:1.5;color:#a2b4c8}.keep-result{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid #3b566b;border-radius:10px;background:#102030;line-height:1.4}.keep-result input{margin:3px 0 0;flex:none} .terrain{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:4px;background:#607e96}.terrain.dirt{background:#b89561}.terrain.ice{background:#b9d9ed}.terrain.start{background:#66e5aa}@media(max-width:850px){.map{min-height:0}}</style><header><div class="eyebrow">AI LEARNS TO DRIVE · TRAINING LAB</div><h1>Train, inspect, repeat.</h1><p class="intro">Pick a track and network, run a bounded training session, and keep your recipes in this browser.</p><details class="about"><summary>About this beta and its data handling</summary><p>Simulator by <a href="https://github.com/Zorro909/driving_sim_rs">Zorro909</a>; interface and hosting by <a href="https://github.com/seeker-cyber-maker/driving_sim_rs">TiGa</a>. Inspired by the <a href="https://store.steampowered.com/app/3312030/AI_Learns_To_Drive/">game by ActivationFunction</a>. Built-in tracks are reconstructed replicas. Star challenges are not evaluated here.</p><p>Uploaded files are used for the requested run. Results are held briefly in application memory and deleted after verified download or expiry. Browser recipes contain settings only. <a href="/policy" target="_blank" rel="noopener">Read the data policy</a>.</p></details><p><a href="/feedback" target="_blank" rel="noopener">Beta feedback template</a> · Export a run receipt when reporting a problem.</p><p id="buildLabel" class="hint">Build: connecting…</p></header><nav class="tabs" aria-label="Lab sections"><button data-tab="drive" aria-selected="true">1 · Drive & view</button><button data-tab="training" aria-selected="false">2 · Training runs & presets</button><button data-tab="batch" aria-selected="false">3 · Batches</button><button data-tab="editor" aria-selected="false">4 · Network editor</button></nav><div id="drive" class="pane"><div class="grid"><section class="card"><h2>Simulation</h2><button id="run" disabled>Run training</button><p class="hint">Select or create a network below to enable training. Review settings on tab 2 before running.</p><p>Supports Formula steering/acceleration, speed/raycast sensors, and 2–4 layers of up to 16 nodes.</p><p id="computeBlock"><label for="backend">Compute</label><select id="backend" disabled><option value="cpu">CPU — no GPU allowance</option><option id="gpuOption" value="gpu" disabled>GPU — uses GPU allowance</option></select></p><p id="backendNote" class="hint">Checking available backends…</p><div id="connectionRecovery" hidden><button id="retry" type="button">Reconnect to app</button><p class="hint">Checks server availability. Does not restart training, sign you in, or reset GPU allowance.</p></div><div id="gpuAccount" aria-label="Optional GPU account"><p><button id="hfSignIn" type="button" disabled>Sign in with HF for account GPU allowance</button><span id="hfAccount" hidden></span> <button id="hfSignOut" type="button" disabled hidden>Disconnect account</button></p><p id="hfIdentity" role="status" class="hint">CPU needs no sign-in. Checking optional GPU account connection…</p><details><summary>Account help & troubleshooting</summary><p>CPU works without an account. HF sign-in identifies GPU requests; it does not guarantee available allowance. Sign in before choosing files: sign-in reloads this page and clears selected files and unsaved edits. Saved recipes remain.</p><p>Your account token stays in page memory. Refreshing or closing this page disconnects the app. Disconnecting here does not sign you out of the HF website or delete job data.</p><button id="hfVerify" type="button" disabled hidden>Check account connection — no GPU used</button><p class="hint">Checks which account the GPU submission service sees. Runs automatically before GPU training; it does not check your remaining allowance.</p></details></div><p><label for="trackPresetDrive">Track selection</label><select id="trackPresetDrive" data-track-library disabled><option value="">Upload a custom track</option></select></p><p data-track-status role="status" class="hint">Loading built-in replica tracks…</p><p><label>Track (.track) <input id="track" type="file" accept=".track"></label></p><p><label>Formula network (.evolution) <input id="network" type="file" accept=".evolution"></label></p><p id="networkChoice" role="status">Choose an uploaded file or use a network from the browser editor.</p><p class="privacy-note">Uploads are processed for this run. By default, the server copy is deleted after the browser verifies the download.</p><details><summary>Optional repeat download</summary><label class="keep-result"><input id="keepServer" type="checkbox"> Keep this result on the server for up to five minutes so I can download it again</label><p class="privacy-note">This is optional and resets after each run. All results expire after five minutes. <a href="/policy" target="_blank" rel="noopener">Data policy</a></p></details></section><section class="card"><h2>Selected track & terrain</h2><p id="mapStatus" class="map-status" role="status">Loading selected track…</p><div class="map"><canvas id="trackMap" width="1000" height="500" role="img" aria-label="Selected track tile layout and terrain"></canvas></div><div class="map-legend"><span><i class="terrain asphalt"></i> Asphalt</span><span><i class="terrain dirt"></i> Dirt</span><span><i class="terrain ice"></i> Ice</span><span><i class="terrain start"></i> Start</span></div><p id="mapLegend" class="hint"></p><h2>Run & results</h2><button id="download" disabled>Download result</button> <button id="erase" disabled>Delete server-side job data now</button><p><button id="saveLocal" disabled>Save received result again (browser only)</button> <button id="forgetLocal" disabled>Discard browser result</button></p><p>The browser keeps the received result in memory until discarded, replaced by a new run, or this page is closed. It is not saved to browser storage.</p><h3 id="runState" role="status" aria-live="polite">READY — no run started</h3><pre id="runSummary" style="white-space:pre-wrap;line-height:1.7" aria-live="polite"></pre><p><button id="run_export" disabled>Export run receipt</button></p><p class="hint">Receipts include build identity, settings, metrics and file hashes. Review them before sharing; they contain no network weights or job access keys.</p><p id="deadline"></p><p id="status" role="status">Ready. Inputs remain on this device until you run the test.</p><details><summary>Effective training settings</summary><pre id="effectiveSettings"></pre></details><details><summary>Generation results</summary><pre id="generationHistory"></pre></details><details><summary>Star challenges — not evaluated</summary><p>The current runner has star-challenge reporting. Its evaluator and required statistics have not been ported to HF; no star result is inferred from a completed test.</p></details></section></div></div><section id="training" class="pane" hidden><div class="card"><h2>Training settings</h2><p class="hint">Choose the track on Drive & view. Choose the training settings and reward mix here, then start the run on Drive & view. Recipes and batch sequences are saved in this browser.</p><p><label for="trackPresetTraining">Training track</label><select id="trackPresetTraining" data-track-library disabled><option value="">Upload a custom track</option></select></p><p data-track-status role="status" class="hint">Loading built-in replica tracks…</p><div id="training_controls"><label for="training_ticks">Simulated ticks per generation</label><input id="training_ticks" type="number" min="1" max="18000" value="60"><small>60 ticks = one simulated second. Current preview limit: population × generations × ticks ≤ 4,000,000; execution timeout 25 seconds.</small><div class="row"><div><label for="population">Population</label><input id="population" type="number" min="1" max="128" value="8" disabled><small>1–128 cars in this beta.</small></div><div><label for="generations">Generations</label><input id="generations" type="number" min="1" max="1000" value="30" disabled><small>1–1,000; try 20–50 before review.</small></div></div><label id="mutation_label" for="mutation">Mutation rate</label><input id="mutation" type="number" min="0" max="4.2" step="0.01" value="0.1" disabled><small>Use a positive mutation rate, including when continuing an uploaded network. A one-generation run still evaluates the uploaded parent.</small><details id="native_settings"><summary>Native evolution settings</summary><label for="preset">Recommended starting recipe</label><select id="preset" disabled><option value="custom">Custom / keep current settings</option><option value="starter">First laps · mutation 0.3, decay 0.0005</option><option value="explore">Wide exploration · mutation 0.5, decay 0.0005</option><option value="refine">Established driver · mutation 0.1, decay 0.0001</option><option value="speed">Lap refinement · mutation 0.05, decay 0</option></select><small>Starting hypotheses, not proven optimums. Change stages after stable improvement.</small>41 unmodified linesfor(const [key,choices] of [['schedule',['fixed','linear','geometric']],['selection',['best','tournament','roulette']],['crossover',['none','single_point','uniform']],['control_hz',[60,30,15]]])if(!choices.includes(clean[key]))throw Error('Invalid '+key);for(const key of ['adaptive_mutation','collision','idle'])if(typeof clean[key]!=='boolean')throw Error('Invalid '+key);if(clean.parents>clean.population||clean.elite>clean.population)throw Error('Parents/elites exceed population');if(clean.mutation<=0||(clean.schedule!=='fixed'&&clean.mutation_end<=0))throw Error('This training runner requires positive mutation rates, including when continuing an uploaded network');if(!Array.isArray(clean.rewards)||!clean.rewards.length||clean.rewards.length>5)throw Error('Use one to five rewards');const seen=new Set();clean.rewards=clean.rewards.map(r=>{
7 unmodified lines891011121328 unmodified lines424344454647484 unmodified lines5354555657587 unmodified linesfrom starlette.concurrency import run_in_threadpoolfrom delivery import create_api, CapacityExceededfrom worker import run_reportedfrom training_config import validate_configfrom hf_identity import oauth_configfrom builtin_tracks import TrackLibrary28 unmodified linesdef oauth_script(): return FileResponse(ROOT/'vendor/hf-oauth/index.js',media_type='text/javascript')@app.get('/api/capabilities')def capabilities():return {'cpu':True,'gpu':gpu_worker is not None,'default':'cpu','configurable_training':True}@app.get('/')def index():# Deliver the bootstrap with the authenticated document: private HF4 unmodified linesheaders={'Referrer-Policy':'no-referrer','Cache-Control':'no-store'})@app.get('/client.js')def script(): return FileResponse(ROOT/'client.js',media_type='text/javascript')@app.get('/policy')def policy(): return FileResponse(ROOT/'DATA_POLICY.md',media_type='text/plain')@app.post('/api/process')7 unmodified lines89101112131428 unmodified lines434445464748494 unmodified lines54555657585960617 unmodified linesfrom starlette.concurrency import run_in_threadpoolfrom delivery import create_api, CapacityExceededfrom worker import run_reportedfrom build_info import build_identityfrom training_config import validate_configfrom hf_identity import oauth_configfrom builtin_tracks import TrackLibrary28 unmodified linesdef oauth_script(): return FileResponse(ROOT/'vendor/hf-oauth/index.js',media_type='text/javascript')@app.get('/api/capabilities')def capabilities():return {'cpu':True,'gpu':gpu_worker is not None,'default':'cpu','configurable_training':True,'build':build_identity()}@app.get('/')def index():# Deliver the bootstrap with the authenticated document: private HF4 unmodified linesheaders={'Referrer-Policy':'no-referrer','Cache-Control':'no-store'})@app.get('/client.js')def script(): return FileResponse(ROOT/'client.js',media_type='text/javascript')@app.get('/feedback')def feedback(): return FileResponse(ROOT/'FEEDBACK.md',media_type='text/plain')@app.get('/policy')def policy(): return FileResponse(ROOT/'DATA_POLICY.md',media_type='text/plain')@app.post('/api/process')
26 unmodified lines2728293031323326 unmodified linesfor key in ('adaptive_mutation','collision','idle'):if type(c[key]) is not bool:raise ValueError('Invalid '+key)if c['parents']>c['population'] or c['elite']>c['population']:raise ValueError('Parents/elites exceed population')if c['schedule']=='geometric' and (not c['mutation'] or not c['mutation_end']):raise ValueError('Geometric rates must be positive')# Echo the rate actually passed to the native CLI, not an unused form value.if c['schedule']=='fixed':c['mutation_end']=c['mutation']rewards=c['rewards']26 unmodified lines2728293031323326 unmodified linesfor key in ('adaptive_mutation','collision','idle'):if type(c[key]) is not bool:raise ValueError('Invalid '+key)if c['parents']>c['population'] or c['elite']>c['population']:raise ValueError('Parents/elites exceed population')if c['mutation']<=0 or (c['schedule']!='fixed' and c['mutation_end']<=0):raise ValueError('This training runner requires positive mutation rates, including when continuing an uploaded network')# Echo the rate actually passed to the native CLI, not an unused form value.if c['schedule']=='fixed':c['mutation_end']=c['mutation']rewards=c['rewards']
12 unmodified lines131415161718115 unmodified lines13413513613713813914012 unmodified linesimport tempfileimport timefrom training_config import validate_configMODULE_DIR = Path(__file__).resolve().parent# Source checkout is nested; a hosted release is flat under /app. Deployment115 unmodified linesnetwork_input(result)history=[json.loads(line) for line in (out/'log.jsonl').read_text().splitlines() if line.strip()]last=history[-1] if history else {}report={'state':'completed','elapsed_seconds':time.perf_counter()-started,'generations_completed':len(history),'generations_requested':config['generations'],'population':config['population'],'best_score':last.get('best_score'),'mean_score':last.get('mean_score'),'best_lap_seconds':last.get('best_lap_s'),'lapped_cars':last.get('lapped_cars'),12 unmodified lines13141516171819115 unmodified lines13513613713813914014112 unmodified linesimport tempfileimport timefrom training_config import validate_configfrom build_info import build_identityMODULE_DIR = Path(__file__).resolve().parent# Source checkout is nested; a hosted release is flat under /app. Deployment115 unmodified linesnetwork_input(result)history=[json.loads(line) for line in (out/'log.jsonl').read_text().splitlines() if line.strip()]last=history[-1] if history else {}report={'build':build_identity(),'state':'completed','elapsed_seconds':time.perf_counter()-started,'generations_completed':len(history),'generations_requested':config['generations'],'population':config['population'],'best_score':last.get('best_score'),'mean_score':last.get('mean_score'),'best_lap_seconds':last.get('best_lap_s'),'lapped_cars':last.get('lapped_cars'),
BETA_TESTING.md+17
FEEDBACK.mdAdded+24
FRONTEND_SOURCE.json+3-3
RELEASE_MANIFEST.json+10-8
app.py+2-1
build_info.pyAdded+20
client.js+31-15
index.html+10-9
server.py+4-1
training_config.py+1-1
worker.py+2-1