6. As shown in Figure 2, in rectangle $A B C D$, $A B=\sqrt{2} A D$. A semicircle is drawn outside the rectangle $A B C D$ with $A B$ as the diameter. $P$ is a moving point on the semicircle, and $P C, P D$ intersect $A B$ at points $E, F$ respectively. Then the triangle formed by segments $A E$, $B F$, and $A B$ is ( ).
(A) acute triangle
(B) right triangle
(C) obtuse triangle
(D) cannot be determined
6. B.

As shown in Figure 4, draw $P H \perp C D$ at $H$, intersecting $A B$ at point $G$. Let $A D=$
1. Then $A B=\sqrt{2}$. Let
$$
\begin{array}{l}
A E=x, B F=y, \\
P G=h, A G=z .
\end{array}
$$

Since $\triangle P D C \backsim$
$\qquad$ $\triangle P F E$, we have
$$
\frac{P G}{P \tilde{H}}=\frac{E F}{C D} \text {. }
$$

Also, $C D=A B, H G=A D$, thus
$$
\frac{h}{h+1}=\frac{x+y-\sqrt{2}}{\sqrt{2}} \text {. }
$$

Connect $P A$ and $P B$. Since point $P$ lies on the semicircle with $A B$ as the diameter, $\triangle A P B$ is a right triangle.
By $P G \perp A B$, we know $P G^{2}=A G \cdot B G$, i.e.,
$$
h^{2}=z(\sqrt{2}-z) \text {. }
$$

Also, $\triangle P G E \backsim \triangle C B E$, so $\frac{P G}{C B}=\frac{E G}{B E}$, i.e.,
$$
h=\frac{x-z}{\sqrt{2}-x} \text {. }
$$

From equations (1), (2), and (3), we get $x^{2}+y^{2}=2$.
Since $A B^{2}=(\sqrt{2})^{2}=2$, we have
$$
A E^{2}+B F^{2}=x^{2}+y^{2}=2=A B^{2} \text {. }
$$