There is general (though not unanimous) scholarly consenus that the last 40 chapters of the novel were not written by Cao Xueqin 曹雪芹. The novel circulated in manuscript form for decades beginning in 1754, in versions of varying length, but none longer than 80 chapters. It is clear that chapter 80 does not mark the end of the novel—too many issues remain unresolved. But the trajectory toward an ending has been established–the Jia 賈 family is in decline and it is increasingly clear that Baoyu 寶玉 will not marry Daiyu 黛玉.
In 1791, Gao E 高鶚 and Cheng Weiyuan 程偉元 published the novel for the first time. This first printed edition contained 120 chapters. Gao 高 and Cheng 程 claimed to have discovered missing chapters written by Cao Xueqin 曹雪芹; they asserted that their role was merely as editors. The degree to which Gao 高 and Cheng 程 might have had access to drafts or notes written by Cao 曹 is uncertain, but most (though not all) scholars think that the final chapters mark a departure from the first eighty. Waiyee Li has suggested that the final 40 chapters be regarded as a sequel to the novel rather than as an integral part of it. The best English translation replicates the divsion by dividing the work of translation: David Hawkes translated the first 80 chapters and John Minford translated the last 40.
The novel is normally published and read in its 120 chapter version. Some prominent scholars, such as Zhou Ruchang 周汝昌 and Liu Xinwu 劉心武, have argued against this practice, because, in their opinion, the ending of the novel is not consistent with an ending that Cao Xueqin 曹雪芹 would have written.
Dissatisfaction with the ending of the novel has led any number of adapters to write endings which are at variance with the 120 chapter published edition. In the 120 chapter version of the novel, Baoyu 寶玉 and Baochai 寶釵 marry, and Baochai 寶釵 becomes pregnant. Baoyu 寶玉finally seems to take studying for the civil service examinations seriously, and indeed passes the examinations with flying colors. But he never comes home from the examinations; he wanders off and becomes a monk.
A prominent example of a revision of the ending occurs in the 1987 television series, in which Daiyu 黛玉 died before the marriage of Baoyu 寶玉 and Baochai 寶釵. In that version (but not in the novel) the entire Jia 賈 family ends up in jail. The 2016 opera by Bright Sheng and David Henry Hwang continues this tradition of rewriting the ending—in their ending, Daiyu 黛玉 does not waste away as she does in the novel but rather commits suicide by walking into a river, which forms a dramatic climax to the opera. In the Sheng/Hwang version, Daiyu 黛玉 has the last word, or rather the last action. The opera ends with her suicide.
Tina Lu asks “Why was this novel so difficult to end? Why—no matter what their authorship—is the tone of the concluding chapters so different from that of the chapters preceding?” ( Lu, “The End of Stone” in Schonebaum and Lu, 110). She identifies a tension between mainstream Qing values and what she terms “countercultural” values. Baoyu 寶玉 and Daiyu 黛玉 sit uncomfortably in the high stream of eighteenth-century Confucian culture. And yet, as Lu writes, “It seems to have been impossible to imagine a world without an emperor, without families organized around patriarchies, without the imperative to leave male heirs.” (Lu “The End of Stone” 112) This tension is one of the reasons the novel is so interesting and is one of the reasons people have felt compelled to rewrite the ending. The rewritings are often made in an attempt to come to terms with the difference between eighteenth-century Confucian culture and the culture of the authors of the revision. We can see this clearly articulated in the Sheng/Hwang opera. They discuss it in their interview with Ann Waltner.