Repository navigation
Description
Hello,
Thank you for maintaining Vortex. I have been using it as a second GPU target.
I would like to report a handshake problem in VX_fpu_fpnew that produces zero results in lanes other than the one that releases the group. It is reproducible with a small directed test. I am currently requesting a CVE ID for it through MITRE in its role as CNA of Last Resort, which asks for an issue link for tracking; CWE-1298 is a suggested mapping, and the CNA decides whether it qualifies. I would rather have your assessment first and will follow whatever timeline you prefer.
What the RTL does
VX_fpu_fpnew instantiates one fpnew_top per lane inside the generate loop at line 198 (the instance itself is at line 208), but the wrapper takes the group's response handshake, tag, exception flags and input ready from lane 0 only, inside the if (i == 0) block at lines 236 to 241:
// abridged: port list shortened, control flow unchanged; label spelling as in the tree
for (genvar i = 0; i < NUM_LANES; ++i) begin : g_fpnew_coreses
fpnew_top ... (.in_valid_i(fpu_valid_in), .in_ready_o(fpu_ready_in_uq),
.result_o(fpu_result[i]), .out_valid_o(fpu_valid_out_uq),
.out_ready_i(fpu_ready_out), .status_o(fpu_status_uq));
if (i == 0) begin : g_output_0
assign {fpu_tag_out, fpu_has_fflags_out} = fpu_tag;
assign fpu_valid_out = fpu_valid_out_uq;
assign fpu_ready_in = fpu_ready_in_uq;
assign fpu_status = fpu_status_uq;
end
end
Two things then hold at once. The group is released by lane 0's out_valid, and every lane sees the same downstream out_ready_i (line 232). DIVSQRT is configured as MERGED with a distributed pipeline, so per-lane latency depends on the operands and the lanes do not finish together. A lane that finishes before lane 0 can therefore complete its own handshake while the group is still open, and a lane still running when lane 0 releases the group is read before it has produced anything. In both cases the final result observed for that lane is zero. I have not instrumented the buffer itself, so the step from the early release to that zero is inferred from the RTL and from the symptom, not traced.
mask_in is declared at line 35 and marked unused at line 197 (UNUSED_VAR), so masking lane 0 does not suppress the early release either.
Line numbers follow master at 2026-10-27 (265 lines). The measured commit b8c5a24 carries the same code at 165, 166 and 204 to 208; only the offsets differ, the structure is identical.
What I measured
Configuration: upstream commit b8c5a24, XLEN 64, 8 lanes, 4 warps, FPnew backend. The RTL above is unchanged on master.
11-case directed suite: SimX 0 mismatches, the default DPI FPU backend 0 mismatches, and 16 mismatches on the FPnew backend
of those 16: 13 zero results in lanes other than the releasing one (cases B, C, D, F and G), 1 NaN-boxing difference (case I), and 2 exception-flag differences (cases J and K)
32-program campaign, 22,564 div/sqrt issues: the bound property (out_valid && out_ready) |-> (&lane_valid) fails 6,352 times. The property is written over all lanes; for a masked group it should be read as &(lane_valid | ~mask), which is the form used in the suggestion.
in a separate run of the same campaign with an experimental wrapper that waits for every active lane: 0 failures over 22,516 issues. Re-running the directed suite under the same wrapper also removes the 13 zero results. The two campaign runs are not event-paired; the wrapper changes when a group retires, so the issue count differs slightly.
The two directions both appear in the suite, which is why I read this as an asymmetric handshake rather than simply "lane 0 is early". In cases B, D, F and G the releasing lane is the fast one — a special-value divide in B, F and G, a masked lane holding 0/0 in D — and lanes 1 to 3 come back zero. In case C it is the reverse: lane 0 computes an ordinary divide, lane 2 computes x/0 and completes first, and it is lane 2 that comes back zero instead of +inf.
Suggested direction
Aggregate the active lanes instead of trusting lane 0. This is a direction, not a complete patch: the mask must belong to the in-flight instruction, the fast lanes' results have to be held, and the input side must not accept a new group while the current one is still open. The aggregate on its own is not enough: every lane sees the same downstream out_ready_i, so a fast lane would complete its own handshake and drop its valid before the group is complete, and the aggregate would never be asserted. The ready path has to be gated as well, for example:
assign fpu_valid_out = &(fpu_valid_out_vec | ~mask_in);
with each lane's out_ready_i held low until the aggregated group valid is asserted, and fpu_ready_in taken from the AND of the active per-lane in_ready_o. Small per-lane skid buffers are the alternative if the extra latency is not acceptable. This is the form I tested, as an experiment; I am not proposing it as the final fix.
Scope
This report is about the handshake only. I do see numerical differences on a different fixture, but I have not traced their cause and they are not part of this report. I have no exploit; the test is ordinary user-mode code, and the effect is silent wrong results rather than a crash or a hang.
The 11-case test, the traces and the experimental patch are available, and I am happy to send them in whatever form is convenient.
Thank you for your time.
Best regards,
Yiran He
University of Chinese Academy of Sciences
Activity
tinebp commentedon Nov 19, 2026
Fixed by #486.