The Missing Torque Calibration — Java Bug Hunt
Modelled on the Airbus A400M crash near Seville on 9 May 2015.
- Language: Java
- Layer: Backend
- Difficulty: Hard
- Concepts: Config, Safety, Validation
- Modelled on: Airbus A400M · 2015
- Visible tests: a complete calibration loads; four calibrated engines are GO; three erased engines are NO-GO
- Reward: 50 XP for a complete fix
Briefing
Modelled on the Airbus A400M crash near Seville on 9 May 2015. On a pre-delivery test flight, three of the aircraft's four engines did not respond correctly after take-off and the aircraft crashed, killing four of the six crew. Airbus later said that torque calibration parameter data had been accidentally wiped from the engine control units of three engines during software installation, leaving those engines unable to operate as commanded, and the missing data was not flagged before take-off.
This reconstruction's CalibrationLoader reads each engine's parameter file. A missing parameter quietly becomes 0, so the preflight check sees a "calibration" for every engine and signs off.
Fix the loader so a missing, blank or unreadable parameter can never be flown on.
Bug report
BUG-A400M · Priority: Critical (safety) · Reported by: flight test
CalibrationLoader.load(file) builds a Calibration from the parameters "torque.gain" and "torque.offset":
- each value is parsed as a double (surrounding whitespace allowed)
- a parameter that is missing, blank, or not a number must make load() throw IllegalStateException naming the parameter — never a default of 0, never a NumberFormatException
- Preflight.check(engines) (locked) relies on that: it answers "GO" only when every engine loads, otherwise "NO-GO: engines 1,2,3" (1-based)
Observed: three engines with erased calibration files pass preflight as "GO"; in flight their torque commands come out as raw * 0 + 0.
Logs
[ecu-1] load torque.gain=<absent> torque.offset=<absent>
[preflight] engines 1-4 calibrated: GO
[ecu-1] torque command 0.0 for throttle 92%The code as shipped
src/engine/CalibrationLoader.java (editable)
class CalibrationLoader {
static Calibration load(EngineFile file) {
double gain = read(file, "torque.gain");
double offset = read(file, "torque.offset");
return new Calibration(gain, offset);
}
static double read(EngineFile file, String key) {
String raw = file.values.getOrDefault(key, "0");
return Double.parseDouble(raw.trim());
}
}Read-only context: src/engine/Calibration.java, src/engine/Preflight.java.
Open the hunt to edit the files, run the visible tests and submit against the hidden ones. More Java bug hunts.