Loyal Osterlund has been here all day, sitting in a small, sparse courtroom in the U.S. Courthouse with a firm set to his jaw and a glint of determination in his eyes.

The Internal Revenue Service contends that Osterlund's small truck-manufacturing plant in Harrisburg, Pa., owes the government more than $170,000 in taxes from 1979 to 1981. Osterlund contends just as strongly that the IRS is wrong.

So, like thousands of other Americans every year, Loyal Osterlund has taken his case before that arbiter of deductions, that Solomon of shelters: the U.S. Tax Court.

"My attorneys wanted to settle," Osterlund said. "They thought it would just drag on, we'd get charged interest. But I'm not concerned about that. I really feel, sincerely, that the IRS is wrong."

Osterlund has a lot of company.

In the midst of a surging national debate over the venerable institution of taxes, business is booming at U.S. Tax Court. Petitions from taxpayers who think they've been wronged by the IRS have risen from 17,000 to 42,000 a year since 1979, and the caseload continues to grow.

There are reasons aplenty for the court's popularity, not the least of which is that it is the only place where the taxpayer can argue first and, if he loses, pay later. (The U.S. Claims Court also hears tax cases, but petitioners there have to ante up first and then try to persuade the court that a refund is in order.)

But Howard A. Dawson Jr., chief judge of the Tax Court, thinks that there are other reasons for the sharp rise in tax cases, among them an increase in IRS audits and taxpayers' rising frustration with the mind-boggling complexity of the tax code.

"In the last eight or 10 years, there has been a proliferation of tax laws," Dawson said. "There are 3,000 pages in the Internal Revenue Code. So the complexity builds, and there is a strong feeling among most people that there ought to be some simplification. They get so exasperated."

The exasperation is having a powerful impact in Washington now, as lawmakers duel with accountants and shelter promoters wrestle with flat-tax adherents over whether and how much to streamline the nation's tax laws.

But, in all likelihood, Congress won't know what it has done to the tax code until the petitions start popping up in Tax Court.

"We operate four or five years behind," Dawson said. "But we're going to get those cases sooner or later."

The court is at the trailing edge of the law, the final redoubt of the tax technician. Like black-robed engineers, its judges measure loopholes with keen precision and fill the spaces between the lines of the Internal Revenue Code with a filigree of judicial interpretation.

"It's a game, and it takes awhile for a loophole to become obvious," said Judge Samuel B. Sterrett, a 16-year veteran of the Tax Court who will become chief judge in June.

The court is housed on Washington's Judiciary Square, in a starkly modern monolith that is as gray and inscrutable as the Internal Revenue Code. But its 19 judges take to the road to hear taxpayers plead their cases against the IRS, riding an 80-city circuit that keeps them out of town about three months a year.

Sterrett is presiding in Philadelphia this day, his piercing blue eyes fixed at the moment on an IRS lawyer who seems to have lost his place in a jumble of plat maps and appraisals. Osterlund v. Commissioner of the Internal Revenue Service -- a relatively straightforward dispute, as tax cases go -- is taking longer than the time alloted for it on Sterrett's crowded calendar, and the judge is rapidly losing patience with the government's hesitant cross-examination.

"You gotta put the ball in play in 25 seconds," he admonishes.

Osterlund involves a question of property value, in this case a business property the IRS contends was overvalued for rental-deduction purposes. But over the years, the Tax Court has been the stage for far more exotic squabbles, of the sort that don't often get covered in testimony before tax-writing committees.

How much are a deceased sculptor's unsold statues worth? Should a marijuana smuggler get a deduction for "ordinary and necessary" business expenses when the government confiscates his wares? Must a self-described "kept woman" declare as income the money she receives from her married lover?

"I tried a whorehouse case once -- the Mustang Ranch in Nevada," Sterrett recalls with a smile.

The Tax Court has played host to the powerful and the controversial, from David Rockefeller to Willie Nelson, not to mention G. Gordon Liddy, Bobby Baker, Tongsun Park and a rogue's gallery of reputed organized-crime figures who found that infamy may be fleeting but the tax man is tenacious.

But some of the court's most celebrated cases involve ordinary taxpayers -- like the Maryland couple whose annual divorce for tax purposes eventually brought them into Tax Court. They lost, but that case and others like it garnered enough publicity to persuade Congress to ease the "marriage penalty" on two-income couples.

The court also has become a haven for tax protesters and, until recently, when Congress stiffened the interest and penalty provisions, it was regarded as a good place to park a tax case for a few years while collecting interest on money owed Uncle Sam.

In an effort to discourage frivolous cases, the court raised its filing fee a few years back, from $10 to $60. But the higher fee hasn't made much of a dent in the caseload.

"If they think they're right, that filing fee won't make much difference," Dawson said. "We've had $9, $10 cases -- smaller than the filing fee."

But even the small cases can involve important points of law, as a 1976 dispute illustrates. The case, from Rhode Island, involved $36.68, but it centered on a change in IRS rules that affected thousands of Rhode Islanders who contributed to a state unemployment fund for the self-employed.

The IRS tried to settle the case out of court after discovering that it had sent the dunning letter to one of Rhode Island's most prominent tax lawyers, but Dawson refused to allow the settlement. The IRS lost, and it wasn't long before the rule was changed back.

"Taxpayers win some, they sure do," Dawson said. "Some of their arguments are sound and pretty logical."

Which is not to suggest that the IRS is at any disadvantage in Tax Court. Dawson and Sterrett are judges, not ombudsmen, and of the 1,746 opinions issued in fiscal 1984 (including special trial and small tax cases), 859 were decided totally in the government's favor. Taxpayers won clear victories in 74 cases, although they won at least something in 733 "split" decisions. The other 80 cases were dismissed.

"You have some case where the taxpayer owes $1,000, and you know the poor bastard doesn't have it," Sterrett said, shaking his head. "You decide against him. This is a country of laws, not of men."

Still, Dawson and Sterrett say they have noticed an increasing tendency among taxpayers to blur the distinction between tax avoidance and tax evasion.

Indeed, the court's recent caseload reflects an almost frenzied search for tax relief, especially by middle- or low-income taxpayers unable to afford the shelters of the rich.

There is, for example, a glut of cases involving minister-by-mail schemes, where the taxpayer takes a vow of poverty and puts earnings into a supposedly nontaxable "church" account. A more recent flurry of tax-shelter cases involves reprints of classic books, artwork and records -- some of which offer suspiciously large tax deductions for relatively small investments.

As the tax law gets more complex, the tax-avoidance schemes get more elaborate, and a single questionable tax-shelter can bring hundreds of cases into Tax Court.

"It's white-collar crime, some of it," Sterrett said. "I think we're getting close to the point where you give yourself the benefit of the doubt when you really doubt it."

Sterrett recalls hearing a case in Maine years ago, where the taxpayer was more upset over the principle than the money involved. "He was quite emotional and he said, 'For them to doubt me, to call me a crook . . . ' " Sterrett said. "You don't see that much any more, and that's bad for the country."

Which gets us back to Loyal Osterlund, sitting jut-jawed in a Philadelphia courtroom. He won't know for six months or more whether he has won or lost his case, but the complexities of the tax code already have added the ultimate kicker.

If the government's view prevails, according to Osterlund's accountants, it will shift tax liability from Osterlund's high-bracket personal return to his lower-bracket corporate return. If the IRS wins, in other words, it will get less tax from Osterlund.

"We don't try to cheat the government," he said adamantly.