THE FARM BILL all year has been a test of firmness waiting to be failed. The House Agriculture Committee has now stepped up to the challenge and failed it. The Senate committee has done better, though in some respects only marginally so. We wrote in sympathy earlier in the year that the agriculture committees had the least forgiving job in Congress. To save their hurting constituencies they must squeeze them in already ruinous times, and everyone knows it. In differing degrees they have evaded the task.

The politics are plain enough. The president has threatened on both budget and policy grounds to veto a bill that does not lower the lake of agricultural supports in the country. The Democrats -- who controlled the outcome in the House and on some issues had the controlling votes in the Senate committee as well -- see only gain for their party next year whichever way the issue goes, whether the president is the heavy who forces deeper cuts or they are able to back him down. It is not an inspiring way to set national farm policy.

The pivotal farm programs are those for wheat and feed grains. They involve two kinds of supports, price and income. The price supports work through loan rates, prices at which the government will take products on "loan" when the markets are low. In effect, these are minimum U.S. prices -- no farmer need sell for less -- and in recent years they have been much higher than world market prices. U.S. products have become residual, the last to be bought, and a lot have been left in government bins.

The administration has rightly pressed the committees to reduce the loan rates to restore the competitiveness of domestic commodities while cutting government costs. Eased along by grains subcommittee chairman and Democratic whip Thomas Foley, the House members had nearly decided to do so. Then they buckled, adding a provision under which there would first have to be a referendum in which farmers could choose instead to keep high domestic prices but restrict production. The government would be a presence in every field; it would have to estimate demand each year, fine-tune production, distinguish between grain for domestic use and export, issue marketing certificates, in some cases subsidize exports. It is a burdensome plan whose clearest purpose is to relieve the members from a burdensome vote. The president said a bill containing such a provision would be vetoed. It should be.

The other form of support is a simpler check-writing program. When prices fall below certain targets, farmers -- whether or not they have left their products on loan with the government -- are also given "deficiency payments" to keep up their incomes. The administration wants these sharply cut as well, but members have resisted. Some deficiency payments line the pockets of very large producers, but others are sustenance for family farmers. Mr. Foley originally proposed as a compromise lowering the targets, but gently. That is what should be done. The bill instead would freeze them for two years, then give the agriculture secretary putative discretion to cut them, but would add so many conditions he could never do it.

In other important areas, the House bill is simply indulgent. Dairy price supports are too high, eliciting too much milk. The bill would raise them further; milk drinkers would pay more. Some of the additional income from this legislated price increase would then be recaptured by the government through an assessment on producers and recycled 1) to pay some farmers to cut their herds, in hopes of reducing future production and 2) to indemnify the government if production was still so high that it had to buy more than so many billion pounds of surplus a year. Program costs would be shifted from the public as taxpayers to the public as consumers; consumers would pay more in part to shore up the system that was forcing them to pay more. The dairy price supports should go down. So should those for the sugar industry; the bill would maintain them at present levels.

The Senate bill is equally solicitous toward sugar. But it would reduce dairy-price supports straightforwardly, and gradually move loan rates toward below- market levels to put U.S. harvests back into commerce. It, too, has a referendum provision, but one that would affect wheat only and be simpler to carry out. It contains what are meant to be new inducements to farmers to redeem and sell crops left on loan with the government, emptying the bins. Under certain circumstances these could add appreciably to costs; they are untested, and no one quite knows what their impact would be.

The bill would also freeze target prices for four years to protect farmer incomes. This became the major issue between the parties in the committee. Republicans said it would be too costly, but it was the Democrats' price for moving the bill to the floor.

There are two ways for the fight to go next. One is toward gesture and veto. Some people think there can be no bill without this catharsis. The other is toward compromise. A responsible farm bill is still retrievable from the committee drafts. The gift- wrapped House dairy section needs to be trashed on the floor or in conference; the Democrats should be embarrassed to have it in their bill. Their referendum proposal should also be set aside, as should the more limited one in the Senate bill. The Democrats should then compromise on income supports -- lower the ceiling on payments (now $50,000 a year), target them better, let them drift down over the life of the bill -- and the Republicans should give ground on costs.

There is too sensitive a crisis in the Farm Belt right now for budget lectures. The Democrats are right that the farm economy needs gentler treatment and longer-term support than the administration has proposed. But it also badly needs more discipline than the Democrats have been able to apply -- either to farmers or themselves. There is a reachable middle ground -- if there is a will to reach for it.