GDANSK, POLAND, AUG. 31 -- The race for the presidency of post-Communist Poland began here today in the same shipyard hall where Solidarity, the Communist world's first free labor union, was born.

Ten years ago, Lech Walesa and Tadeusz Mazowiecki were close friends working together to orchestrate a shipyard strike that pressured the Communist leadership into signing an unprecedented document legalizing Solidarity. But today the two men met as bitter political rivals celebrating their accomplishments of a decade ago.

"The revolution is not yet over," declared Walesa, the populist chairman of Solidarity, who has been complaining for months about "eggheads" dominating the government. "We must create mechanisms to enable the masses to enter the political process."

"I think we have traveled a terrific distance as a nation recently," replied Mazowiecki, the former adviser to Walesa and now his bitter rival as the prime minister presiding over far-reaching and often painful free-market reforms. "We must have consistency and stability."

A key adviser to Walesa, Jaroslaw Kaczinski, characterized their speeches today as the "start" of the presidential campaign, in which the two are widely expected to compete against each other.

Walesa has chosen to challenge the prime minister -- who, in effect, was Walesa's own appointee -- on the grounds that Mazowiecki is too cautious, too soft on former Communists and too oblivious of the man on the factory floor.

"It is not acceleration {of reform} that is dangerous, but continuation of a policy of slow changes which must lead to a social explosion," Walesa said here this week.

Although Walesa and Mazowiecki sat side by side today for the anniversary celebration, their speeches spelled out the philosophical and political differences that have eroded their friendship while causing a breakdown in Solidarity's greatest political asset -- its capacity to embrace both the working and educated classes.

Mazowiecki, unlike Walesa, has not publicly declared his intention to run for president. But he has refused to rule himself out of the race and a number of his supporters have said he is likely to run.

The prime minister's call today for "reasonable arguments" runs against the flood of name-calling and angry accusations that have been exchanged in recent months between the supporters of Walesa and Mazowiecki.

Mazowiecki's supporters have accused Walesa of acting like a demagogue, of empty sloganeering without specific programs and of promising workers more than the Polish economy can afford to pay them.

Most explosively, Mazowiecki's supporters accuse the Nobel-Prize-winning Walesa of using loaded language and sending political signals designed to tap into antisemitic and ultra-nationalist elements in Polish society.

Long a darling of Western journalists in Eastern Europe, Walesa has been stung by increasingly critical international coverage of his campaign and of his character.

In an apparent attempt to put the issue of antisemitism behind him, Walesa said today that Solidarity is a movement "without even the remnants of racism, nationalism or antisemitism."

In a significant signal that Poland has moved beyond anti-Communist sentiment as the primary motivation for political activity, two new political parties have formed this summer around Walesa and Mazowiecki.

The Center Alliance, a right-of-center group, was formed on the precepts that all former Communists still in the government should be fired and that Walesa should be elected president as soon as possible.

This week the Center Alliance began circulating a petition calling for the immediate resignation of the current president, Gen. Wojciech Jaruzelski, whom parliament elected to a six-year term last summer as part of a power-sharing deal that Solidarity negotiated.

A consensus has been building among the supporters of both Mazowiecki and Walesa that Jaruzelski, who is widely hated in Poland as the Communist who imposed martial law in 1981, must step down this fall. Jaruzelski himself has hinted that he will retire when parliament passes a law authorizing a presidential election.

Jaruzelski has chosen to exercise very little power as president. Although the post is primarily ceremonial, the president nominates the prime minister. It is widely expected that, if Walesa were to become president, he would play a much more active role in managing the government.

The party that has formed to support Mazowiecki and his policies -- called the Citizens' Movement for Democratic Action -- is led by many of the best-known names from Solidarity's past.

It calls itself a "west of center" party, meaning that it supports close ties with Western Europe and backs the free-market policies of Mazowiecki. Its leaders say there is no need for a witch hunt to sweep all former Communists out of the government.

But it, too, has called for quick presidential elections.

The presidential campaign that began here today will be conducted against a backdrop of dizzying change in the country's economic life. The pain of that reform -- particularly as it hits factory workers and farmers -- appears to be the main source of Walesa's political strength.

Unemployment, which did not officially exist nine months ago, is now running at about 5.7 percent, with 760,000 jobless. That figure is predicted to rise to 1.3 million by the end of the year. The government estimates that Poles have lost 28 percent of their buying power as subsidies on food and fuel have disappeared and wage increases have been held down.

Mazowiecki's government can point to a number of achievements from the reforms. Hyper-inflation has stopped. Shops are full of goods. Private sector employment is surging. Exports are up and hard-currency reserves are growing.

These achievements, however, appear to mean little to factory workers and farmers, for whom low wages and depressed prices have been the most visible fruit of Solidarity's victory over communism.

According to opinion polls, Walesa is the only political leader in Poland who enjoys the trust of these disaffected working-class people. Earlier this year he single-handedly settled a rail strike that threatened to paralyze the country. In his comments on strikes and strike threats, Walesa has been careful to say that he understands and sympathizes with the workers.

This month, a network of workers in major factories was formed to back Walesa and the Center Alliance. The threat of strikes -- which only Walesa appears to have the political muscle to control -- is a major potential weapon against the Mazowiecki government.

Mazowiecki, with considerably less success, has attempted to convince workers that wage increases are only possible when accompanied by increases in productivity. Not surprisingly, his strength in opinion polls is with educated Poles living in urban areas.

The polls show that, while Poles trust Mazowiecki and consider him a more responsible leader, they view Walesa as more courageous and determined. In overall popularity, Mazowiecki has led Walesa by 15 to 20 points throughout most of the year.

The Center Alliance's chairman, Walesa adviser Kaczinski, said today that the earliest realistic date for the election is in November.