119: 11th Rnel, Proven Productivity
July 2, 2022, 06:01.
Jiang Lin put down the box in his hands, washed up, and changed his clothes.
After eating breakfast, he leisurely returned to the bedroom, took out a mobile hard drive that had accumulated forty years of history from the box, and sat down at the desk.
He turned on the workstation, inserted the hard drive, and opened a directory.
[MPS_Kernel_v02_Compressed]
In the Ninth Wasteland reincarnation that had just ended, he brought back three blueprints.
G-01 was the most intuitive, and PFR/Marton was the heaviest, but in the Real World, the only one that could be first deconstructed, digested, and rapidly converted into resources was the second blueprint.
MPS-Kernel.
Jiang Lin now needed funds to support long-term experiments, servers, sensors, machining, patents, shell companies, personnel employment, and even larger-scale computing power systems in the future.
On the desktop, the main directory of the quantitative system was already open.
[MPS_TimeLine]
[MPS_Kernel]
[ctp_adapter]
[tick_store]
[backtest_engine]
[risk_guard]
These neat directories had already taken root and sprouted in the hard drive after the seventh return.
By the eighth return, they had become a crude and thin small-scale commodity futures live trading system.
Rapid access to market data.
Lossless dumping of Tick data to disk.
Smooth processing without any stuttering when the main contract rolled over months.
Instant extraction of order book liquidity status.
Frenetic updating of low-latency feature matrices.
The birth, death, and judgment of strategy signals within milliseconds.
The ruthless circuit breaker of the risk control system like a guillotine.
Precise recording of order return instructions.
...
It was these logical patches piled up by zeros and ones that propped up his first-stage return curve.
Jiang Lin brought up the quantitative account's most recent statement, with the timestamp lingering on the last second after the market closed yesterday afternoon.
[Current Equity: 352,481.79]
Starting from the 310,842.63 invested in the first week to the current number.
The funds in the account rolled steadily upward along that long-verified curve for a certain distance.
This curve was fitted very cleanly.
The most terrifying slippage in live trading, the execution delay brought by network congestion, the instantaneous exhaustion of order book liquidity under extreme market conditions, and those structural distortions infinitely magnified or masked in the backtesting environment did not appear in a way that exceeded the model's boundaries in front of this system.
This showed that the general direction had no deviation at all.
The market was like a massive and stupid machine, spitting out chips bit by bit according to the rhythm he preset.
But looking back after the ninth Wasteland journey ended, this system was still too slow.
The slowness here did not just refer to the Physics network delay of sending orders to the exchange's matching host.
The background replay testing of hundreds of millions of historical Ticks was slow.
The slicing and updating of high-dimensional feature matrices in memory was slow.
The rank sorting of cross-sectional data was slow.
The median calculation in the rolling window was slow.
Even the sniffing and detection of tiny abnormal pulses in the order book were still slow.
These reefs usually hidden beneath the water's surface were not conspicuous during single-variety, small-scale trading.
But once the huge backtesting combination of multi-variety, multi-cycle, multi-slippage assumptions, and multi-parameter intervals began to expand, as long as the boundary of the strategy pool extended outward just a little bit, the entire system would immediately be dragged down by those seemingly insignificant basic kernels.
Slowness, in this field, was the original sin.
Sorting.
Selection.
Rank.
Top-k.
Rolling median.
Quantile truncation.
Outlier elimination.
These things, taken out individually and thrown into an undergraduate computer science classroom, were not even qualified to be a final major assignment, completely inconspicuous.
However, when they were thrown into the microsecond-level high-frequency data pipeline, under the frantic scouring of massive information, they were like rough gravel, densely carpeting the floor of the entire data channel.
Every grain of gravel was indeed not high.
But when this machine ran wildly day and night, running for a long time, the hardest soles of the system would be worn through silently.
Jiang Lin opened the performance profiling report.
This was the old version record he left behind before entering the ninth Wasteland.
The hottest functions consuming CPU clock cycles were mercilessly highlighted in dazzling red, like bleeding wounds.
rank5_inline
median7_window
top3_of_8
winsor_clip
rolling_quantile_update
cross_section_rank
tick_merge_dedup
These names were almost naturally connected with sort5, rank5, median7, and top3-of-8 discussed in Chen Qiming's office.
In that office presentation, what MPS-Kernel proved was one thing.
Underlying components like microkernels could be searched, rigorously verified, and quantitatively evaluated through specific algorithms.
But in the Ninth Wasteland reincarnation that had just ended, version v0.2 of MPS-Kernel solved another momentous matter of subversive significance on the edge of life and death.
It should not only prove its theoretical feasibility on small toys in academia; it must and can only become an industrial toolchain capable of continuously producing high-performance kernels that can be mathematically proven.
Now, Jiang Lin was not prepared to show this fully evolved system to anyone.
At least before it grew into a towering tree, he would never show its complete form.
MPS-Kernel was by no means the auxiliary tool code attached to some top-level academic paper used to pad word count and gain citations.
Much less was it an exquisite toy placed in a bright presentation hall for academic professors to marvel at and discuss with each other.
It was definitely not the kind of public code hung on GitHub, casually open-sourced, with authorization agreements in name only, allowing others to transfer and modify.
It had taken deep root and entered the funding system that Jiang Lin himself used to draw nourishment from the Real World.
And in the near future, this kernel would omnipresently penetrate into larger-scale parallel computing power systems, complex underlying compilation frameworks, and massive physical engineering platforms.
This kind of thing that could determine life, death, and destiny could only be held firmly in one's own hands.
The complete searcher would not be leaked.
The outside world could only see the proven portable microkernel package, verification fixtures, benchmark logs, and the trimmed presentation environment.
The terminal interface was awakened.
The first microkernel package tempered by the Wasteland was dragged by Jiang Lin into the current quantitative engineering environment.
[Kernel_ID: rank5_i32_v02]
[Abstract_Semantics: Five-input integer rank localization]
[Tie_Policy: stable_index_order]
[Sentinel_Policy: missing_as_lowest]
[Overflow_Mode: explicit_saturating_i32]
[Source_IR_Proof: pass]
[Binary_Equivalence: pass]
[ISA: x86-64]
[Microarchitecture_Assumption: Machine-A-like]
[Robustness_Score: 0.82]
[Fallback_Path: baseline_rank5]
It was not the one in the search space whose instruction sequence was the most showy and breathtaking.
Nor was it the fastest one in a single benchmark run score test detached from the actual environment.
The reason it was chosen by Jiang Lin was because under the extremely harsh computing power-depleted environment of the Wasteland, it had stubbornly withstood countless fragmented cache states, extremely unstable batch data lengths, and fluctuating fixed-frequency conditions.
After these countless torments, its robustness score ranked first, steady as Mount Tai.
Jiang Lin did not arrogantly delete the bloated but stable old functions in the original system directly.
He cautiously retained the fallback safety rollback path.
Any microkernel automatically generated by MPS-Kernel must, without exception, cross three gates of testing before being officially allowed to enter that hot path involving real money.
The first gate, historical limit replay.
He selected the tick data of the main contracts with the most violent market fluctuations and the largest trading volume over the past three months.
Tens of millions to hundreds of millions of tick slices were repackaged, poured back into several high-frequency feature pipelines, and forced the system to re-run.
The originally quiet CPU fan began to emit a dull roar,
its speed was instantly boosted, and heat waves were expelled into the air through the cooling vents.
On the screen, rows of progress bars scrolled frantically like a cascading waterfall.
The logs of the old pipeline were pulled up for comparison.
[ Replay: 2022-04-01 — 2022-06-30 ]
[ Elapsed: 42m17s ]
The results of the new pipeline popped up right after.
[ Replay: 2022-04-01 — 2022-06-30 ]
[ Elapsed: 28m49s ]
The reduction in time was visible to the naked eye, and the first improvement effect was very obvious.
But Jiang Lin's expression did not change in the slightest.
A single reduction in time was statistically meaningless; it could be a coincidence under a specific environment.
He began to mercilessly ravage this system.
He completely disrupted the order of massive historical replay data.
He forced the switching of CPU cache states at different levels.
He frequently changed the batch size of memory read and write operations.
He frantically stacked and trimmed different feature combinations.
He even forcefully stuffed those unpopular and extremely illiquid varieties into the test pool.
After twenty consecutive groups of high-intensity, destructive tests finished running,
when the roar of the fans finally subsided, the final results stabilized on the screen.
The overall total time consumption of the hot path dropped solidly by about 27%.
And on the p99 long-tail latency indicator, which is the most critical in high-frequency trading, the reduction reached a staggering 31%.
Among them, the time consumption reduction of the rank-based sorting kernel was the most exaggerated, with nearly half of the redundancy shaved off.
Considering that more complex components such as the rolling median and top-k had not yet been completely replaced, the performance squeezing space of the entire system remained immensely huge.
The second gate: the boundary input mincer.
The real market was filled with dirty noise.
Continuous, meaningless repeated quotes.
Near the price limit boards, bizarrely bouncing prices generated by the life-and-death struggle between the long and short sides.
Empty windows lasting for several seconds or even tens of seconds without a single transaction.
Missing sentinel flags in exchange data packets caused by network jitter.
Extreme order book thickness with a huge disparity between bid and ask orders.
And those dangerous numbers hovering on the verge of variable overflow during underlying integer scaling calculations.
The system had previously spent a lot of energy cleaning and testing the poison in these data.
But now, since a brand-new foreign species like MPS-Kernel had moved into the core layer, all trust must be reset to zero, and everything must be torn down and retested.
In terms of mathematical logic, the proof chain could only prove that the semantics of the kernel itself were correct.
But within the behemoth of a quantitative system, the periphery was still wrapped in tedious data cleaning modules, sentinel exception handling mechanisms, floating-point and integer scaling conversions, multi-dimensional field alignment and splicing, and cache reuse pools.
If any layer in these peripheral links produced a slight misalignment, no matter how precise and error-free the core kernel calculations were, the final output result would still be a disaster.
Time ticked away, and the air in the room seemed to become warm due to the high-load operation of the processor.
An hour and a half later, all harsh boundary tests lit up green and passed smoothly.
The third gate: online shadow computing.
This was the step closest to actual combat.
The loading of the new kernel would not directly seize control of the live-trading order placement interface.
Like a silent ghost, it lurked in the independent memory space allocated in the background.
It synchronously received the exact same tick data as the old system, generated the same set of huge feature matrices, and then compared every tiny result it calculated with the running results of the old system item by item or even bit by bit.
Jiang Lin set the fault-tolerance threshold very harshly.
As long as even a single numerical difference that should not exist appeared among hundreds of millions of calculations, the new kernel would be immediately discarded, and the system would automatically fall back to the conservative but safe baseline.
Nine o'clock in the morning.
The domestic commodity futures market opened on time.
Like a huge sluice gate being pulled open instantly, an invisible torrent of data roared out.
Jiang Lin did not blindly increase positions due to the system upgrade, nor did he aggressively expand trading varieties.
Nor did he increase capital leverage in pursuit of windfall profits.
He just quietly stared at the screen, letting the new kernel fully enter shadow mode.
The numbers in the order book began to jump frantically.
The red and green bid and ask prices flickered like breathing.
Tick data poured violently into the system's memory along the network interface like a high-pressure water column.
The new pipeline followed silently behind the slightly clumsy body of the old version.
It lurked, calculated, compared, and wrote every processing log into the solid-state drive.
Ten minutes passed, and the market experienced a wave of fierce opening battle.
Thirty minutes passed, and the market entered a volatile consolidation period.
An hour passed, and funds began to flow into different sectors.
No discrepancies, no alarms, no lines of red error text popped up.
Before the midday close, the system automatically generated the first half-day shadow report.
[ Shadow Mismatch: 0 ]
(Shadow Mismatch: 0)
[ Feature Latency p50: Down 18.4% ]
[ Feature Latency p99: Down 29.7% ]
[ Replay Buffer Pressure: Down 22.1% ]
[ Risk Update Interval: Synchronously Shortened ]
Jiang Lin carefully examined these lines of beating numbers, and after confirming that all indicators were stable, he let out a long sigh of relief.
Before the afternoon market opened, he officially pushed the first batch of MPS kernels into the live-trading hot path, depriving the old version functions of their execution rights.
At 1:30 PM, the market opened again.
For the first time, the system ran on the blood of the new kernel.
The surface changes were very small.
There was no earth-shattering profit curve shooting straight into the sky like in Hollywood movies.
Nor did a red line representing capital equity suddenly rise from the ground.
But Jiang Lin knew deeply that a quantitative trading system that could truly survive for a long time never relied on capturing a magical prediction function to make money.
It relied on constantly reducing the losses brought by the friction between the system and the market across thousands of tiny engineering details.
Feature calculations updated those few hundred microseconds faster.
The response for triggering sudden backtest iterations during the trading session was a bit faster.
The synchronization density between the risk control engine and capital bills was slightly higher.
The expansion speed of the dynamic strategy pool when capturing correlations was slightly faster.
The identification of microscopic liquidity anomalies in the order book was slightly earlier than most peers.
All these bits and pieces accumulated over the dimension of time, and the capacity that the system could ingest and process would unknowingly become huge.
Capacity was the true soil that could steadily generate money.
At 3:00 PM, the last execution report was written to the log, and the whole day's trading officially closed.
Jiang Lin first clicked open the shadow ledger next to it.
The old system was still running in the background in shadow mode.
It did not place orders, but only recorded the judgments it would have made based on the same tick stream, the same position limits, and the same risk control rules.
The two ledgers were unfolded side by side.
[ Baseline _ Shadow _ PnL: +9,863.74 ]
[ MPS _ HotPath _ PnL: +18,742.91 ]
[ Incremental _ PnL: +8,879.17 ]
[ Max _ Intraday _ Drawdown: 1.21% ]
[ Missed _ Window _ Reduction: 37.4% ]
[ Forced _ Risk _ Skip: Reduced by 2 times ]
Looking at the third line of numbers, Jiang Lin finally confirmed that this was not a red envelope accidentally sent by the market.
The same market, the same capital, the same strategy pool, the same risk upper limit.
The old system could also make money.
But the new system missed two fewer windows, triggered two fewer unnecessary conservative skips, and hesitated a few hundred microseconds less before the order book collapsed instantly.
Converted into the counterfactual difference of the day, those few hundred microseconds amounted to 8,879.17 yuan.
🔊 Text To Speech
Listen while reading