# Batch 5 notes Paths are relative to `gt5-2.9.0/src/main/java` (GT5-Unofficial 5.09.54.265) unless stated. Java reference used for the examples: a scratch driver (`/tmp/batch-5/jref/B5Ref.java`, not committed) compiled with the unmodified 2.9.0 `gregtech/api/util/OverclockCalculator.java` and `tools/java-ref/GTUtilityStub.java`. Each machine method is a copy of the numeric lines of the controller cited below; item and fluid matching is replaced by a "sets" count. ## AAL (`machines/aal.js`) - Ported from `new/AAL Throughput Planner.html` and `NOTES-assembly-lines.md`: total-EU or tick input, recipe tier from EU/t, slices, hatch tier and total amps, sub-tick parallels, batch line, throughput / latency / peak power / EU per output / efficiency tiles, the two amperage sweeps (throughput for tier −1/0/+1, EU cost ratio). - Added: "Recipe sets in stock" models `firstFluidSlot.amount / fluid0`, divided by slices in batch mode, and the item/fluid caps (`MTEAdvAssLine.java:805-816`). The old page assumed ample inputs; the default (1,000,000) still does. - `checkProcessing` (`:760-843`): voltage check against the lowest hatch voltage (`:761`, `:520-525`), power check `slices × EU/t > Σ V×A` (`:767`), calculator with `setEUt(inputEUt / slices)`, amperage 1, laser OC, max regular OCs `getTier(V) − getTier(EU/t)`, duration supplier `mDuration / slices` (`:775-782`). The calculator never gets `setDuration`; the supplier drives both the OC and the sub-tick multiplier. - Batch multiplier `(int) min(128 / duration, currentParallel / maxParallelBeforeBatch)` only when `currentParallel > maxParallelBeforeBatch` (`:833-841`); `mMaxProgresstime = (int)(duration × B) × slices` (`:843`). Slice period = `mMaxProgresstime / slices` (`:1066`). - Default recipe: Optical Mainframe from the 2.9.0 dump (`gt.recipe.fakeAssemblylineProcess`, output `gt.metaitem.03.32157`, `IDMetaItem03.java:119` Circuit_OpticalMainframe): 7,864,320 EU/t, 6000 t, 13 items, 4 fluids. - Java driver results (all examples): - `eut=7864320 duration=6000 slices=13 voltage=8388608 amps=256` → budget 165191049, 2 laser OC, 155556250 EU/t, 115 t. - `eut=32768 duration=61035 slices=12 voltage=524288 amps=64` → 2+1 OC, 2254439 EU/t, 635 t. - `eut=491520 duration=600 slices=16 voltage=8388608 amps=1048576` → 8 OC, sub ×7, 126437986350 EU/t, 1 t. - `eut=30 duration=600 slices=16 voltage=8192 amps=64 batch=true` → 4 OC, 2 t, batch 64, parallel 64, maxProgress 2048. - same with `sets=100` → batch 6, parallel 6. - Dead end: a hand guess of the default's EU/t (×4.3×4.6 on the pre-rounded value) was off; the Java value 155,556,250 is `ceil(7864320 × 4.3 × 4.6)`. ## CAL (`machines/cal.js`) - Ported from `new/CAL Throughput Planner.html`: mode (CAL / Circuit Assembler), EU/t, duration, hatch tier, the CA-mode `EU/t > V/4` error text, throughput / sub-tick / recipe time / power / EU per circuit tiles, OC line, throughput-by-tier and parallels-by-tier charts. Duration is now entered in ticks (seconds in the hint). - Added: circuits per recipe (the old page showed recipes per minute labelled as circuits; CAL recipes output 16 circuits, 2.9.0 dump `bw.recipe.cal`), batch mode toggle, and an EU ratio when the 1-tick truncation makes a recipe cheaper. - `validateRecipe` (`MTECircuitAssemblyLine.java:352-385`): CA mode `mEUt > getMaxInputVoltage() / 4` → insufficient voltage with `mEUt × 4L`; CAL mode bus-order check (not modelled numerically, shown as a warning). Perfect OC `enablePerfectOverclock()`. - Available tier: the controller's assembly line recipe runs at `TierEU.RECIPE_ZPM` (`bartworks/common/loaders/recipes/AssemblyLine.java:46-62`). - Default recipe: Nanoprocessor (`IDMetaItem03.java:71`, `gt.metaitem.03.32082`), 600 EU/t, 1200 t, ×16, from the dump (one of two variants; the other is 2400 t). - Java reference (`tools/java-ref/run.sh "" case ... amperage=1 timeRed=4 maxParallel=1`): 600/1200 UV → 4 OC, 153600 EU/t, 4 t; 480/600 UV → 5 OC, ×2; 30/200 MAX → 12 OC, ×83887 (⌊2147483640/32⌋ = 4^13 − 1, so 12, not 13); 480/600 UV batch → 256 parallel, 128 t. - Dead end: my first guess for the MAX case assumed 13 OCs; `V[14] = 2^31 − 8` keeps it at 12. ## CoAL (`machines/coal.js`) - Ported from `new/CoAL Throughput Planner.html`: EU/t, duration, recipe casing tier, CoAL casing T1–T14, hatch tier + total amps, throughput / recipe time / casing bonus / power / EU per component / sub-tick tiles, OC line, amperage sweep with one line per casing tier (now selected casing ±1, max 4 series) and the EU-cost sweep. The real-recipe text became a recipe preset select (custom, or each tier group from the dump). - Added: batch toggle, a warning when the casing bonus alone puts the base time at ≤ 1 tick (heat-branch quirk). - Lines: tier gate `mSpecialValue > casingTier + 1` (`MTEComponentAssemblyLine.java:293-295`), speed bonus `powInt(2, -(casingTier + 1 - mSpecialValue))` (`:302-303`), power `getMaxInputEu()`, 1 A, unlimited tier skips (`:308-313`). - Available tier: the controller's assembly line recipe runs at `RECIPE_UHV / 2` = 983,040 EU/t (UHV, `goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java:84-87`). - 2.9.0 dump, `gg.recipe.componentassemblyline` grouped by (special value, EU/t, ticks, output): T1–T5 at 960 t and one 28,800 t (field generator) each, T6–T8 28,800 t, T9–T13 48,000 t; EU/t = VP[tier − 1]; output always 64. - Java reference (`run.sh "" case ... amperage=1 maxTierSkips=2147483647`): UV 122880/28800, speed 0.5, 33554432 EU/t → 4 OC, 31457280 EU/t, 900 t; 7/960 speed 2^−13 on 8192 → 4 OC, ×1093; same on 2199023247360 (MAX 1024 A) → 17 OC, ×8947849. ## HILE (`machines/hile.js`) - Ported from `new/HILE Throughput Planner.html` and `NOTES-hile-pcb.md`: EU/t, duration, laser tier and amps (per-tier maximum), energy hatch tier, throughput / parallels / time / power / EU per recipe tiles, OC line, throughput and EU-cost sweeps with the smallest/middle/largest laser source of the tier, and the DTR catalyst chain (mixer pipe casing incl. legacy GT++ mixer, mixer hatch tier, hatch type, hatch count; per-stage table with parallels, OC, time, L/s, mixers, EU/t; total). - Changed: the energy input is hatch type + tier + count (regular) or one 4/16/64 A multi-amp hatch, instead of free total amps, because the structure only allows those (`MTEIndustrialLaserEngraver.java:87, :293-305`). The sweeps therefore run over the energy hatch tier instead of amps. The old "mixers per stage" bar chart is now the per-stage table plus a sweep of total mixers by mixer hatch tier. - Added: glass tier input with the `glassTier < laserSource.mTier` structure error (`:310-312`), the UEV+ check for a multi-amp hatch, an error for laser amps that do not exist at the chosen tier, batch mode. - Laser source list re-read from `tectech/loader/thing/MachineLoader.java:1162-1310`: every tier from IV has 256 A up to its maximum (IV 256 … UMV 4194304 at `:1268-1274`, UXV 16777216 at `:1303-1309`). The legendary source (`hatch.dynamotunnel.tier.14`, tier 13, `V[13]` amps, `:1310-1312`) is not offered (no recipe found, as in the old notes). - Java reference (`tools/java-ref/run.sh "" case`, speed 1/3.5 = 0.2857142857142857, euMod 0.8): - DTEC on 8× UEV (8388608 V, 16 A), maxParallel 16, maxOC 1 → 16 par, 0 OC, 100663296 EU/t, 14285 t. - 30 EU/t 1 t, EV 1 A, maxParallel 6, maxOC 5 → 84 parallel (sub ×14), 1 OC, 576 EU/t, 1 t. - 491520/2000 on UIV 64 A multi, maxParallel 101, maxOC 4 → 101 par, 2 OC, 635437056 EU/t, 142 t. - Mixer stages on 2× UEV (4 A, Σ V = 16777216 → tier UIV → 88 parallels), speed 1/10: Crude 88 par, Prosaic 68, Resplendent 17, Exotic 4, all 0 OC, 5000 t. Demand 16 × 1000 L / 14285 t → mixers 1, 1, 1, 2. ## PCB Factory (`machines/pcb-factory.js`) - Ported from `new/PCB Factory Planner.html`: EU/t, duration, boards per craft, required tier, nanite type, bio recipe, machine tier, Cooling Tower (none / T1 / T2), Bio Chamber, trace size, nanite count, energy; tiles for throughput, parallels, time, power with √structures, boards per craft, EU per board, stock inputs; OC line and input-stocking line; sweeps over nanite count (one line per tower option) and trace size (throughput, EU per board). - Changed: energy is 1–2 regular hatches, one multi-amp (4/16/64 A) or one laser target hatch instead of free total amps, because `checkExoticAndNormalEnergyHatches` allows only those (`MTEMultiBlockBase.java:2998-3017`). - Added: "tower linked, not allowed to work" (counts in √structures, no OC: `:432-438` count `mCoolingTower != null`, `isOC()` needs `isAllowedToWork`, `:478-485`), coolant tile, batch toggle. - Default recipe: Wetware Circuit Board, plastic tier 5, T2 Silver + Bio (`PCBFactoryRecipes.java:439-466`): boards ⌈8√(2^0.5)⌉ = 10, ⌈500 / √(1.5^−0.5)⌉ = 554 t, VP[6] × 3/4 = 23040 EU/t; the 2.9.0 dump has the same (23040, 554, 10 × `gt.metaitem.03.32105` = Circuit_Board_Wetware_Extreme, `IDMetaItem03.java:94`). The dump carries no tier, nanite or upgrade metadata, so presets per board were not built from it. - Java driver `proc` (copy of RefMain.process with the float helper modifier and `setNoOverclock`), all √3 unless stated: - 23040/554, 2× UHV (2097152 V, 4 A), maxParallel 23 → 1 OC, 3671394 EU/t, 277 t. - same, speed 0.25, timeRed 4 → 1 OC, 34 t. Same on UHV 1024 A → 5 OC, sub ×8, 184 parallels, 939876725 EU/t, 1 t. - noOC, √2 → 749421 EU/t, 554 t. Old default 98304/400 on UV 16 A, √2 → 23, 3197526 EU/t, 400 t. - Dead end: my first default (2× UV) gave 0 OC (917849 × 4 > 2097152), so the default hatch tier is UHV. ## Nanochip Assembly Complex (`machines/nanochip-assembly-complex.js`) - Page type: generic (inputs → compute → tiles/tables/sweeps) rather than `mount()`. One module recipe is computed at a time; the module counts and the matrix share drive the power split, and a table lists every recipe of the selected module at the current share. CURATED.md suggested `custom`; the generic form covered all inputs without a custom layout. - Source read: `MTENanochipAssemblyComplex.java` (power buffer `:658-708`, `updateModuleEU` `:796-858`, calibration `:559-612`), `MTENanochipAssemblyModuleBase.java` (`checkProcessing` `:449-560`, `transformRecipe` `:584-617`, defaults `:696-726`), all module classes for overrides (`grep` of `getModuleDurationModifier|getEUDiscountModifier|getMaximumParallel| getOCFactorReduction|transformRecipe|validateRecipe|getRecipeTier|checkProcessing`), `CircuitCalibration.java`, `CircuitBatch.java`, `CircuitComponent.java:606-698` (circuit type and weight). - Float arithmetic ported: portion `(newPortion / 100.0f) * totalEUt` is float × long → float (`:833`); `mEUt * float * float` and `mDuration * float` are float before widening (`:585-586`); calibration multipliers are float fields with `-= 0.2f`. - Found: with Special level 3 on Pico circuits, `recipeEUT` exceeds `Integer.MAX_VALUE` after the overclocks and `(int) recipeEUT` (`:613`) saturates to 2,147,483,647 EU/t. The Java driver reproduces it. Not checked in game. - Found: Special calibration multiplies EU/t by `1 / max(0.1, 1 − globalDurationMultiplier)` (`:594-596`), i.e. ×5 at level 1 (duration ×0.8), ×2.5 at level 2, ×2 at level 3. The code comment says it restores the EU/t; the page follows the code. - Recipes: none in GT5-Unofficial and none in the 2.9.0 dump (no `nanochip` maps). They are registered by `GTNewHorizonsCoreMod-2.9.99.jar` `com/dreammaster/scripts/ScriptNanochipRecipes`. The preset list was extracted from `javap -c` output with a scratch parser (`/tmp/batch-5/parse_nac.py`): calls of `addSimpleProcessingRecipe(in, [fluid], out, eut, duration, map)` and `addAssemblyMatrixRecipe(inputs, fluids, out, duration, eut, matrixTier)`, plus direct `GTRecipeBuilder` chains (duration/eut before `addTo`; output = last `CircuitComponent` referenced before `addTo`). The NAC controller recipe is an assembly line recipe at `TierEU.RECIPE_UIV`, 2400 t (javap offset 1757-1775), so the index tier is UIV. - Java driver `nac` (copy of `:833-837` and module base `:584-617, :492-556`) — every example matches the JS: default Optical Mainframe (perMatrix 34359738368, 2 OC, 273 parallels, 1000 t); Etching UXV 16M A Crystal 3 (629145 EU/t, 64 t, 32768 par); Board 10 % (15728640, 270 t, 1310 par); Wetware Mainframe sets 10 (3 OC, 10 par, 1 ÷2/×4 step, 112 t); Pico Special 3 (2147483647, 250 t, 1048576 par); Optical grades 6+8 level 3 (6165627, 147 t, 3343 par); Part Processor 33 % over 2 + 7 (22677428224 / 13154871003, 428218 par). - Primitive calibration rate is an expected value derived by hand from `MTEAssemblyMatrixModule.java:182-203` (10 % runs at 10 t with the same parallel; T2 5 %, T3 10 % doubled output, not for Primed Unattuned Circuitry). ## Unverified - No page was rendered in a real browser; only the repo DOM stub (`tests/lib/dom-stub.mjs`) was used. - NAC: the int saturation of `(int) recipeEUT` for Pico/Special and the Special EU factor follow the source; not checked in game. Preset names of direct-builder recipes (board processor, some etching, part processor, encasement, wire tracer entries) come from a heuristic (last `CircuitComponent` referenced before `addTo`). Output CC quantities per recipe were not decoded; the page assumes 1 per recipe and has an input for it. Recipe item and fluid inputs were not decoded. The NAC controller recipe was identified by the `Machine_Multi_NanochipAssemblyComplex` reference next to the `RECIPE_UIV` call. XOR (failure) outputs are not modelled. - HILE chain: the Industrial Mixing Machine tooltip says ×(pipe tier + 1), the code gives ×(pipe tier + 2); the page follows the code (carried over from `NOTES-hile-pcb.md`). Whether legacy GT++ mixers survive in 2.9.0 worlds was not checked. - PCB: no per-board presets, because the dump carries no tier, nanite or Bio metadata; only the default recipe was matched against `PCBFactoryRecipes.java` by hand. - AAL: mixed hatch tiers are not modelled (the page takes one tier and the total amps; in game the lowest voltage counts). - CAL: the 2.9.0 bus-order rule is shown as a warning, not modelled. - Inherited: JS vs Java `Math.log` may differ by 1 ulp in `⌈log(d) / log(k)⌉` (sub-tick multipliers); not compared on this JVM beyond the foundation fixtures. ## Verification Independent pass after merging `main` (no conflicts; batch 5 has no shared-file edits). Every controller and the base-class paths it uses were re-read in the 2.9.0 source. Reference values come from scratch Java drivers under `/tmp/batch-5/verify/` (not committed), compiled against the unmodified 2.9.0 `OverclockCalculator.java` and `tools/java-ref/GTUtilityStub.java`: `VAal.java` (copy of `MTEAdvAssLine.java:760-843`), a `RefMain` copy with a separate float `ParallelHelper` EU modifier and `setNoOverclock` (PCB), `VNac.java` (copy of `MTENanochipAssemblyComplex.java:833-837` and `MTENanochipAssemblyModuleBase.java:584-617, :543-556`), plus `tools/java-ref/run.sh "" case` for CAL, CoAL, HILE and the mixer. Each new example below was computed by the driver first and then compared with the page. ### Mechanics checked against the source - AAL: lowest-hatch voltage and Σ V×A supply (`MTEAdvAssLine.java:520-525`), voltage/power checks (`:761-770`), per-slice budget, regular OC cap `getTier(V) − getTier(EU/t)`, laser OC at amperage 1, duration supplier `mDuration / slices`, sub-tick multiplier before `calculate()`, batch on sets ÷ slices, batch multiplier and `mMaxProgresstime` (`:775-843`), power `working × baseEUt` (`:642`). All match. - CAL: one regular hatch → 1 A at hatch V (`MTEMultiBlockBase.java:1171-1176`), perfect OC, CA-mode `mEUt > V / 4` check (`MTECircuitAssemblyLine.java:357-359`), CAL bus-order rule (`:361-381`, warning only). All match. - CoAL: tier gate `mSpecialValue > casingTier + 1`, speed `2^−(casingTier + 1 − special)`, `getMaxInputEu()` at 1 A with unlimited tier skips (`MTEComponentAssemblyLine.java:287-313`). Recipe groups re-counted from the 2.9.0 dump subset (142 recipes, same count as a `grep` of the full dump): presets match. - HILE: `(int) cbrt(maxAmperesOut)`, `laserTier < UXV && mEUt > V[laserTier + 1]`, `setMaxOverclocks(mTier + 1 − getTier(EU/t))`, ×1/3.5 speed, ×0.8 EU (`MTEIndustrialLaserEngraver.java:72-74, :130, :322-368`); one `MultiAmpEnergy` hatch only with a UEV+ source (`:293-305`, `addMultiAmpEnergyInputToMachineList` accepts only `getHatchType() == 1`, so no laser targets); glass ≥ source tier (`:310-312`). Laser source list re-extracted from `tectech/loader/thing/MachineLoader.java:1162-1312` (45 normal sources + the legendary one). Mixer: speed `1 / (1 + (meta + 2))`, `8 × getTier(Σ V)` parallels (`MTEIndustrialMixer.java:217-228`, `GTStructureUtility.java:983-987`); legacy GT++ mixer `1/3.5`, regular hatches only. DTR chain recipes re-read (`MixerRecipes.java:1678-1730`, `LaserEngraverRecipes.java:55-62`). All match. - PCB Factory: nanite parallels, √structures with float helper modifier and double calculator discount, `setNoOverclock(!isOC())`, T1/T2 tower OC factor, `(100f / trace)²` duration in float, chance multiplier `(int)(10000 × r)` as expected value (`MTEPCBFactory.java:383-489, :653`, `ParallelHelper.java:552-570`), trace 50–200 (`MTEPCBFactoryGui.java:30-35`), coolant 10 L/s (`:109, :494-521`). All match. - NAC: power split in float, Splitters skipped (`MTENanochipAssemblyComplex.java:796-858`), hatch tier = `getInputTier()` of the single hatch (`:214-225`), transform order and float/double widening, ÷2/×2 loop with `getOCFactorReduction() = 2` (no module overrides it), `ParallelHelper` with `Integer.MAX_VALUE` max parallel, second ÷2/×4 loop, all module overrides (grep of the 11 module classes), calibration chaining (`CircuitCalibration.java:65-75`: tier 3 applies tier 2 and tier 1), calibration duration only on matrix recipes (only `addAssemblyMatrixRecipe` sets `CIRCUIT_CALIBRATION_TYPE`, javap). All match. ### Defects found and fixed 1. NAC: the five primitive Assembly Matrix presets (Nand Chip, Microprocessor, Integrated Processor, Nano Processor, Quantum Processor) output 64 / 32 / 16 / 8 / 4 CCs per recipe (the `CircuitComponentStack` overload of `addAssemblyMatrixRecipe` in `ScriptNanochipRecipes`, javap offsets 271-291, 382-398, 489-505, 595-611, 701-716 of `registerAssemblyMatrixRecipes`); the page assumed 1, so throughput and EU per CC were off by those factors. Presets now carry the count; the "Output CCs per recipe" input is only shown for custom recipes. 2. NAC: four presets were named after a by-product (heuristic "last CC before addTo"): Etching Array `CompressionResidue` 400 t is Pico Circuit Rack (+4 Compression Residue), `CollapsingResidue` 260 t is Lost Quantum Circuit Rack (+4 Collapsing Residue), Wire Tracer `EntangledAnnihilationStrands` 200 t is Entangled Suppression Strands (+2 Alienated, +1 Entangled Annihilation), `CosmologicalStrands` 100 t is Microcosmic Strands (+1 Macrocosmic, +1 Cosmological). Renamed; the extra outputs are listed in an info line. All other 105 non-matrix presets and 26 matrix presets match the bytecode (module, EU/t, duration, matrix tier). 3. Coverage gaps against the old pages: AAL and CoAL "Energy cost of speed" charts had lost the per-tier / per-casing series (old pages drew three); restored. CAL had lost the "EU per circuit" tile and the recipe-time series of the second chart; restored. CAL's circuits-per-recipe hint now depends on the mode. ### Examples added (all from the verifier drivers) AAL: MAX 1024 A with sub-tick ×525 and batch ×119; LuV 22 A exact-budget laser step. CAL: Circuit Assembler 7680 EU/t 150 t on UHV (×2). CoAL: UHV recipe on T11 casing / UEV 4 A; MV 960 t on T12 casing / UMV 256 A (×69906). HILE: LuV 1024 A source, power-capped OC; Fluxed Electrum mixer chain on 2× UIV. PCB: trace 75 % with float r²; 2048 nanites on a UEV 4096 A laser (512 parallels). NAC: Crystal Mainframe, casing T10, Crystal level 2, 50 % over 2 matrices; Etching Pico Circuit Rack with an input cap (÷2/×4 step). Updated: NAC primitive expected-rate example (×8 outputs). ### Unverified (verifier) - Index tiers of HILE (`IV`) and NAC (`UIV`): the HILE controller recipe is not in GT5-Unofficial; not checked elsewhere. AAL `LuV` (`ggfab/ComponentRecipeLoader.java:35-37`) and PCB `UV` (`PCBFactoryRecipes.java:56-62`) were checked. - PCB compat mode (old built-in upgrades) counts structures slightly differently (`MTEPCBFactory.java:440-449`: compat OC or a linked tower counts once, compat bio counts, a linked Bio Chamber does not) and its OC does not depend on a working tower; not modelled. A linked but disabled Bio Chamber (counts in √structures, fails bio recipes) has no input. - NAC Board Processor recipes exist twice each (with and without the immersion-fluid metadata key); the page lists one. The numbers are the same. - Item and fluid inputs of NAC recipes were not decoded. - No page was opened in a real browser.