They were sleeping under the huge old Zhengyangmen gatem filthy children, red-eyed women, sullen men - a new, usually unseen social force marring Peking's antiseptic streets like a boil about to burst.

"I've been here three weeks, and I'm not leaving until the government settles my case," said Zhang Xingchu. He had ridden the rails from Jiangxi, 750 miles away, to get an old black mark wiped off his work record. His sleeping mat had roaches in it. His wife and baby looked dirty and terrified.

Hundreds of other vagrants - an unprecedented phenomenon here - are sleeping inside the Supreme Court building, the post office and sometimes even along famous Avenue of Eternal Peace.

"Three years ago those people would have been forcibly removed within minutes," said one longtime Peking resident. But a gentler, more uncertain government is in power now. The untouchable vagrants reveal a nation arguing with itself whether aching problems of poverty and injustice can be suppressed.

The government's restraint is all the more striking in light of the emotional and political force such a vivid breakdown in the socialist system can have.

The vagrants are allowed to nest in places not usually visited by foreigners, but Chinese see them. In Shanghai, a student essay expressing dismay at the sight of a beggar caused a sensation with much press comment and special meetings called to discuss the matter.

Last last year when people from outlying areas began to stream into Peking with injury claims, poltical difficulties and job demands, some observers estimated that tens of thousands of people were sleeping rough somewhere in the city.

The people at Zhengyangmen Gate said there was a cleanup before this year's May Day festival, with many people sent home. But they guessed several thousand like them still remained in the capital.

"It's a problem with the local officials," said Zhu Hezhong, a Foreign Ministry official. "There are still some bad elements in the provinces, and the people feel they have to come to Peking to solve their problems. And of course some of these people are in the wrong, but they come anyway."

No uniformed police were in sight at 7 a.m. as the group of about 20 people under the gate woke up, but Zhang and others looked uncomfortable when I began to ask questions. They might find room in some hostels in town but they had no money. Some of their clothes were almost rags. The baby, and a cheerful little boy of about 9, were very thin. At a subway station not far from the gate, other young vagrants were already trying to earn enough for the small buns or noodles that stave off hunger.

Three young men, strategically placed at different entrances, asked passers-by if they wished to have their name carved into the side of their plastic fountain pens. The price was six cents. One man carved my name into my comb, a neat, fast job with a tiny chisel, but he refused to take any money.

"It's for friendship, Sino-American friendship," he said. The old Chinese pride in dealing with foreigners is still strong.

Other large cities have encountered the influx of distressed rural people, too. In Shanghai, China's largest and perhaps most modern city, a good student at the Jingye Middle School completed an assigned essay after encountering beggars. This led to a sudden controversy.

"The beggar looked like a rural woman," the essay said, describing the scene outside the Great Brightness cinema. The essay continued:

"She sat on the ground with a baby of less than one year in her arms. 'Please take pity on me! Do me a favor please!' she begged the crowd in a hoarse voice. Her body trembled under thin clothes . . .. Some people threw pennies, or several coins or some food.

". . . I didn't want to watch any longer . . . I saw the theater's neon sign but . . . the Great Brightness no longer seemed bright."

The teacher gave the essay an "F" for failing to put the incident into the context of lingering problems from past political turmoil and the Communist Party's efforts to improve things. Students and others objected, and although the press endorsed the teacher's thinking, it applauded when the student was allowed to rewrite the essay.

Residents here who have heard some vagrants' stories say some are able to raise enough money from friends for the train trip to Peking. Others sometimes use the trick of getting on the train and riding until the conductor finds them and ejects them, then getting on the next train.

Vagrants often trace their problems back to the Cultural Revolution of the late 1960s, when many people with steady jobs were criticized for not adopting radical slogans fast enough or for just being in the way of rampaging Red Guards.

In nearly every locality officials remain who endorsed those earlier decisions and object to having them overturned. Asked what specifically had brought him to Zhengyangmen Gate, Zhang thought for a moment, then heard a footstep and looked up. A plump woman with the look of a local neighborhood official walked under the gate, looking at me.

The people all begain to stand up and I left. Two young men still slept side by side on the hard concrete, thin and exhausted even as the sun began to shine inside the old gate where petitioners once walked to see the emperor.