Farm interests squared off against maritime interests in a day-long farm bill battle in the Senate yesterday, but the lawmakers talked themselves onto a parliamentary shoal.

The inconclusive fight was over the controversial cargo-preference law requiring that at least 50 percent of such government-generated cargoes as food-aid shipments, be transported on U.S. flag vessels.

A compromise proposal, likely to be adopted today after surviving a flurry of assaults, provides that in the future 75 percent of such cargoes would have to move on the more expensive U.S. ships but that other federal farm-export programs would be exempt from cargo-preference rules.

The farm bloc was thrown into disarray earlier this year after a federal judge ruled that a special $500 million Agriculture Department grain-export program had to operate under cargo preference. Rather than spend an additional $50 million on shipping costs, Agriculture Secretary John R. Block canceled the program.

The compromise was engineered by Sen. Thad Cochran (R-Miss.) after months of negotiating between agricultural and shipping interests. Efforts to exempt the export-credit programs were unsuccessful in the House.

Great Lakes states senators, led by Alan J. Dixon (D-Ill.) and Rudy Boschwitz (R-Minn.), argued at length yesterday that the compromise would severely damage their shallow-water ports, not accessible to large U.S. grain-hauling vessels. Their efforts to stop the compromise failed.

Cochran's compromise provides that the extra cost of shipping 25 percent more food-aid grain on U.S. vessels would be borne by the Transportation Department, rather than the USDA.

The Senate's day-long foray into cargo preference, less controversial than other pending farm-support issues, suggested that final action on the farm bill could be weeks away.

Majority Leader Robert J. Dole (R-Kan.) said the Senate will spend most of the rest of this week on the bill but that other measures could be considered at any time. He hinted that the farm bill might not be completed "until the holidays" if it continues at its snail-like pace.

The Senate also approved as part of the farm legislation a package of amendments to the Animal Welfare Act, requiring more humane treatment of research animals.

The amendments, pushed by Dole, would require laboratories and research institutions to adopt research methods that minimize animals' pain and stress and require formation of committees to monitor compliance in individual laboratories.

The Dole amendments are similar to a House bill sponsored by George E. Brown Jr. (D-Calif.). Although the House-passed farm bill contains no animal-welfare provisions, the Senate action is expected to survive a House-Senate conference that would produce final farm legislation.