In the first year of the Daye era, at Luoyang, the city gate opened and a small group of men came out.
They wore new clothes and new caps. Their faces were set, as if they wanted to smile and did not dare.
The road on both sides was packed.
People stood on tiptoe and pointed. That one belongs to the Wang family, someone said. That one belongs to the Cui.
Then the voices dropped.
Because some of these men did not belong to anybody.
They had no ancestor with a famous name and no clan register to show at a marriage negotiation. A year earlier they could not have walked through that gate at all.
Now they walked through it.
The man at the front had his cap on crooked.
He did not know.
Nobody beside him dared to tell him.
The Men at the Gate
Daye was the era name of Emperor Yang of Sui. Its first year was 605.
That year the court opened a new examination subject and called it jinshi, the advanced scholar.
It tested policy essays on current government. Those who passed were given office.
In the histories it takes a few lines.
It is also one of the great divides in the Chinese way of choosing officials.
Before it, a man became an official because of who his father was and who spoke for him.
After it, there was a third thing: a written paper.
The change sounds small. It was not. A state that picks its servants by paper is a different kind of state from one that picks them by blood, and everything downstream changes: who learns to read, who marries whom, where money goes, what a village hopes for its cleverest boy.
No High Rank From a Poor House
To see how deep the divide went, look at the wall it broke.
Han dynasty recruitment worked by recommendation. Every year local officials sent the central government names, under headings such as filial and incorrupt, or cultivated talent.
The design was reasonable. The flaw was built in. Whoever recommends has power.
The recommending officials had to live with the great local families. Year after year the names that went up came from the same few houses.
By the Wei and Jin period a new system replaced it, called the nine grade judgement.
The court appointed a judge in each province to grade local talent into nine bands and assign office accordingly.
The intention was to take the power of judgement away from the governor and give it to an officer of the central government.
But who was appointed as judge?
The local great families.
So the criteria shifted, one at a time. Ability went. Character went. Local reputation went. What remained was the rank of a man’s grandfather.
One line in the histories sums it up: no high rank comes from a poor house, no low rank from a powerful clan.
A life was settled on the day it began.
The name you were born with mattered more than the books you read.
The great families kept registers of descent. Every generation recorded its offices, its marriages, its graves. Before a wedding, the two families compared registers to see whether the match was acceptable.
They did not marry the poor. They did not dine with them or ride in the same carriage.
Their sons began lessons at five, had a reputation by fifteen, were graded in the upper bands at twenty five, and held a clean and prestigious office at thirty.
A poor man’s son read the same books and sat the same tests, and in the judge’s column there was always a middle or lower grade.
Even under the Han, a rhyme had gone round about what recommendation really meant: the recommended scholar cannot read, and the recommended filial son has turned his father out to live alone.
It is a cruel little rhyme. It is also an accurate description of what happens when a public duty is handed to private hands.

