Shanfang suibi 山房隨筆 "Random notes from a mountain studio" is a collection of source materials for the literary history of the Song 宋 (960-1279) and Yuan 元 (1279-1368) periods. Its author was Jiang Zhengzi 蔣正子, whose dates of life are unknown, but he must have lived during the transition period from the Song to the Yuan. He states that he served as an educational instructor (xueguan 學官) in Liyang 溧陽 (in today's Jiangsu province).
Although the title is "casual notes" (suibi 隨筆), the book in fact resembles a work in the shihua 詩話 genre, which is poetry criticism. It discusses, for example, the achievements of figures such as Xia Gui 夏貴 (1197-1279), Jia Sidao 賈似道 (1213-1275), Zhang Shijie 張世傑 (d. 1279), and Zhao Huai 趙淮 during the fall of the Song dynasty, as well as poems by Du Shanfu 杜善夫 and Nie Bichuang 聶碧窗. It also quotes a poem by the monk Benzhen 本真, Wumen shangyuan 吳門上元 "Lantern festival at Wumen", which sharply exposes the corruption and greed of local officials. These materials are of considerable value for the study of the history and poetry of the very late Song period.
The book, however, also contains some inaccurate accounts. For instance, it attributes to Lu Xiufu 陸秀夫 an elegy for Zhang Shijie to Lu Xiufu 陸秀夫, but in fact Lu Xiufu died before Zhang Shijie and therefore could not have composed such a poem. Other statements are clearly fictitious, merely expressing the lingering hopes of those who survived the fall of the dynasty.
The text is included in the series Baichuan xuehai 百川學海, Ouxiang shiling 藕香拾零, Siku quanshu 四庫全書, Gujin shuohai 古今說海, Baihai 稗海, Shuofu 說郛, Zhibuzuzhai congshu 知不足齋叢書, Lidai shihua 歷代詩話, Shuoku 說庫 and Congshu jicheng chubian 叢書集成初編.