Only use GPU fuel & signature.
Some checks are pending
Test Workspace / Test Workspace (push) Waiting to run

This commit is contained in:
FiveMovesAhead 2025-07-09 01:10:42 +01:00
parent 4efbbff743
commit c0dcd72274

View File

@ -230,16 +230,21 @@ pub fn compute_solution(
if stream.memcpy_dtov(&error_stat)?[0] != 0 {
break 'out_of_fuel (max_fuel + 1, 0, Solution::new(), None);
}
let fuel_consumed = (stream.memcpy_dtov(&fuel_usage)?[0] / gpu_fuel_scale
+ max_fuel
- unsafe { **library.get::<*const u64>(b"__fuel_remaining")? });
let gpu_fuel_consumed = stream.memcpy_dtov(&fuel_usage)?[0] / gpu_fuel_scale;
// let cpu_fuel_consumed =
// max_fuel - unsafe { **library.get::<*const u64>(b"__fuel_remaining")? };
// let fuel_consumed = gpu_fuel_consumed + cpu_fuel_consumed;
let fuel_consumed = gpu_fuel_consumed;
if fuel_consumed > max_fuel {
break 'out_of_fuel (max_fuel + 1, 0, Solution::new(), None);
}
let runtime_signature = (stream.memcpy_dtov(&signature)?[0]
^ unsafe { **library.get::<*const u64>(b"__runtime_signature")? });
let gpu_runtime_signature = stream.memcpy_dtov(&signature)?[0];
// let cpu_runtime_signature =
// unsafe { **library.get::<*const u64>(b"__runtime_signature")? };
// let runtime_signature = gpu_runtime_signature ^ cpu_runtime_signature;
let runtime_signature = gpu_runtime_signature;
let (solution, invalid_reason) = match result {
Some(s) => {