The Jinshi Degree
The Sui changed the situation.
Three hundred years of division had destroyed a large part of the old aristocracy. The new court had land, soldiers and money of its own. It no longer had to smile at the great houses.
The first Sui emperor abolished the nine grade judgement and pulled the appointment of officials back to the centre.
The second step was examination by subject.
In 598 he ordered officials of the fifth rank and above, and provincial governors, to recommend men under two headings: conduct and diligence, and competence in administration.
Two subjects, two standards. A man could go up for good behaviour or for getting things done.
That was the beginning of selection by category.
His son added another subject: jinshi.
In 603 he issued an edict listing ten categories, among them filial conduct, personal integrity, uprightness under pressure, learning, literary ability, military talent and physical strength.
Ten categories means the court was experimenting.
It was trying to find a method that could actually pick people out.
The word jinshi means a scholar presented to the court. Passing it gave a man the right to hold office.
The exact year is disputed. Some scholars put the first jinshi examination in 605, some in 606, and some argue that the subject only took real shape under the Tang.
The difference does not matter much. The direction is clear. From the Sui onward, office was tied to a paper.
Why does that matter?
Because it changed the question from who may sit the examination to who can pass it.
The first looks at a family. The second looks at a page.
The Sui version was still rough. Few were taken. Procedure was loose. Personal connections, reputation and a patron still counted for a great deal.
It was the Tang that made the machine work.
In the Luocheng Hall
The Tang held its first examinations in 622, five years after the founding of the dynasty.
A Tang notebook records a scene. The emperor Taizong once walked out to the gate and watched the new graduates come through one after another. He is said to have remarked: all the heroes of the realm are now within my draw.
A drawn bow is what the word means. Every able man in the country, he was saying, is inside my range.
Whether he said it in those words cannot be settled. Notebooks of the period like a good story. But it describes the arithmetic of the throne exactly. These men used to be guests of the great houses. Now they were servants of the emperor.
The Tang had dozens of subjects. By the middle of the dynasty two mattered: the classical subject and the jinshi.
There were also two kinds of examination. The regular one was held every year. The special one was called by imperial edict when the throne wanted a particular kind of man.
The regular subjects were also taught in state schools. The imperial college at the capital took the sons of officials. County and prefectural schools took local boys. Schools below, examination above: together they made a ladder.
The classical subject tested memory of the canon. The jinshi tested poetry, prose and policy.
The difficulty was not comparable.
A proverb of the day put it plainly: at thirty a man is old for the classical subject, at fifty he is young for the jinshi.
Thirty or so men passed the jinshi in a good year, sometimes fewer.
Those thirty supplied most of the chancellors.
Passing had a public face as well. In the Tang, the new graduates paraded through the city, feasted beside the Qujiang pool, and wrote their names on the wall of the Wild Goose Pagoda. Crowds came out to watch.
It was a spectacle because it was rare.
For a man from a modest family, the day of the results was the one day in his life when the whole capital looked at him.
The Tang had one more habit that looks strange now. Candidates arrived in the capital with copies of their best poems and letters and sent them round to senior officials and famous writers. One delivery was called a presentation, a second a warming.
A man who liked what he read would speak for the candidate before the examination.
It was called public recommendation.
Public recommendation and a back door are separated by one sheet of paper.
So the Tang examination was both a test and a favour. Half of it was the paper. Half was whether anyone of weight had read your poems.
Du Fu sat the examination more than once and never passed. Li Bai never sat it and went by recommendation. Han Yu passed, on his fourth attempt.
The next push came from a woman.
In 690 the empress Wu Zetian questioned candidates in person in the Luocheng Hall at Luoyang. The ruler set the question and the candidate answered to her face. Later ages treated this as the beginning of the palace examination.
Twelve years later she opened a military examination, testing horse archery, foot archery, shooting at a mark, carrying weights, bearing and speech.
A scholar and a soldier now each had a road that did not begin with a family name.
Why did she bother?
Because she needed men.
She meant to be emperor. The old clans of the north west did not accept it, the families of the east did not accept it, and the court was full of other people’s clients.
Men taken by examination were her clients.
So she widened the quota, added subjects, set the questions herself and read the papers herself.
Not a few of them ended up as chancellors. Their surnames and their villages did not matter.
What mattered was that their offices came from an examination.
By the Song, the men who ran the state were almost all examination graduates. Fan Zhongyan, Ouyang Xiu, Wang Anshi, Su Shi: every one of them came up that road.
A government staffed by people who had read the same books and sat the same papers acquired a shared language.
It also acquired a shared blind spot.
Everyone in the room had been good at the same thing.
The Weight of a Sheet of Paper
The Song tightened everything.
They sealed the candidate’s name on the paper.
They had the papers copied out by clerks so that the examiner could not recognise a hand.
They locked the examiners inside the building from the moment the questions were set until the results were posted.
With those three in place, an examination became an examination.
The Song also changed something more important than procedure. They took far more people.
The Tang passed thirty in a good year. The Song passed three or four hundred. A man who passed had a salary for life, and his descendants inherited privileges.
For the first time, study became a trade that could feed a household.
Village schools multiplied. Printing shops multiplied. So did the number of men who failed.
Under the Ming and Qing the system reached its height and its stiffness. The eight legged essay fixed the form. Questions came only from the Four Books and the Five Classics. A candidate’s opinion was not allowed outside the line.
The examination cells were three feet wide and four feet deep. A man sat down and could not stand up. One session lasted three days, and he ate and slept in the cell.
The top graduate in the palace examination was called the zhuangyuan. A man who came first in all three stages was said to have hit three in a row, and in a thousand years only a handful managed it.
Some men sat until their hair went white.
Some died as village students and never rose beyond the first stage.
The examinations were abolished in 1905.
From 605 to that year is thirteen hundred years.
In thirteen centuries the system produced more than a hundred thousand jinshi and several million lower degree holders.
Ten thousand men came out of one gate.
Outside the gate stood tens of millions who did not.
It was not a perfect machine. It could not measure a whole person, and it could not measure what an age actually needed. In the end it stiffened into something close to absurd, and there is no reason to defend that.
But it did something rare in Chinese history. It moved the qualification for office from who your father was to how well you wrote.
In a society that had run on lineage for centuries, that was a change at the root.
It also travelled.
Korea, Vietnam and Japan all copied parts of it. Vietnam held its last examination in 1919, fourteen years after China stopped.
Further west, Jesuit missionaries of the sixteenth and seventeenth centuries described the system in books sent home. Voltaire read them and reported that China had no hereditary nobility, only examinations.
In the nineteenth century the British began to reform their own civil service. In 1854 Northcote and Trevelyan produced their report recommending entry by open competitive examination. In 1870 the system was formally adopted.
That was twelve hundred and sixty five years after the first jinshi examination.
The British scheme was not a copy. But the report said one thing very plainly: such a method had been in use in China for many centuries.
A sheet of paper, a brush, and a name sealed at the top of the page.
It could not stop every connection and it could not stop luck.
But it gave a boy reading by an oil lamp in a village a thought that no one had been able to give him before: next year, perhaps, it could be me.